lkml.org 
[lkml]   [2017]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1 01/25] lib/vsprintf: Remove useless NULL checks
From
Date
On Thu, 2017-06-08 at 22:59 +0200, Rasmus Villemoes wrote:
> On Thu, Jun 08 2017, Andy Shevchenko <andriy.shevchenko@linux.intel.co
> m> wrote:
> > The pointer can't be NULL since it's first what has been done in the
> > pointer().
 
> > - if (ZERO_OR_NULL_PTR(addr))
> > - return string(buf, end, NULL, spec); /* NULL
> > pointer */
> > -
> > -
>
> Well, ZERO_OR_NULL_PTR checks for a little more than !addr, but I
> suppose that if anyone passes the result from kmalloc(0) to %ph,
> they'd
> better also pass 0 as the size, so the .field_width tests should be
> sufficient.

If we care about kmalloc(0) check we better to do this in pointer()?

> > - if (!IS_ENABLED(CONFIG_HAVE_CLK) || !clk)
> > - return string(buf, end, NULL, spec);
> > -
>
> Well, it may be safe, but removing the IS_ENABLED(CONFIG_HAVE_CLK)
> check
> means that clock() becomes a much bigger function when
> !IS_ENABLED(CONFIG_HAVE_CLK).

I return back this in v2.

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

\
 
 \ /
  Last update: 2017-07-20 23:21    [W:0.143 / U:4.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site