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

Jae Hyun Yoo jae.hyun.yoo at linux.intel.com
Tue Sep 29 05:08:24 AEST 2020



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'.

Thanks,
Jae

>   	return 0;
>   }
> 


More information about the openbmc mailing list