pinctrl: amd: Use unicode for debugfs output
Hello Mario Limonciello,
The patch e8129a076a50: "pinctrl: amd: Use unicode for debugfs output" from Jul 22, 2022, leads to the following Smatch static checker warning:
drivers/pinctrl/pinctrl-amd.c:249 amd_gpio_dbg_show() warn: format string contains non-ascii character '\x8c' drivers/pinctrl/pinctrl-amd.c:288 amd_gpio_dbg_show() warn: format string contains non-ascii character '\x8e' drivers/pinctrl/pinctrl-amd.c:294 amd_gpio_dbg_show() warn: format string contains non-ascii character '\x85' drivers/pinctrl/pinctrl-amd.c:300 amd_gpio_dbg_show() warn: format string contains non-ascii character '\x85' drivers/pinctrl/pinctrl-amd.c:306 amd_gpio_dbg_show() warn: format string contains non-ascii character '\x85' drivers/pinctrl/pinctrl-amd.c:320 amd_gpio_dbg_show() warn: format string contains non-ascii character '\x86' drivers/pinctrl/pinctrl-amd.c:326 amd_gpio_dbg_show() warn: format string contains non-ascii character '\x86' drivers/pinctrl/pinctrl-amd.c:326 amd_gpio_dbg_show() warn: format string contains non-ascii character '\xe2' drivers/pinctrl/pinctrl-amd.c:370 amd_gpio_dbg_show() warn: format string contains non-ascii character '\xe2'
I didn't add this Smatch check and I don't know the rules for this so when someone adds something that basically looks sane, I don't report it.
drivers/pinctrl/pinctrl-amd.c
247 seq_printf(s, "GPIO bank%d\n", bank);
248 for (; i < pin_num; i++) {
249 seq_printf(s, "π%d\t", i);
^In Gnome this looks like a thumbtack.
...
279
280 if (pin_reg & BIT(INTERRUPT_MASK_OFF))
281 interrupt_mask = "-";
282 else
283 interrupt_mask = "+";
284 seq_printf(s, "int %s (π %s)| active-%s| %s-π«| ",Gnome emojis seem difficult to read. Theatre masks and a water gun?
285 interrupt_enable,
286 interrupt_mask,
287 active_level,
--> 288 level_trig);
289
290 if (pin_reg & BIT(WAKE_CNTRL_OFF_S0I3))
291 wake_cntrl0 = "+";
292 else
293 wake_cntrl0 = "β
";
294 seq_printf(s, "S0i3 π
%s| ", wake_cntrl0);Sunrise emoji?
...
369 snprintf(debounce_value, sizeof(debounce_value), "%u", time * unit);
370 seq_printf(s, "debounce %s (β° %sus)| ", debounce_enable, debounce_value);Alarm clock.
371 seq_printf(s, " 0x%x\n", pin_reg);
372 }
373 }
374 }regards,
dan carpenter
Quoted 16 lines Β· Dan Carpenter
Hello Mario Limonciello,
The patch
e8129a076a50: "pinctrl: amd: Use unicode for debugfs output" from Jul 22, 2022, leads to the following Smatch static checker warning:
drivers/pinctrl/pinctrl-amd.c:249amd_gpio_dbg_show()warn: format string contains non-ascii character '\x8c'drivers/pinctrl/pinctrl-amd.c:288amd_gpio_dbg_show()warn: format string contains non-ascii character '\x8e'drivers/pinctrl/pinctrl-amd.c:294amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:300amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:306amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:320amd_gpio_dbg_show()warn: format string contains non-ascii character '\x86'drivers/pinctrl/pinctrl-amd.c:326amd_gpio_dbg_show()warn: format string contains non-ascii character '\x86'drivers/pinctrl/pinctrl-amd.c:326amd_gpio_dbg_show()warn: format string contains non-ascii character '\xe2'drivers/pinctrl/pinctrl-amd.c:370amd_gpio_dbg_show()warn: format string contains non-ascii character '\xe2'
Quoted 4 lines
I didn't add this Smatch check and I don't know the rules for this so when someone adds something that basically looks sane, I don't report it.
All of those are expected to me. If there are rules against this type of change then we should (unfortunately) revert that patch and the follow on patch that fixed an unused variable.
Quoted 7 lines
drivers/pinctrl/pinctrl-amd.c247 seq_printf(s, "GPIO bank%d\n", bank); 248 for (; i < pin_num; i++) { 249 seq_printf(s, "π%d\t", i); ^In Gnome this looks like a thumbtack.
Right, it's replacing "Pin".
Quoted 11 lines
...
279 280 if (pin_reg & BIT(INTERRUPT_MASK_OFF)) 281 interrupt_mask = "-"; 282 else 283 interrupt_mask = "+"; 284 seq_printf(s, "int %s (π %s)| active-%s| %s-π«| ",Gnome emojis seem difficult to read. Theatre masks and a water gun?
"Mask" and "Trigger"
Quoted 13 lines
285 interrupt_enable,
286 interrupt_mask,
287 active_level,
--> 288 level_trig);
289
290 if (pin_reg & BIT(WAKE_CNTRL_OFF_S0I3))
291 wake_cntrl0 = "+";
292 else
293 wake_cntrl0 = "β
";
294 seq_printf(s, "S0i3 π
%s| ", wake_cntrl0);Quoted 1 line
Sunrise emoji?
"S0i3 Wakeup"
Quoted 7 lines
...
369 snprintf(debounce_value, sizeof(debounce_value), "%u", time * unit); 370 seq_printf(s, "debounce %s (β° %sus)| ", debounce_enable, debounce_value);Alarm clock.
"Debounce time"
Quoted 8 lines
371 seq_printf(s, " 0x%x\n", pin_reg); 372 } 373 } 374 }regards,
dan carpenter
Yeah all of those emoji are the ones I intended. Details above. The point of this patch was to shrink the length of the line in debugfs output into something more manageable that it didn't need to be imported into a CSV processor to look at the data. It can be used with something like "less" now.
If you (or anyone else) has a better proposal for any of those symbols I'm happy to make a change. My goal remains to keep the lines ultra short though.
All I know is that I have become old.
regards,
dan carpenter
Quoted 27 lines Β· Mario Limonciello
Quoted 16 lines Β· Dan Carpenter
Hello Mario Limonciello,
The patch
e8129a076a50: "pinctrl: amd: Use unicode for debugfs output" from Jul 22, 2022, leads to the following Smatch static checker warning:
drivers/pinctrl/pinctrl-amd.c:249amd_gpio_dbg_show()warn: format string contains non-ascii character '\x8c'drivers/pinctrl/pinctrl-amd.c:288amd_gpio_dbg_show()warn: format string contains non-ascii character '\x8e'drivers/pinctrl/pinctrl-amd.c:294amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:300amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:306amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:320amd_gpio_dbg_show()warn: format string contains non-ascii character '\x86'drivers/pinctrl/pinctrl-amd.c:326amd_gpio_dbg_show()warn: format string contains non-ascii character '\x86'drivers/pinctrl/pinctrl-amd.c:326amd_gpio_dbg_show()warn: format string contains non-ascii character '\xe2'drivers/pinctrl/pinctrl-amd.c:370amd_gpio_dbg_show()warn: format string contains non-ascii character '\xe2'Quoted 4 lines
I didn't add this Smatch check and I don't know the rules for this so when someone adds something that basically looks sane, I don't report it.
All of those are expected to me. If there are rules against this type of change then we should (unfortunately) revert that patch and the follow on patch that fixed an unused variable.
Quoted 1 line
Quoted 8 lines
Quoted 6 lines
drivers/pinctrl/pinctrl-amd.c247 seq_printf(s, "GPIO bank%d\n", bank); 248 for (; i < pin_num; i++) { 249 seq_printf(s, "π%d\t", i); ^In Gnome this looks like a thumbtack.
Right, it's replacing "Pin".
Umm, #?
Quoted 11 lines
Quoted 11 lines
...
279 280 if (pin_reg & BIT(INTERRUPT_MASK_OFF)) 281 interrupt_mask = "-"; 282 else 283 interrupt_mask = "+"; 284 seq_printf(s, "int %s (π %s)| active-%s| %s-π«| ",
Quoted 4 lines
Quoted 1 line
Gnome emojis seem difficult to read. Theatre masks and a water gun?
"Mask" and "Trigger"
π and π₯?
If you would consider seperate symbols for masked and unmasked, rather than appending "-" or "+", then π· and π.
Quoted 13 lines
Quoted 13 lines
285 interrupt_enable, 286 interrupt_mask, 287 active_level, --> 288 level_trig); 289 290 if (pin_reg & BIT(WAKE_CNTRL_OFF_S0I3)) 291 wake_cntrl0 = "+"; 292 else 293 wake_cntrl0 = "β "; 294 seq_printf(s, "S0i3 π %s| ", wake_cntrl0);
Quoted 4 lines
Quoted 1 line
Sunrise emoji?
"S0i3 Wakeup"
Somehow β° makes more sense here to me.
And if you were to use separate symbols then π΄ for wake disabled?
Quoted 10 lines
Quoted 7 lines
...
369 snprintf(debounce_value, sizeof(debounce_value), "%u", time * unit); 370 seq_printf(s, "debounce %s (β° %sus)| ", debounce_enable, debounce_value);Alarm clock.
"Debounce time"
π or β² or nothing?
Sorry - couldn't resist chipping in - poor old dan.
Cheers,
Kent.
Quoted 18 lines
Quoted 8 lines
371 seq_printf(s, " 0x%x\n", pin_reg); 372 } 373 } 374 }regards,
dan carpenterYeah all of those emoji are the ones I intended. Details above. The point of this patch was to shrink the length of the line in debugfs output into something more manageable that it didn't need to be imported into a CSV processor to look at the data. It can be used with something like "less" now.
If you (or anyone else) has a better proposal for any of those symbols I'm happy to make a change. My goal remains to keep the lines ultra short though.
Quoted 35 lines Β· Kent Gibson
Quoted 34 lines Β· Mario Limonciello
Quoted 16 lines Β· Dan Carpenter
Hello Mario Limonciello,
The patch
e8129a076a50: "pinctrl: amd: Use unicode for debugfs output" from Jul 22, 2022, leads to the following Smatch static checker warning:
drivers/pinctrl/pinctrl-amd.c:249amd_gpio_dbg_show()warn: format string contains non-ascii character '\x8c'drivers/pinctrl/pinctrl-amd.c:288amd_gpio_dbg_show()warn: format string contains non-ascii character '\x8e'drivers/pinctrl/pinctrl-amd.c:294amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:300amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:306amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:320amd_gpio_dbg_show()warn: format string contains non-ascii character '\x86'drivers/pinctrl/pinctrl-amd.c:326amd_gpio_dbg_show()warn: format string contains non-ascii character '\x86'drivers/pinctrl/pinctrl-amd.c:326amd_gpio_dbg_show()warn: format string contains non-ascii character '\xe2'drivers/pinctrl/pinctrl-amd.c:370amd_gpio_dbg_show()warn: format string contains non-ascii character '\xe2'Quoted 4 lines
I didn't add this Smatch check and I don't know the rules for this so when someone adds something that basically looks sane, I don't report it.
All of those are expected to me. If there are rules against this type of change then we should (unfortunately) revert that patch and the follow on patch that fixed an unused variable.
Quoted 7 lines
drivers/pinctrl/pinctrl-amd.c247 seq_printf(s, "GPIO bank%d\n", bank); 248 for (; i < pin_num; i++) { 249 seq_printf(s, "π%d\t", i); ^In Gnome this looks like a thumbtack.
Quoted 3 lines
Quoted 1 line
Right, it's replacing "Pin".
Umm, #?
I guess if paired with a heading that is a great suggestion, thanks.
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
...
279 280 if (pin_reg & BIT(INTERRUPT_MASK_OFF)) 281 interrupt_mask = "-"; 282 else 283 interrupt_mask = "+"; 284 seq_printf(s, "int %s (π %s)| active-%s| %s-π«| ",Gnome emojis seem difficult to read. Theatre masks and a water gun?
Quoted 8 lines
Quoted 2 lines
"Mask" and "Trigger"
π and π₯?
If you would consider seperate symbols for masked and unmasked, rather than appending "-" or "+", then π· and π.
Oh duh.
Separate symbols makes perfect sense for mask/unmasked. I'm not sure that π₯ is any better than π« though.
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
285 interrupt_enable, 286 interrupt_mask, 287 active_level, --> 288 level_trig); 289 290 if (pin_reg & BIT(WAKE_CNTRL_OFF_S0I3)) 291 wake_cntrl0 = "+"; 292 else 293 wake_cntrl0 = "β "; 294 seq_printf(s, "S0i3 π %s| ", wake_cntrl0);
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Sunrise emoji?
"S0i3 Wakeup"
Somehow β° makes more sense here to me.
In this context it feels like a timer though, not sure on this one.
Quoted 13 lines
And if you were to use separate symbols then π΄ for wake disabled?
Quoted 10 lines
Quoted 7 lines
...
369 snprintf(debounce_value, sizeof(debounce_value), "%u", time * unit); 370 seq_printf(s, "debounce %s (β° %sus)| ", debounce_enable, debounce_value);Alarm clock.
"Debounce time"
Quoted 7 lines
π or β² or nothing?
Sorry - couldn't resist chipping in - poor old dan.
Cheers,
Kent.
Thanks for your suggestions. I'll work out something later this week to change to some of them and leave you a Suggested-by tag in the commit.
Quoted 19 lines
Quoted 19 lines
Quoted 9 lines
371 seq_printf(s, " 0x%x\n", pin_reg); 372 } 373 } 374 }regards,
dan carpenterYeah all of those emoji are the ones I intended. Details above. The point of this patch was to shrink the length of the line in debugfs output into something more manageable that it didn't need to be imported into a CSV processor to look at the data. It can be used with something like "less" now.
If you (or anyone else) has a better proposal for any of those symbols I'm happy to make a change. My goal remains to keep the lines ultra short though.
Quoted 61 lines Β· Mario
Quoted 35 lines Β· Kent Gibson
Quoted 34 lines Β· Mario Limonciello
Quoted 16 lines Β· Dan Carpenter
Hello Mario Limonciello,
The patch
e8129a076a50: "pinctrl: amd: Use unicode for debugfs output" from Jul 22, 2022, leads to the following Smatch static checker warning:
drivers/pinctrl/pinctrl-amd.c:249amd_gpio_dbg_show()warn: format string contains non-ascii character '\x8c'drivers/pinctrl/pinctrl-amd.c:288amd_gpio_dbg_show()warn: format string contains non-ascii character '\x8e'drivers/pinctrl/pinctrl-amd.c:294amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:300amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:306amd_gpio_dbg_show()warn: format string contains non-ascii character '\x85'drivers/pinctrl/pinctrl-amd.c:320amd_gpio_dbg_show()warn: format string contains non-ascii character '\x86'drivers/pinctrl/pinctrl-amd.c:326amd_gpio_dbg_show()warn: format string contains non-ascii character '\x86'drivers/pinctrl/pinctrl-amd.c:326amd_gpio_dbg_show()warn: format string contains non-ascii character '\xe2'drivers/pinctrl/pinctrl-amd.c:370amd_gpio_dbg_show()warn: format string contains non-ascii character '\xe2'Quoted 4 lines
I didn't add this Smatch check and I don't know the rules for this so when someone adds something that basically looks sane, I don't report it.
All of those are expected to me. If there are rules against this type of change then we should (unfortunately) revert that patch and the follow on patch that fixed an unused variable.
Quoted 7 lines
drivers/pinctrl/pinctrl-amd.c247 seq_printf(s, "GPIO bank%d\n", bank); 248 for (; i < pin_num; i++) { 249 seq_printf(s, "π%d\t", i); ^In Gnome this looks like a thumbtack.
Quoted 3 lines
Quoted 1 line
Right, it's replacing "Pin".
Umm, #?
I guess if paired with a heading that is a great suggestion, thanks.
Quoted 19 lines
Quoted 12 lines
Quoted 12 lines
...
279 280 if (pin_reg & BIT(INTERRUPT_MASK_OFF)) 281 interrupt_mask = "-"; 282 else 283 interrupt_mask = "+"; 284 seq_printf(s, "int %s (π %s)| active-%s| %s-π«| ",Quoted 4 lines
Quoted 1 line
Gnome emojis seem difficult to read. Theatre masks and a water gun?
"Mask" and "Trigger"
π and π₯?
Quoted 8 lines
Quoted 3 lines
If you would consider seperate symbols for masked and unmasked, rather than appending "-" or "+", then π· and π.
Oh duh.
Separate symbols makes perfect sense for mask/unmasked. I'm not sure that π₯ is any better than π« though.
I was looking for something more visually distinctive - it is hard to tell what the pistol is. I was also thinking "spark" so β‘, but again the collision symbol looked more distinctive to me. YMMV.
You are after level triggered and edge triggered, right? So "-π₯" and "/π₯"?
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
285 interrupt_enable, 286 interrupt_mask, 287 active_level, --> 288 level_trig); 289 290 if (pin_reg & BIT(WAKE_CNTRL_OFF_S0I3)) 291 wake_cntrl0 = "+"; 292 else 293 wake_cntrl0 = "β "; 294 seq_printf(s, "S0i3 π %s| ", wake_cntrl0);
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Sunrise emoji?
"S0i3 Wakeup"
Somehow β° makes more sense here to me.
In this context it feels like a timer though, not sure on this one.
Well it is an alarm, which is why it is inappropriate for the debounce, as that is more of a filter.
With an alarm clock you will wake, else you will continue to sleep.
Quoted 15 lines
Quoted 15 lines
And if you were to use separate symbols then π΄ for wake disabled?
Quoted 10 lines
Quoted 7 lines
...
369 snprintf(debounce_value, sizeof(debounce_value), "%u", time * unit); 370 seq_printf(s, "debounce %s (β° %sus)| ", debounce_enable, debounce_value);Alarm clock.
"Debounce time"
π or β² or nothing?
Quoted 9 lines
Quoted 5 lines
Sorry - couldn't resist chipping in - poor old dan.
Cheers,
Kent.Thanks for your suggestions. I'll work out something later this week to change to some of them and leave you a Suggested-by tag in the commit.
No problem - just my 2Β’, plus it was the highlight of the day π.
Cheers,
Kent.
Quoted 20 lines
Quoted 19 lines
Quoted 19 lines
Quoted 9 lines
371 seq_printf(s, " 0x%x\n", pin_reg); 372 } 373 } 374 }regards,
dan carpenterYeah all of those emoji are the ones I intended. Details above. The point of this patch was to shrink the length of the line in debugfs output into something more manageable that it didn't need to be imported into a CSV processor to look at the data. It can be used with something like "less" now.
If you (or anyone else) has a better proposal for any of those symbols I'm happy to make a change. My goal remains to keep the lines ultra short though.