[PATCH 2/2] peci-cputemp: label CPU cores from zero instead of one

Zev Weiss zev at bewilderbeest.net
Tue Sep 29 05:54:23 AEST 2020


On Mon, Sep 28, 2020 at 02:08:24PM CDT, Jae Hyun Yoo wrote:
>
>
>On 9/26/2020 2:27 PM, Zev Weiss wrote:
>>Zero-based numbering is more consistent with all other cpu/core
>>numbering I'm aware of (including the PECI spec).
>>
>>Signed-off-by: Zev Weiss <zev at bewilderbeest.net>
>>---
>>  drivers/hwmon/peci-cputemp.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/drivers/hwmon/peci-cputemp.c b/drivers/hwmon/peci-cputemp.c
>>index b9fe91281d58..78e442f433a7 100644
>>--- a/drivers/hwmon/peci-cputemp.c
>>+++ b/drivers/hwmon/peci-cputemp.c
>>@@ -363,7 +363,7 @@ static int create_core_temp_label(struct peci_cputemp *priv, int idx)
>>  	if (!priv->coretemp_label[idx])
>>  		return -ENOMEM;
>>-	sprintf(priv->coretemp_label[idx], "Core %d", idx + 1);
>>+	sprintf(priv->coretemp_label[idx], "Core %d", idx);
>
>Differently from low level indexing, it's labeling for users and it
>should be synced with other temp or ADC sensors such as
>
>PVCCIN CPU1
>PVDQ ABC CPU1
>CPU1 P12V PVCCIN
>CPU1 VR Mem ABCD
>CPU1 VR P1V8
>
>These are using indexes starting from '1'.
>

OK, if it's for consistency with other existing drivers I suppose that's 
reasonable, though for my own reference, could you point me to where 
those are implemented?  Some rough grepping around the source tree 
didn't appear to turn up anything relevant.


Thanks,
Zev



More information about the openbmc mailing list