lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] printf: fix Woverride-init warning for EDEADLK errno
    On Tue, Oct 27, 2020 at 7:55 AM Uwe Kleine-König <uwe@kleine-koenig.org> wrote:
    > On 10/26/20 10:49 PM, Arnd Bergmann wrote:
    > > Make that line conditional on the two values being distinct.
    > >
    > > Fixes: 57f5677e535b ("printf: add support for printing symbolic error names")
    > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    > > ---
    > > lib/errname.c | 2 ++
    > > 1 file changed, 2 insertions(+)
    > >
    > > diff --git a/lib/errname.c b/lib/errname.c
    > > index 0c4d3e66170e..6adff0bf2445 100644
    > > --- a/lib/errname.c
    > > +++ b/lib/errname.c
    > > @@ -169,7 +169,9 @@ static const char *names_0[] = {
    > > E(ECANCELED), /* ECANCELLED */
    > > E(EAGAIN), /* EWOULDBLOCK */
    > > E(ECONNREFUSED), /* EREFUSED */
    > > +#if EDEADLK != EDEADLOCK
    > > E(EDEADLK), /* EDEADLOCK */
    > > +#endif
    >
    > The comments suggest that duplicates are expected. Would it make sense
    > to add similar conditions to the other three entries?

    The other ones are always aliases, so there is no point in having
    an #ifdef. The reason we need to handle EDEADLK separately
    is that it's an alias on most architectures but not on on others,
    specifically mips, powerpc and sparc.

    Arnd

    \
     
     \ /
      Last update: 2020-10-27 09:41    [W:5.329 / U:0.900 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site