| From b32c622c5ba6dec4e6246742aa20badb4b49f4e9 Mon Sep 17 00:00:00 2001 |
| From: Zhang Rui <rui.zhang@intel.com> |
| Date: Tue, 16 Aug 2022 13:16:27 +0800 |
| Subject: [PATCH] FROMLIST: hwmon/coretemp: Rename indx to index |
| |
| Use variable name 'index' instead of 'indx' for the index in the |
| core_data[] array. |
| |
| Suggested-by: Ingo Molnar <mingo@kernel.org> |
| Signed-off-by: Zhang Rui <rui.zhang@intel.com> |
| (am from https://patchwork.kernel.org/patch/12944431/) |
| (also found at https://lore.kernel.org/r/20220816051633.17775-3-rui.zhang@intel.com) |
| |
| BUG=b:239519025 |
| TEST=None |
| |
| Signed-off-by: Srihari Uttanur <srihari.uttanur@intel.corp-partner.google.com> |
| Change-Id: If5d4ac9168de5f78027a90589cdca27e8c5f2fb3 |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3832283 |
| Reviewed-by: Sean Paul <sean@poorly.run> |
| Tested-by: Altaf Basha <altaf.basha@intel.com> |
| Commit-Queue: Victor Ding <victording@chromium.org> |
| Reviewed-by: Victor Ding <victording@chromium.org> |
| Reviewed-by: Sam McNally <sammc@chromium.org> |
| Commit-Queue: Sam McNally <sammc@chromium.org> |
| --- |
| drivers/hwmon/coretemp.c | 22 +++++++++++----------- |
| 1 file changed, 11 insertions(+), 11 deletions(-) |
| |
| diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c |
| index 8bf32c6c85d95a3c655f1819aa4c69ddbd1033fb..291566aeb7037d523c3a854da514240f609b2b46 100644 |
| --- a/drivers/hwmon/coretemp.c |
| +++ b/drivers/hwmon/coretemp.c |
| @@ -529,18 +529,18 @@ 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; |
| |
| - if (indx >= BASE_SYSFS_ATTR_NO) |
| - ida_free(&pdata->ida, indx - BASE_SYSFS_ATTR_NO); |
| + if (index >= BASE_SYSFS_ATTR_NO) |
| + ida_free(&pdata->ida, index - BASE_SYSFS_ATTR_NO); |
| } |
| |
| static int coretemp_probe(struct platform_device *pdev) |
| @@ -666,7 +666,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 i, indx = -1, target; |
| + int i, index = -1, target; |
| |
| /* |
| * Don't execute this on suspend as the device remove locks |
| @@ -683,16 +683,16 @@ static int coretemp_cpu_offline(unsigned int cpu) |
| |
| for (i = 0; i < NUM_REAL_CORES; i++) { |
| if (pd->cpu_map[i] == topology_core_id(cpu)) { |
| - indx = i + BASE_SYSFS_ATTR_NO; |
| + index = i + BASE_SYSFS_ATTR_NO; |
| break; |
| } |
| } |
| |
| /* Too many cores and this core is not populated, just return */ |
| - if (indx < 0) |
| + if (index < 0) |
| return 0; |
| |
| - tdata = pd->core_data[indx]; |
| + tdata = pd->core_data[index]; |
| |
| cpumask_clear_cpu(cpu, &pd->cpumask); |
| |
| @@ -703,7 +703,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; |
| -- |
| 2.38.1.584.g0f3c55d4c2-goog |
| |