termbits: Convert octal defines to hex
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 4 May 2022 07:20:46 +0000 (10:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 May 2022 20:43:58 +0000 (22:43 +0200)
commit6808b7f5c8255d07d79cb8eac40047f59e4154ad
tree8ea4ba0bc4f2fc1a23090f19589bb0069c357e80
parent240754894c30e3b13ca91113f177dd7f315eb297
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 <ilpo.jarvinen@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Link: https://lore.kernel.org/r/2c8c96f-a12f-aadc-18ac-34c1d371929c@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/alpha/include/uapi/asm/termbits.h
arch/mips/include/uapi/asm/termbits.h
arch/parisc/include/uapi/asm/termbits.h
arch/powerpc/include/uapi/asm/termbits.h
include/uapi/asm-generic/termbits.h