public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	linux-serial <linux-serial@vger.kernel.org>
Cc: Jiri Slaby <jirislaby@kernel.org>,
	linux-api@vger.kernel.org,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	Matt Turner <mattst88@gmail.com>,
	linux-alpha@vger.kernel.org,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	linux-mips@vger.kernel.org,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	Helge Deller <deller@gmx.de>,
	linux-parisc@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org, Arnd Bergmann <arnd@arndb.de>,
	linux-arch@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] termbits: Convert octal defines to hex
Date: Wed, 04 May 2022 21:03:09 +1000	[thread overview]
Message-ID: <87bkwdv9ua.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <2c8c96f-a12f-aadc-18ac-34c1d371929c@linux.intel.com>

Ilpo Järvinen <ilpo.jarvinen@linux.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@linux.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@ellerman.id.au> (powerpc)

cheers

      parent reply	other threads:[~2022-05-04 11:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04  7:20 [PATCH 1/1] termbits: Convert octal defines to hex Ilpo Järvinen
2022-05-04  7:42 ` Arnd Bergmann
2022-05-04  8:33   ` Ilpo Järvinen
2022-05-04 11:59     ` Arnd Bergmann
2022-05-05  8:56       ` Ilpo Järvinen
2022-05-05 10:46         ` Arnd Bergmann
2022-05-04 11:03 ` Michael Ellerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bkwdv9ua.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=deller@gmx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jirislaby@kernel.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mattst88@gmail.com \
    --cc=paulus@samba.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox