LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, Len Brown <len.brown@intel.com>,
Zhang Rui <rui.zhang@intel.com>
Subject: [PATCH 20/22] hwmon/coretemp: rename internal variables to zones from packages
Date: Mon, 6 May 2019 17:26:15 -0400 [thread overview]
Message-ID: <db40079ffaba56c553d3061dd43b3f7b5ca30577.1557177585.git.len.brown@intel.com> (raw)
In-Reply-To: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1557177585.git.len.brown@intel.com>
From: Len Brown <len.brown@intel.com>
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 <len.brown@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>
---
drivers/hwmon/coretemp.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index c64ce32d3214..4ebed90d81aa 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -109,10 +109,10 @@ struct platform_data {
struct device_attribute name_attr;
};
-/* Keep track of how many package pointers we allocated in init() */
-static int max_packages __read_mostly;
-/* Array of package pointers. Serialized by cpu hotplug lock */
-static struct platform_device **pkg_devices;
+/* Keep track of how many zone pointers we allocated in init() */
+static int max_zones __read_mostly;
+/* Array of zone pointers. Serialized by cpu hotplug lock */
+static struct platform_device **zone_devices;
static ssize_t show_label(struct device *dev,
struct device_attribute *devattr, char *buf)
@@ -435,10 +435,10 @@ static int chk_ucode_version(unsigned int cpu)
static struct platform_device *coretemp_get_pdev(unsigned int cpu)
{
- int pkgid = topology_logical_die_id(cpu);
+ int id = topology_logical_die_id(cpu);
- if (pkgid >= 0 && pkgid < max_packages)
- return pkg_devices[pkgid];
+ if (id >= 0 && id < max_zones)
+ return zone_devices[id];
return NULL;
}
@@ -544,7 +544,7 @@ static int coretemp_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct platform_data *pdata;
- /* Initialize the per-package data structures */
+ /* Initialize the per-zone data structures */
pdata = devm_kzalloc(dev, sizeof(struct platform_data), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
@@ -579,13 +579,13 @@ static struct platform_driver coretemp_driver = {
static struct platform_device *coretemp_device_add(unsigned int cpu)
{
- int err, pkgid = topology_logical_die_id(cpu);
+ int err, zoneid = topology_logical_die_id(cpu);
struct platform_device *pdev;
- if (pkgid < 0)
+ if (zoneid < 0)
return ERR_PTR(-ENOMEM);
- pdev = platform_device_alloc(DRVNAME, pkgid);
+ pdev = platform_device_alloc(DRVNAME, zoneid);
if (!pdev)
return ERR_PTR(-ENOMEM);
@@ -595,7 +595,7 @@ static struct platform_device *coretemp_device_add(unsigned int cpu)
return ERR_PTR(err);
}
- pkg_devices[pkgid] = pdev;
+ zone_devices[zoneid] = pdev;
return pdev;
}
@@ -703,7 +703,7 @@ static int coretemp_cpu_offline(unsigned int cpu)
* the rest.
*/
if (cpumask_empty(&pd->cpumask)) {
- pkg_devices[topology_logical_die_id(cpu)] = NULL;
+ zone_devices[topology_logical_die_id(cpu)] = NULL;
platform_device_unregister(pdev);
return 0;
}
@@ -741,10 +741,10 @@ static int __init coretemp_init(void)
if (!x86_match_cpu(coretemp_ids))
return -ENODEV;
- max_packages = topology_max_packages() * topology_max_die_per_package();
- pkg_devices = kcalloc(max_packages, sizeof(struct platform_device *),
+ max_zones = topology_max_packages() * topology_max_die_per_package();
+ zone_devices = kcalloc(max_zones, sizeof(struct platform_device *),
GFP_KERNEL);
- if (!pkg_devices)
+ if (!zone_devices)
return -ENOMEM;
err = platform_driver_register(&coretemp_driver);
@@ -760,7 +760,7 @@ static int __init coretemp_init(void)
outdrv:
platform_driver_unregister(&coretemp_driver);
- kfree(pkg_devices);
+ kfree(zone_devices);
return err;
}
module_init(coretemp_init)
@@ -769,7 +769,7 @@ static void __exit coretemp_exit(void)
{
cpuhp_remove_state(coretemp_hp_online);
platform_driver_unregister(&coretemp_driver);
- kfree(pkg_devices);
+ kfree(zone_devices);
}
module_exit(coretemp_exit)
--
2.18.0-rc0
next prev parent reply other threads:[~2019-05-06 21:27 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-06 21:25 [PATCH 0/22] v5 multi-die/package topology support Len Brown
2019-05-06 21:25 ` [PATCH 01/22] x86 topology: Fix doc typo Len Brown
2019-05-06 21:25 ` [PATCH 02/22] topology: Simplify cputopology.txt formatting and wording Len Brown
2019-05-06 21:25 ` [PATCH 03/22] x86 smpboot: Rename match_die() to match_pkg() Len Brown
2019-05-06 21:25 ` [PATCH 04/22] x86 topology: Add CPUID.1F multi-die/package support Len Brown
2019-05-06 21:26 ` [PATCH 05/22] x86 topology: Create topology_max_die_per_package() Len Brown
2019-05-06 21:26 ` [PATCH 06/22] cpu topology: Export die_id Len Brown
2019-05-06 21:26 ` [PATCH 07/22] x86 topology: Define topology_die_id() Len Brown
2019-05-06 21:26 ` [PATCH 08/22] x86 topology: Define topology_logical_die_id() Len Brown
2019-05-06 21:26 ` [PATCH 09/22] powercap/intel_rapl: Simplify rapl_find_package() Len Brown
2019-05-06 21:26 ` [PATCH 10/22] powercap/intel_rapl: Support multi-die/package Len Brown
2019-05-07 12:14 ` Peter Zijlstra
2019-05-08 19:45 ` Len Brown
2019-05-06 21:26 ` [PATCH 11/22] thermal/x86_pkg_temp_thermal: " Len Brown
2019-05-06 21:26 ` [PATCH 12/22] powercap/intel_rapl: update rapl domain name and debug messages Len Brown
2019-05-06 21:26 ` [PATCH 13/22] hwmon/coretemp: Support multi-die/package Len Brown
2019-05-06 21:26 ` [PATCH 14/22] topology: Create package_cpus sysfs attribute Len Brown
2019-05-06 21:26 ` [PATCH 15/22] topology: Create core_cpus and die_cpus sysfs attributes Len Brown
2019-05-06 21:26 ` [PATCH 16/22] perf/x86/intel/uncore: Support multi-die/package Len Brown
2019-05-07 12:21 ` Peter Zijlstra
2019-05-08 19:51 ` Len Brown
2019-05-07 12:22 ` Peter Zijlstra
2019-05-08 19:51 ` Len Brown
2019-05-06 21:26 ` [PATCH 17/22] perf/x86/intel/rapl: " Len Brown
2019-05-06 21:26 ` [PATCH 18/22] perf/x86/intel/cstate: " Len Brown
2019-05-06 21:26 ` [PATCH 19/22] thermal/x86_pkg_temp_thermal: rename internal variables to zones from packages Len Brown
2019-05-06 21:26 ` Len Brown [this message]
2019-05-06 21:26 ` [PATCH 21/22] perf/x86/intel/uncore: renames in response to multi-die/pkg support Len Brown
2019-05-09 15:02 ` Liang, Kan
2019-05-13 17:30 ` Len Brown
2019-05-06 21:26 ` [PATCH 22/22] perf/x86/intel/rapl: rename internal variables " Len Brown
2019-05-09 15:04 ` Liang, Kan
2019-05-13 17:29 ` Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=db40079ffaba56c553d3061dd43b3f7b5ca30577.1557177585.git.len.brown@intel.com \
--to=lenb@kernel.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=x86@kernel.org \
--subject='Re: [PATCH 20/22] hwmon/coretemp: rename internal variables to zones from packages' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).