[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOi1vP8e-RQ2DHFSDMBgod7Ug4yMMoJBwxGDYNXWA6UL68pixg@mail.gmail.com>
Date: Wed, 19 Feb 2020 12:29:59 +0100
From: Ilya Dryomov <idryomov@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Jonathan Corbet <corbet@....net>,
Kees Cook <keescook@...omium.org>,
"Tobin C . Harding" <me@...in.cc>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Documentation List <linux-doc@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vsprintf: sanely handle NULL passed to %pe
On Wed, Feb 19, 2020 at 12:25 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Wed, Feb 19, 2020 at 1:21 PM Ilya Dryomov <idryomov@...il.com> wrote:
> > On Wed, Feb 19, 2020 at 9:21 AM Rasmus Villemoes
> > <linux@...musvillemoes.dk> wrote:
> > >
> > > Extend %pe to pretty-print NULL in addition to ERR_PTRs,
> > > i.e. everything IS_ERR_OR_NULL().
>
> ...
>
> > > + [0] = "NULL",
>
> > > + test("[NULL]", "[%pe]", NULL);
>
> > FWIW I was about to post a patch that just special cases NULL here.
> >
> > I think changing errname() to return "NULL" for 0 is overkill.
> > People will sooner or later discover that function and start using it
> > in contexts that don't have anything to do with pointers. Returning
> > _some_ string for 0 (instead of NULL) makes it very close to standard
> > strerror(), and "NULL" for 0 (i.e. success) seems rather odd.
>
> %pe is specifically for _pointers_. I don't see a point in your comment.
%pe is for pointers, but errname() in lib/errname.c will likely grow
more users in the future.
Thanks,
Ilya
Powered by blists - more mailing lists