tools/x86/kcpuid: Strip bitfield names leading/trailing whitespace

While parsing and saving bitfield names from the CSV file, an extra
leading space is copied verbatim.  That extra space is not a big issue
now, but further commits will add a new CSV file with much more padding
for the bitfield's name column.

Strip leading/trailing whitespaces while saving bitfield names.

Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240718134755.378115-6-darwi@linutronix.de
This commit is contained in:
Ahmed S. Darwish 2024-07-18 15:47:45 +02:00 committed by Thomas Gleixner
parent cf96ab1a96
commit 9ecbc60a5e

View File

@ -379,7 +379,7 @@ static int parse_line(char *line)
if (start)
bdesc->start = strtoul(start, NULL, 0);
strcpy(bdesc->simp, tokens[4]);
strcpy(bdesc->simp, strtok(tokens[4], " \t"));
strcpy(bdesc->detail, tokens[5]);
return 0;