[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bkwdv9ua.fsf@mpe.ellerman.id.au>
Date: Wed, 04 May 2022 21:03:09 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Greg KH <gregkh@...uxfoundation.org>,
linux-serial <linux-serial@...r.kernel.org>
Cc: Jiri Slaby <jirislaby@...nel.org>, linux-api@...r.kernel.org,
Ivan Kokshaysky <ink@...assic.park.msu.ru>,
Matt Turner <mattst88@...il.com>, linux-alpha@...r.kernel.org,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
linux-mips@...r.kernel.org,
"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>,
Helge Deller <deller@....de>, linux-parisc@...r.kernel.org,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
linuxppc-dev@...ts.ozlabs.org, Arnd Bergmann <arnd@...db.de>,
linux-arch@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] termbits: Convert octal defines to hex
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com> writes:
> 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@...ux.intel.com>
> ---
>
> I prefer this to go in though Greg's tty tree.
>
> arch/alpha/include/uapi/asm/termbits.h | 202 ++++++++++-----------
> arch/mips/include/uapi/asm/termbits.h | 222 +++++++++++------------
> arch/parisc/include/uapi/asm/termbits.h | 220 +++++++++++-----------
> arch/powerpc/include/uapi/asm/termbits.h | 202 ++++++++++-----------
I ran some horrible awk/sed/python mess over the before and after and
they seem to be numerically identical, so LGTM.
Acked-by: Michael Ellerman <mpe@...erman.id.au> (powerpc)
cheers
Powered by blists - more mailing lists