Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1682911pxb; Sat, 23 Jan 2021 02:10:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBwkMhgs5qUj6rabwILggnedBHZ9xnqpHlW41Pky166U27gLGVq2iGkrRWKv9+cUuYP7Ef X-Received: by 2002:a17:906:53d0:: with SMTP id p16mr5457501ejo.38.1611396609813; Sat, 23 Jan 2021 02:10:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611396609; cv=none; d=google.com; s=arc-20160816; b=wOzLJoQI6vjsUuDYq6x82BNIdQUl3IkKu+OaXm1Zyz9uJuFQJEqNo1dLg9So9CPUX/ pulV2pl92gCWrBY4J9/CM+FCQr8X7o+/hKEf7ysJD6QQH7yu9CVXl+6xe12yeaynZma5 S+XvrOItUEraiy/KrydLRi23rzLc02lLDBQjlFp34MTvesCgHLX54ZRGyYTchr/a0b50 KRgJGHNKPbSerPS/SinFT2zWR6TURTQIWbxN84E+CEAQqc+kcnasTFG5/3Yrhseiedag lt5D90C0yLth/VStdz9YD3wlF6jQU9LwVUM2qm2vwicKLIaT23eF65xAHWj++UDYIRDD 6XKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7n09EOYLpSuYcbm+cGfNGJMUI/5qSVPmveoQu+NTMng=; b=DMlaMdobJpPG6CBn/qmvNcr0H4xfOhk3cdOpiE7xw8elGaiebSFIi4Z51RQhrv2hgT HWzZDXGwNQagsgFDnCUdutbEXzRwK0qizgXfTRnh6fymzWbyGI9SpcqkSsbItIPwGDXh n9CMjkvCNEw8HgGyCGcOdL+fzz3bDqwr/UcHTCV/OQ/wom7kELAetxeXjGs6+0U7Coe7 hAYO83jFLS6fiTaxws8gLHydNaAkZntTCdxgDBOGKp4eLbl73ERLNvsrNnN/SjTyQul/ eN9G37RFr4m0mJoph7+vqCZ08u9j9h6Roa4T1cYHYbZ34+ptBUD17L2wsbvOTl9UjeFZ HYjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q9si4232580edw.371.2021.01.23.02.09.46; Sat, 23 Jan 2021 02:10:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726913AbhAWKGx (ORCPT + 99 others); Sat, 23 Jan 2021 05:06:53 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11577 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbhAWKGt (ORCPT ); Sat, 23 Jan 2021 05:06:49 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DNBYy4XgczMNbZ; Sat, 23 Jan 2021 18:04:38 +0800 (CST) Received: from huawei.com (10.175.127.234) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Sat, 23 Jan 2021 18:05:58 +0800 From: Yunfeng Ye To: , , CC: , , , Subject: [PATCH 2/2] powercap/intel_rapl: Use topology interface in rapl_init_domains() Date: Sat, 23 Jan 2021 05:06:08 -0500 Message-ID: <20210123100608.2349629-2-yeyunfeng@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210123100608.2349629-1-yeyunfeng@huawei.com> References: <20210123100608.2349629-1-yeyunfeng@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.234] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's not a good way to access the phys_proc_id of cpuinfo directly. So using topology_physical_package_id(cpu) instead. Signed-off-by: Yunfeng Ye --- drivers/powercap/intel_rapl_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c index 5f3d39b8212a..8888adcb3927 100644 --- a/drivers/powercap/intel_rapl_common.c +++ b/drivers/powercap/intel_rapl_common.c @@ -547,7 +547,7 @@ static void rapl_init_domains(struct rapl_package *rp) if (i == RAPL_DOMAIN_PLATFORM && rp->id > 0) { snprintf(rd->name, RAPL_DOMAIN_NAME_LENGTH, "psys-%d", - cpu_data(rp->lead_cpu).phys_proc_id); + topology_physical_package_id(rp->lead_cpu)); } else snprintf(rd->name, RAPL_DOMAIN_NAME_LENGTH, "%s", rapl_domain_names[i]); -- 2.27.0