[V4,1/4] hwmon/coretemp: Rename indx to index

Message ID 20221014090147.1836-2-rui.zhang@intel.com
State New
Headers
Series x86/topology: Fix CPUID.1F handling |

Commit Message

Zhang, Rui Oct. 14, 2022, 9:01 a.m. UTC
  Use variable name 'index' instead of 'indx' for the index in the
core_data[] array.

No functional change expected.

Cc: stable@vger.kernel.org
Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/hwmon/coretemp.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
  

Comments

Guenter Roeck Oct. 14, 2022, 1:26 p.m. UTC | #1
On 10/14/22 02:01, Zhang Rui wrote:
> Use variable name 'index' instead of 'indx' for the index in the
> core_data[] array.
> 
> No functional change expected.
> 
> Cc: stable@vger.kernel.org
> Suggested-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/hwmon/coretemp.c | 18 +++++++++---------
>   1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
> index ccf0af5b988a..bfdcfe8ccb34 100644
> --- a/drivers/hwmon/coretemp.c
> +++ b/drivers/hwmon/coretemp.c
> @@ -515,15 +515,15 @@ coretemp_add_core(struct platform_device *pdev, unsigned int cpu, int pkg_flag)
>   		dev_err(&pdev->dev, "Adding Core %u failed\n", cpu);
>   }
>   
> -static void coretemp_remove_core(struct platform_data *pdata, int indx)
> +static void coretemp_remove_core(struct platform_data *pdata, int index)
>   {
> -	struct temp_data *tdata = pdata->core_data[indx];
> +	struct temp_data *tdata = pdata->core_data[index];
>   
>   	/* Remove the sysfs attributes */
>   	sysfs_remove_group(&pdata->hwmon_dev->kobj, &tdata->attr_group);
>   
> -	kfree(pdata->core_data[indx]);
> -	pdata->core_data[indx] = NULL;
> +	kfree(pdata->core_data[index]);
> +	pdata->core_data[index] = NULL;
>   }
>   
>   static int coretemp_probe(struct platform_device *pdev)
> @@ -647,7 +647,7 @@ static int coretemp_cpu_offline(unsigned int cpu)
>   	struct platform_device *pdev = coretemp_get_pdev(cpu);
>   	struct platform_data *pd;
>   	struct temp_data *tdata;
> -	int indx, target;
> +	int index, target;
>   
>   	/*
>   	 * Don't execute this on suspend as the device remove locks
> @@ -661,12 +661,12 @@ static int coretemp_cpu_offline(unsigned int cpu)
>   		return 0;
>   
>   	/* The core id is too big, just return */
> -	indx = TO_ATTR_NO(cpu);
> -	if (indx > MAX_CORE_DATA - 1)
> +	index = TO_ATTR_NO(cpu);
> +	if (index > MAX_CORE_DATA - 1)
>   		return 0;
>   
>   	pd = platform_get_drvdata(pdev);
> -	tdata = pd->core_data[indx];
> +	tdata = pd->core_data[index];
>   
>   	cpumask_clear_cpu(cpu, &pd->cpumask);
>   
> @@ -677,7 +677,7 @@ static int coretemp_cpu_offline(unsigned int cpu)
>   	 */
>   	target = cpumask_any_and(&pd->cpumask, topology_sibling_cpumask(cpu));
>   	if (target >= nr_cpu_ids) {
> -		coretemp_remove_core(pd, indx);
> +		coretemp_remove_core(pd, index);
>   	} else if (tdata && tdata->cpu == cpu) {
>   		mutex_lock(&tdata->update_lock);
>   		tdata->cpu = target;
  
Dave Hansen Oct. 14, 2022, 5:12 p.m. UTC | #2
On 10/14/22 02:01, Zhang Rui wrote:
> Use variable name 'index' instead of 'indx' for the index in the
> core_data[] array.
> 
> No functional change expected.
> 
> Cc: stable@vger.kernel.org
> Suggested-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Hi,

Thanks for paring this series down.

I think I'm also going to pull this patch out of the series before I
apply it and just rework 2/4 to apply cleanly without it.  I just can't
put this in our "urgent" fixes pile and keep the stable@ tag on such a
trivial rename and keep a straight face.
  
Guenter Roeck Oct. 14, 2022, 5:20 p.m. UTC | #3
On 10/14/22 10:12, Dave Hansen wrote:
> On 10/14/22 02:01, Zhang Rui wrote:
>> Use variable name 'index' instead of 'indx' for the index in the
>> core_data[] array.
>>
>> No functional change expected.
>>
>> Cc: stable@vger.kernel.org
>> Suggested-by: Ingo Molnar <mingo@kernel.org>
>> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> 
> Hi,
> 
> Thanks for paring this series down.
> 
> I think I'm also going to pull this patch out of the series before I
> apply it and just rework 2/4 to apply cleanly without it.  I just can't
> put this in our "urgent" fixes pile and keep the stable@ tag on such a
> trivial rename and keep a straight face.
> 

To be fair, this patch was only submitted as a prerequisite to the next
patch in the series because someone had objected to the use of both 'indx'
and 'index' in the driver.

Guenter
  
Zhang, Rui Oct. 16, 2022, 3:01 a.m. UTC | #4
Hi, Dave,

Thanks for taking care of this.
That totally works for me.

thanks,
rui


On Fri, 2022-10-14 at 10:20 -0700, Guenter Roeck wrote:
> On 10/14/22 10:12, Dave Hansen wrote:
> > On 10/14/22 02:01, Zhang Rui wrote:
> > > Use variable name 'index' instead of 'indx' for the index in the
> > > core_data[] array.
> > > 
> > > No functional change expected.
> > > 
> > > Cc: stable@vger.kernel.org
> > > Suggested-by: Ingo Molnar <mingo@kernel.org>
> > > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > 
> > Hi,
> > 
> > Thanks for paring this series down.
> > 
> > I think I'm also going to pull this patch out of the series before
> > I
> > apply it and just rework 2/4 to apply cleanly without it.  I just
> > can't
> > put this in our "urgent" fixes pile and keep the stable@ tag on
> > such a
> > trivial rename and keep a straight face.
> > 
> 
> To be fair, this patch was only submitted as a prerequisite to the
> next
> patch in the series because someone had objected to the use of both
> 'indx'
> and 'index' in the driver.
> 
> Guenter
>
  

Patch

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index ccf0af5b988a..bfdcfe8ccb34 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -515,15 +515,15 @@  coretemp_add_core(struct platform_device *pdev, unsigned int cpu, int pkg_flag)
 		dev_err(&pdev->dev, "Adding Core %u failed\n", cpu);
 }
 
-static void coretemp_remove_core(struct platform_data *pdata, int indx)
+static void coretemp_remove_core(struct platform_data *pdata, int index)
 {
-	struct temp_data *tdata = pdata->core_data[indx];
+	struct temp_data *tdata = pdata->core_data[index];
 
 	/* Remove the sysfs attributes */
 	sysfs_remove_group(&pdata->hwmon_dev->kobj, &tdata->attr_group);
 
-	kfree(pdata->core_data[indx]);
-	pdata->core_data[indx] = NULL;
+	kfree(pdata->core_data[index]);
+	pdata->core_data[index] = NULL;
 }
 
 static int coretemp_probe(struct platform_device *pdev)
@@ -647,7 +647,7 @@  static int coretemp_cpu_offline(unsigned int cpu)
 	struct platform_device *pdev = coretemp_get_pdev(cpu);
 	struct platform_data *pd;
 	struct temp_data *tdata;
-	int indx, target;
+	int index, target;
 
 	/*
 	 * Don't execute this on suspend as the device remove locks
@@ -661,12 +661,12 @@  static int coretemp_cpu_offline(unsigned int cpu)
 		return 0;
 
 	/* The core id is too big, just return */
-	indx = TO_ATTR_NO(cpu);
-	if (indx > MAX_CORE_DATA - 1)
+	index = TO_ATTR_NO(cpu);
+	if (index > MAX_CORE_DATA - 1)
 		return 0;
 
 	pd = platform_get_drvdata(pdev);
-	tdata = pd->core_data[indx];
+	tdata = pd->core_data[index];
 
 	cpumask_clear_cpu(cpu, &pd->cpumask);
 
@@ -677,7 +677,7 @@  static int coretemp_cpu_offline(unsigned int cpu)
 	 */
 	target = cpumask_any_and(&pd->cpumask, topology_sibling_cpumask(cpu));
 	if (target >= nr_cpu_ids) {
-		coretemp_remove_core(pd, indx);
+		coretemp_remove_core(pd, index);
 	} else if (tdata && tdata->cpu == cpu) {
 		mutex_lock(&tdata->update_lock);
 		tdata->cpu = target;