hwmon: peci: change label strings to reflect natural numbers
PATCH 1/1 hwmon: peci: change label strings to reflect natural numbers
This commit changes label strings to reflect user friendly natural numbers like 'Core 1' instead of 'Core 0' and 'DIMM A1' instead of 'DIMM A0'.
--- drivers/hwmon/peci-cputemp.c | 2 +- drivers/hwmon/peci-dimmtemp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/hwmon/peci-cputemp.c mode change 100644 => 100755 drivers/hwmon/peci-dimmtemp.c
drivers/hwmon/peci-cputemp.c +1 -1
@@ -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); +sprintf (priv->coretemp_label[idx],"Core %d" , idx +1 );return 0 ; }
drivers/hwmon/peci-dimmtemp.c +1 -1
@@ -260,7 +260,7 @@ static int create_dimm_temp_label(struct peci_dimmtemp *priv, int chan) rank = chan / priv->gen_info->dimm_idx_max; idx = chan % priv->gen_info->dimm_idx_max; -sprintf (priv->dimmtemp_label[chan],"DIMM %c%d" ,'A' + rank, idx); +sprintf (priv->dimmtemp_label[chan],"DIMM %c%d" ,'A' + rank, idx +1 );return 0 ; }
Signature · 1 line
2.17.1
Joel Stanley
AppliedQuoted 6 lines · Jae Hyun Yoo
This commit changes label strings to reflect user friendly natural numbers like 'Core 1' instead of 'Core 0' and 'DIMM A1' instead of 'DIMM A0'.
Signed-off-by Jae Hyun Yoo <[email protected]>
Applied to dev-5.4
Quoted 40 lines
--- drivers/hwmon/peci-cputemp.c | 2 +- drivers/hwmon/peci-dimmtemp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/hwmon/peci-cputemp.c mode change 100644 => 100755 drivers/hwmon/peci-dimmtemp.cdrivers/hwmon/peci-cputemp.c +1
-1@@ -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); +sprintf (priv->coretemp_label[idx],"Core %d" , idx +1 );return 0 ; }drivers/hwmon/peci-dimmtemp.c +1
-2@@ -260,7 +260,7 @@ static int create_dimm_temp_label(struct peci_dimmtemp *priv, int chan) rank = chan / priv->gen_info->dimm_idx_max; idx = chan % priv->gen_info->dimm_idx_max; -sprintf (priv->dimmtemp_label[chan],"DIMM %c%d" ,'A' + rank, idx); +sprintf (priv->dimmtemp_label[chan],"DIMM %c%d" ,'A' + rank, idx +1 );return 0 ; } --2.17.1
Quoted 5 lines · Jae Hyun Yoo
This commit changes label strings to reflect user friendly natural numbers like 'Core 1' instead of 'Core 0' and 'DIMM A1' instead of 'DIMM A0'.
Quoted 7 lines
Signed-off-by Jae Hyun Yoo <[email protected]>--- drivers/hwmon/peci-cputemp.c | 2 +- drivers/hwmon/peci-dimmtemp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/hwmon/peci-cputemp.c mode change 100644 => 100755 drivers/hwmon/peci-dimmtemp.c
I don't think this was intended.
I fixed it up for you, but please try to figure out what went wrong so it doesn't happen in the future.
Quoted 34 lines
drivers/hwmon/peci-cputemp.c +1
-1@@ -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); +sprintf (priv->coretemp_label[idx],"Core %d" , idx +1 );return 0 ; }drivers/hwmon/peci-dimmtemp.c +1
-2@@ -260,7 +260,7 @@ static int create_dimm_temp_label(struct peci_dimmtemp *priv, int chan) rank = chan / priv->gen_info->dimm_idx_max; idx = chan % priv->gen_info->dimm_idx_max; -sprintf (priv->dimmtemp_label[chan],"DIMM %c%d" ,'A' + rank, idx); +sprintf (priv->dimmtemp_label[chan],"DIMM %c%d" ,'A' + rank, idx +1 );return 0 ; } --2.17.1
Hi Joel,
Quoted 14 lines · Joel Stanley
Quoted 5 lines · Jae Hyun Yoo
This commit changes label strings to reflect user friendly natural numbers like 'Core 1' instead of 'Core 0' and 'DIMM A1' instead of 'DIMM A0'.
Quoted 7 lines
Signed-off-by Jae Hyun Yoo <[email protected]>--- drivers/hwmon/peci-cputemp.c | 2 +- drivers/hwmon/peci-dimmtemp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)mode change 100644 => 100755
drivers/hwmon/peci-cputemp.cmode change 100644 => 100755drivers/hwmon/peci-dimmtemp.c
Quoted 4 lines
I don't think this was intended.
I fixed it up for you, but please try to figure out what went wrong so it doesn't happen in the future.
It happened while upstreaming it. I changed the static label string table as a dynamic table to address review comments, and I missed this mismatch. My bad. It'll be fixed in the next upstreaming spin.
Thanks,
Jae
Quoted 34 lines
Quoted 34 lines
drivers/hwmon/peci-cputemp.c +1
-1@@ -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); +sprintf (priv->coretemp_label[idx],"Core %d" , idx +1 );return 0 ; }drivers/hwmon/peci-dimmtemp.c +1
-2@@ -260,7 +260,7 @@ static int create_dimm_temp_label(struct peci_dimmtemp *priv, int chan) rank = chan / priv->gen_info->dimm_idx_max; idx = chan % priv->gen_info->dimm_idx_max; -sprintf (priv->dimmtemp_label[chan],"DIMM %c%d" ,'A' + rank, idx); +sprintf (priv->dimmtemp_label[chan],"DIMM %c%d" ,'A' + rank, idx +1 );return 0 ; } --2.17.1
Quoted 18 lines · Jae Hyun Yoo
Hi Joel,
Quoted 14 lines · Joel Stanley
Quoted 12 lines · Jae Hyun Yoo
This commit changes label strings to reflect user friendly natural numbers like 'Core 1' instead of 'Core 0' and 'DIMM A1' instead of 'DIMM A0'.
Signed-off-by Jae Hyun Yoo <[email protected]>--- drivers/hwmon/peci-cputemp.c | 2 +- drivers/hwmon/peci-dimmtemp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)mode change 100644 => 100755
drivers/hwmon/peci-cputemp.cmode change 100644 => 100755drivers/hwmon/peci-dimmtemp.c
Quoted 8 lines
Quoted 4 lines
I don't think this was intended.
I fixed it up for you, but please try to figure out what went wrong so it doesn't happen in the future.
It happened while upstreaming it. I changed the static label string table as a dynamic table to address review comments, and I missed this mismatch. My bad. It'll be fixed in the next upstreaming spin.
I was just referring to the files becoming executable :)
I am surprised by the code that makes string allocation dynamic. As you know the number of strings (one per sensor), and you're allocating a fixed size for each string, I would suggest you're better off allocating all of the strings at once.
Regardless, I suggest you change the calls to snprintf, as if a machine has more than 999 DIMMs it will overflow the string :)
Cheers,
Joel
Quoted 21 lines · Joel Stanley
Quoted 20 lines · Jae Hyun Yoo
Hi Joel,
Quoted 16 lines · Joel Stanley
Quoted 5 lines · Jae Hyun Yoo
This commit changes label strings to reflect user friendly natural numbers like 'Core 1' instead of 'Core 0' and 'DIMM A1' instead of 'DIMM A0'.
Quoted 7 lines
Signed-off-by Jae Hyun Yoo <[email protected]>--- drivers/hwmon/peci-cputemp.c | 2 +- drivers/hwmon/peci-dimmtemp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)mode change 100644 => 100755
drivers/hwmon/peci-cputemp.cmode change 100644 => 100755drivers/hwmon/peci-dimmtemp.cI don't think this was intended.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
I fixed it up for you, but please try to figure out what went wrong so it doesn't happen in the future.
It happened while upstreaming it. I changed the static label string table as a dynamic table to address review comments, and I missed this mismatch. My bad. It'll be fixed in the next upstreaming spin.
I was just referring to the files becoming executable :)
Yeah, I was aware that just after sending my previous email.
Quoted 7 lines
I am surprised by the code that makes string allocation dynamic. As you know the number of strings (one per sensor), and you're allocating a fixed size for each string, I would suggest you're better off allocating all of the strings at once.
Regardless, I suggest you change the calls to snprintf, as if a machine has more than 999 DIMMs it will overflow the string :)
The machine wouldn't come in the near future but I agree with you. Let me replace the sprintf with snprintf. Will submit a new patch.
Thanks! :)
Jae
Quoted 4 lines
Cheers,
Joel
Quoted 17 lines · Jae Hyun Yoo
Hi Joel,
Quoted 14 lines · Joel Stanley
Quoted 12 lines · Jae Hyun Yoo
This commit changes label strings to reflect user friendly natural numbers like 'Core 1' instead of 'Core 0' and 'DIMM A1' instead of 'DIMM A0'.
Signed-off-by Jae Hyun Yoo <[email protected]>---
drivers/hwmon/peci-cputemp.c | 2 +-
drivers/hwmon/peci-dimmtemp.c| 2 +-2 files changed, 2 insertions(+), 2 deletions(-)mode change 100644 => 100755
drivers/hwmon/peci-cputemp.cmode change 100644 => 100755drivers/hwmon/peci-dimmtemp.c
Quoted 8 lines
Quoted 4 lines
I don't think this was intended.
I fixed it up for you, but please try to figure out what went wrong so it doesn't happen in the future.
It happened while upstreaming it. I changed the static label string table as a dynamic table to address review comments, and I missed this mismatch. My bad. It'll be fixed in the next upstreaming spin.
Oh, you pointed out the file mode '755'. Sorry, I changed my samba configuration so it'll not be happened again.
Thanks :)
Jae
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
drivers/hwmon/peci-cputemp.c +1
-1@@ -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); + sprintf(priv->coretemp_label[idx], "Core %d", idx + 1); return 0;}
drivers/hwmon/peci-dimmtemp.c +1
-1@@ -260,7 +260,7 @@ static int create_dimm_temp_label(struct peci_dimmtemp *priv, int chan) rank = chan / priv->gen_info->dimm_idx_max; idx = chan % priv->gen_info->dimm_idx_max; - sprintf(priv->dimmtemp_label[chan], "DIMM %c%d", 'A' + rank, idx); + sprintf(priv->dimmtemp_label[chan], "DIMM %c%d", 'A' + rank, idx +1 );return 0;
}Signature · 1 line
2.17.1