|
|
0f9095 |
commit c474cd3ddfcb2fe68f38745675f4c4d9ef79dfc5
|
|
|
0f9095 |
Author: Carl Love <cel@us.ibm.com>
|
|
|
0f9095 |
Date: Tue Mar 27 13:07:37 2018 -0700
|
|
|
0f9095 |
|
|
|
0f9095 |
PowerPC: Remove trailing comma in cpu_name.
|
|
|
0f9095 |
|
|
|
0f9095 |
Will:
|
|
|
0f9095 |
|
|
|
0f9095 |
I redid the patch as follows per your suggestions. I was able to get
|
|
|
0f9095 |
on to a system where the issue occurs and test the patch. The patch
|
|
|
0f9095 |
seems to work fine.
|
|
|
0f9095 |
|
|
|
0f9095 |
Carl Love
|
|
|
0f9095 |
|
|
|
0f9095 |
-----------------------------------------------------------------------
|
|
|
0f9095 |
|
|
|
0f9095 |
The processor type for some Power 9 systems had a comma after POWER9.
|
|
|
0f9095 |
Remove the comma before returning the string for the CPU.
|
|
|
0f9095 |
|
|
|
0f9095 |
diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c
|
|
|
0f9095 |
index feea9487..d2babd18 100644
|
|
|
0f9095 |
--- a/libop/op_cpu_type.c
|
|
|
0f9095 |
+++ b/libop/op_cpu_type.c
|
|
|
0f9095 |
@@ -154,17 +154,17 @@ static char * _get_cpuinfo_cpu_type_line(char * buf, int len, const char * prefi
|
|
|
0f9095 |
/* if token param 0 then read the whole line else
|
|
|
0f9095 |
* first token only. */
|
|
|
0f9095 |
if (token == 0) {
|
|
|
0f9095 |
- /* Trim trailing whitespace */
|
|
|
0f9095 |
+ /* Trim trailing whitespace and commas */
|
|
|
0f9095 |
end = buf + strlen(buf) - 1;
|
|
|
0f9095 |
- while (isspace(*end))
|
|
|
0f9095 |
+ while (isspace(*end) || *end == ',')
|
|
|
0f9095 |
--end;
|
|
|
0f9095 |
*(++end) = '\0';
|
|
|
0f9095 |
break;
|
|
|
0f9095 |
} else {
|
|
|
0f9095 |
/* Scan ahead to the end of the token */
|
|
|
0f9095 |
- while (*buf && !isspace(*buf))
|
|
|
0f9095 |
+ while (*buf && !(isspace(*buf) || *buf == ','))
|
|
|
0f9095 |
++buf;
|
|
|
0f9095 |
- /* Trim trailing whitespace */
|
|
|
0f9095 |
+ /* Trim trailing whitespace and commas */
|
|
|
0f9095 |
*buf = '\0';
|
|
|
0f9095 |
break;
|
|
|
0f9095 |
}
|