Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2954580yba; Mon, 6 May 2019 14:29:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEzfBY52zFlCVT0eoaYbWZpVNUEpoiHpaYrecPUVQ4D7Xs305NB0S6YGBneMmF3r+W4L+d X-Received: by 2002:a62:e50a:: with SMTP id n10mr37009890pff.55.1557178195720; Mon, 06 May 2019 14:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557178195; cv=none; d=google.com; s=arc-20160816; b=iCc4aT39ZTVJyTjEroizfQem13DvLzYeci2eR4jJCmBIWrAER5JPg7Zs+rgqTuZMUe Pf5JGmyP02XLX1taiv/S3VN3heODHX952cM9hoTlry6BlDjP0jj4kuw2cTOyDBfqQUlV 3vfW46F/tJ7zOF78RBozGnITdX3XrJDwsOWRfLtTnwwMUNnCVfsTdOVfBVJkQGT/zhGw neEBI8DJ3yYpl2+EOM4ifj6k8SQgI1B+s2fEi/OcW3m2yzSVKw6bjwuOdBQj13zzzWoc I/H0ge58GC1EMLAsGNFyChseFR3gpHm/crV8cFGO8xDdSH6NTJlgIFTaLRnktzedoS/W hRhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=VhvKAGUYOPwKbKSmPtz845CkshJTTuAXjzJ7SSJUdR4=; b=wliQ2P+yWJqX+CoZWasXc350sO2vAl17AmdllJVXq+fouSz3lMHQkrPYju8srgFmjr VCZB7+2pV3WXCLCz6bC5OxIfnYmWBqDM9cry3JdLq1807CAYLGgIxCznUn1AcK6EZuBE GmyBx7KGBN1YPIf/R7JXOADSqBo6MOBcJQdn0871NLemOSXkbn+oWJ4JPHXenJlq25G8 HUYNIgANv0MHtRnJvfKAuUzDAPJoTCmI0TZZdKxbGdkpeILndq8mOcU88iwl6NlcXGd0 svYd7TDKWU+SM5SkT0Tuzfq8edSzq2JY4cu8gWcy7Pb9D6khP9JE26qgOhBcEPyC+hci zs0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=k6lbaM1F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si16518057pgj.427.2019.05.06.14.29.40; Mon, 06 May 2019 14:29:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=k6lbaM1F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbfEFV1H (ORCPT + 99 others); Mon, 6 May 2019 17:27:07 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:40001 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727032AbfEFV0v (ORCPT ); Mon, 6 May 2019 17:26:51 -0400 Received: by mail-it1-f194.google.com with SMTP id g71so7289153ita.5 for ; Mon, 06 May 2019 14:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :reply-to:organization; bh=VhvKAGUYOPwKbKSmPtz845CkshJTTuAXjzJ7SSJUdR4=; b=k6lbaM1FPDDY+6qCyCE0dKwahwccspWmiuCLfSp50sb2ejSUdUyxuOaA4nmahfMkn/ UCQMU7VCqHI9mea/vz0dxyuISDgkFcWO8qEuSec+vcZ+v3oeXXHV+KQGWDGvFPUJO+wf +E1JKZ3QCT8f5TFaFsNh8aeT8wwNvnGzuDC1La2CQCikEr5maE40/OlAyo+PTDLjDiRj z5VI/rrMVH/Xluia1hvB5Z9M/VjHMj9FPbJA87LzF1jnq0IXDOhz74MCK+dYHmJYNUBZ hAQgtDrofP7Qckc5oxkcbvPDARwbNQRjyBFmBeDiNbAiz8Zn0Gyc47Jmgj3BshJJfE2f +AcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:reply-to:organization; bh=VhvKAGUYOPwKbKSmPtz845CkshJTTuAXjzJ7SSJUdR4=; b=YncSUndWHyU4GROGKHbjBdWIacF+FZr9Zi0g1SyMxk1eH+aK82gfd/cWtLI1nE8AMf upUY2D2HpRF/P4zuUHqXQDZcaUvAKkRs81mQKJfC99js5Wy9Uqji0Q6Lu5B33lDcgNHE By5rGmhNK2Olco+KYuZ2c04p71jOf144YjewwvtULnS5J0QI+aUT8SwSdbNQJ0+byOxC +XoJoEvOd9AwDx6QLd9APE+ntIHuUM08cX3bQ/Mw3oPgjpb1HLZzvxH7vg7ej2+HPat0 wgvYAyx9z6baQYFJqe4Qiu0KF/p0tUs4iCy046BzVklotzVaA1bTZLfP9ZSL8dy9k0TJ 8k9Q== X-Gm-Message-State: APjAAAW3fdQDpTtVXDuWlpk4hqJy3KcTEtHldnji21VRy1w1TUnUa6Db wdBRP/bQh4voplvFG+5WCZk= X-Received: by 2002:a05:660c:12d2:: with SMTP id k18mr19375340itd.33.1557178010778; Mon, 06 May 2019 14:26:50 -0700 (PDT) Received: from nuc8.lan (h69-131-112-51.cntcnh.dsl.dynamic.tds.net. [69.131.112.51]) by smtp.gmail.com with ESMTPSA id v25sm4268009ioh.81.2019.05.06.14.26.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 14:26:49 -0700 (PDT) From: Len Brown To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Len Brown , Zhang Rui Subject: [PATCH 20/22] hwmon/coretemp: rename internal variables to zones from packages Date: Mon, 6 May 2019 17:26:15 -0400 Message-Id: X-Mailer: git-send-email 2.18.0-rc0 In-Reply-To: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1557177585.git.len.brown@intel.com> References: <6f53f0e494d743c79e18f6e3a98085711e6ddd0c.1557177585.git.len.brown@intel.com> Reply-To: Len Brown Organization: Intel Open Source Technology Center Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Len Brown 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 Cc: Zhang Rui --- 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