Skip to content

Commit 835896a

Browse files
lenbKAGA-KOKO
authored andcommitted
hwmon/coretemp: Cosmetic: Rename internal variables to zones from packages
Syntax update only -- no logical or functional change. In response to the new multi-die/package changes, update variable names to use the more generic thermal "zone" terminology, instead of "package", as the zones can refer to either packages or die. Signed-off-by: Len Brown <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Ingo Molnar <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Cc: Zhang Rui <[email protected]> Link: https://lkml.kernel.org/r/facecfd3525d55c2051f63a7ec709aeb03cc1dc1.1557769318.git.len.brown@intel.com
1 parent b2ce1c8 commit 835896a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

drivers/hwmon/coretemp.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ struct platform_data {
109109
struct device_attribute name_attr;
110110
};
111111

112-
/* Keep track of how many package pointers we allocated in init() */
113-
static int max_packages __read_mostly;
114-
/* Array of package pointers. Serialized by cpu hotplug lock */
115-
static struct platform_device **pkg_devices;
112+
/* Keep track of how many zone pointers we allocated in init() */
113+
static int max_zones __read_mostly;
114+
/* Array of zone pointers. Serialized by cpu hotplug lock */
115+
static struct platform_device **zone_devices;
116116

117117
static ssize_t show_label(struct device *dev,
118118
struct device_attribute *devattr, char *buf)
@@ -435,10 +435,10 @@ static int chk_ucode_version(unsigned int cpu)
435435

436436
static struct platform_device *coretemp_get_pdev(unsigned int cpu)
437437
{
438-
int pkgid = topology_logical_die_id(cpu);
438+
int id = topology_logical_die_id(cpu);
439439

440-
if (pkgid >= 0 && pkgid < max_packages)
441-
return pkg_devices[pkgid];
440+
if (id >= 0 && id < max_zones)
441+
return zone_devices[id];
442442
return NULL;
443443
}
444444

@@ -544,7 +544,7 @@ static int coretemp_probe(struct platform_device *pdev)
544544
struct device *dev = &pdev->dev;
545545
struct platform_data *pdata;
546546

547-
/* Initialize the per-package data structures */
547+
/* Initialize the per-zone data structures */
548548
pdata = devm_kzalloc(dev, sizeof(struct platform_data), GFP_KERNEL);
549549
if (!pdata)
550550
return -ENOMEM;
@@ -579,13 +579,13 @@ static struct platform_driver coretemp_driver = {
579579

580580
static struct platform_device *coretemp_device_add(unsigned int cpu)
581581
{
582-
int err, pkgid = topology_logical_die_id(cpu);
582+
int err, zoneid = topology_logical_die_id(cpu);
583583
struct platform_device *pdev;
584584

585-
if (pkgid < 0)
585+
if (zoneid < 0)
586586
return ERR_PTR(-ENOMEM);
587587

588-
pdev = platform_device_alloc(DRVNAME, pkgid);
588+
pdev = platform_device_alloc(DRVNAME, zoneid);
589589
if (!pdev)
590590
return ERR_PTR(-ENOMEM);
591591

@@ -595,7 +595,7 @@ static struct platform_device *coretemp_device_add(unsigned int cpu)
595595
return ERR_PTR(err);
596596
}
597597

598-
pkg_devices[pkgid] = pdev;
598+
zone_devices[zoneid] = pdev;
599599
return pdev;
600600
}
601601

@@ -703,7 +703,7 @@ static int coretemp_cpu_offline(unsigned int cpu)
703703
* the rest.
704704
*/
705705
if (cpumask_empty(&pd->cpumask)) {
706-
pkg_devices[topology_logical_die_id(cpu)] = NULL;
706+
zone_devices[topology_logical_die_id(cpu)] = NULL;
707707
platform_device_unregister(pdev);
708708
return 0;
709709
}
@@ -741,10 +741,10 @@ static int __init coretemp_init(void)
741741
if (!x86_match_cpu(coretemp_ids))
742742
return -ENODEV;
743743

744-
max_packages = topology_max_packages() * topology_max_die_per_package();
745-
pkg_devices = kcalloc(max_packages, sizeof(struct platform_device *),
744+
max_zones = topology_max_packages() * topology_max_die_per_package();
745+
zone_devices = kcalloc(max_zones, sizeof(struct platform_device *),
746746
GFP_KERNEL);
747-
if (!pkg_devices)
747+
if (!zone_devices)
748748
return -ENOMEM;
749749

750750
err = platform_driver_register(&coretemp_driver);
@@ -760,7 +760,7 @@ static int __init coretemp_init(void)
760760

761761
outdrv:
762762
platform_driver_unregister(&coretemp_driver);
763-
kfree(pkg_devices);
763+
kfree(zone_devices);
764764
return err;
765765
}
766766
module_init(coretemp_init)
@@ -769,7 +769,7 @@ static void __exit coretemp_exit(void)
769769
{
770770
cpuhp_remove_state(coretemp_hp_online);
771771
platform_driver_unregister(&coretemp_driver);
772-
kfree(pkg_devices);
772+
kfree(zone_devices);
773773
}
774774
module_exit(coretemp_exit)
775775

0 commit comments

Comments
 (0)