diff options
author | Dwaipayan Ray <[email protected]> | 2020-12-15 20:45:15 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2020-12-15 22:46:17 -0800 |
commit | 70eb2275ff8e0b4cafe67176674d580c987c071d (patch) | |
tree | 2e5107d68fa302b6831300b85474c164aef25c06 /tools/perf/scripts/python/bin/export-to-postgresql-report | |
parent | 831242ab8dffab4cf2f89c597d5902ac86caeefe (diff) |
checkpatch: add warning for unnecessary use of %h[xudi] and %hh[xudi]
Modifiers %h and %hh should never be used.
Commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of
unnecessary %h[xudi] and %hh[xudi]") specifies that:
"Standard integer promotion is already done and %hx and %hhx is useless
so do not encourage the use of %hh[xudi] or %h[xudi]."
"The "h" and "hh" things should never be used. The only reason for them
being used if you have an "int", but you want to print it out as a
"char" (and honestly, that is a really bad reason, you'd be better off
just using a proper cast to make the code more obvious)."
Add a new check to emit a warning on finding an unneeded use of %h or
%hh modifier.
Also add a fix option to the check.
Link: https://lore.kernel.org/lkml/[email protected]/
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Dwaipayan Ray <[email protected]>
Suggested-by: Joe Perches <[email protected]>
Suggested-by: Lukas Bulwahn <[email protected]>
Acked-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/export-to-postgresql-report')
0 files changed, 0 insertions, 0 deletions