[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1986de34-bd7f-3a74-5cf9-d1efceb0ff54@kleine-koenig.org>
Date: Mon, 17 May 2021 09:38:03 +0200
From: Uwe Kleine-König <uwe@...ine-koenig.org>
To: Arnd Bergmann <arnd@...nel.org>, Petr Mladek <pmladek@...e.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [v2] printf: fix errname.c list
Hi Arnd,
On 5/14/21 11:34 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> On most architectures, gcc -Wextra warns about the list of error
> numbers containing both EDEADLK and EDEADLOCK:
>
> lib/errname.c:15:67: warning: initialized field overwritten [-Woverride-init]
> 15 | #define E(err) [err + BUILD_BUG_ON_ZERO(err <= 0 || err > 300)] = "-" #err
> |
^~~
> lib/errname.c:172:2: note: in expansion of macro 'E'
> 172 | E(EDEADLK), /* EDEADLOCK */
> | ^
>
> On parisc, a similar error happens with -ECANCELLED, which is an
> alias for ECANCELED.
>
> Make the EDEADLK printing conditional on the number being distinct
> from EDEADLOCK, and remove the -ECANCELLED bit completely as it
> can never be hit.
>
> To ensure these are correct, add static_assert lines that verify
> all the remaining aliases are in fact identical to the canonical
> name.
>
> Fixes: 57f5677e535b ("printf: add support for printing symbolic error names")
> Cc: Petr Mladek <pmladek@...e.com>
> Suggested-by: Rasmus Villemoes <linux@...musvillemoes.dk>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
LGTM
Acked-by: Uwe Kleine-König <uwe@...ine-koenig.org>
Thanks
Uwe
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists