Re: [PATCH v2 8/9] lib/vsprintf: Remove useless NULL checks

Andy Shevchenko
2018-02-28T10:44:32Z

On Wed, 2018-02-28 at 11:04 +0100, Petr Mladek wrote:
> On Tue 2018-02-27 19:35:50, Andy Shevchenko wrote:
> > On Tue, 2018-02-27 at 16:50 +0100, Petr Mladek wrote:
> > > On Fri 2018-02-16 23:07:10, Andy Shevchenko wrote:
> > > >
> > >

> > > This macro matches also values <= 16.
> >
> > Yes, I know.
> >
> > This had been discussed with Rasmus and we agreed that printing a
> > result
> > of kmalloc(0) is rather weird.
>
> I see
> https://lkml.kernel.org/r/1500546142.29303.133.camel@linux.intel.com
> There you suggested to move this check into pointer(). But I do not
> see any agreement on this.
>

Btw, I'm pretty sure that the checks like this or another one with
PAGE_SIZE is cargo cult programming rather than imaging possible so
weird use cases.

--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy