Re: [PATCH 2/3] cpufreq: qcom: pass pvs_name size along with its buffer
From: Viresh Kumar
Date: Mon Oct 10 2022 - 01:53:00 EST
On 01-10-22, 19:10, Fabien Parent wrote:
> @@ -265,7 +269,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
> struct nvmem_cell *speedbin_nvmem;
> struct device_node *np;
> struct device *cpu_dev;
> - char *pvs_name = "speedXX-pvsXX-vXX";
> + char *pvs_name = PVS_NAME_TEMPLATE;
> unsigned cpu;
> const struct of_device_id *match;
> int ret;
> @@ -306,8 +310,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
> goto free_drv;
> }
>
> - ret = drv->data->get_version(cpu_dev,
> - speedbin_nvmem, &pvs_name, drv);
> + ret = drv->data->get_version(cpu_dev, speedbin_nvmem, &pvs_name,
> + sizeof(PVS_NAME_TEMPLATE), drv);
Since the pvs name is always PVS_NAME_TEMPLATE, why are we even
passing it and size here ? Why not directly use it in those
get_version() implementations directly ?
> if (ret) {
> nvmem_cell_put(speedbin_nvmem);
> goto free_drv;
> --
> 2.37.2
--
viresh