diff options
| author | Ilpo Järvinen <[email protected]> | 2022-05-04 10:20:46 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2022-05-05 22:43:58 +0200 |
| commit | 6808b7f5c8255d07d79cb8eac40047f59e4154ad (patch) | |
| tree | 8ea4ba0bc4f2fc1a23090f19589bb0069c357e80 /tools/perf/scripts/python/bin | |
| parent | 240754894c30e3b13ca91113f177dd7f315eb297 (diff) | |
termbits: Convert octal defines to hex
Many archs have termbits.h as octal numbers. It makes hard for humans
to parse the magnitude of large numbers correctly and to compare with
hex ones of the same define.
Convert octal values to hex.
First step is an automated conversion with:
for i in $(git ls-files | grep 'termbits\.h'); do
awk --non-decimal-data '/^#define\s+[A-Z][A-Z0-9]*\s+0[0-9]/ {
l=int(((length($3) - 1) * 3 + 3) / 4);
repl = sprintf("0x%0" l "x", $3);
print gensub(/[^[:blank:]]+/, repl, 3);
next} {print}' $i > $i~;
mv $i~ $i;
done
On top of that, some manual processing on alignment and number of zeros.
In addition, small tweaks to formatting of a few comments on the same
lines.
Signed-off-by: Ilpo Järvinen <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Michael Ellerman <[email protected]> (powerpc)
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions