Re: [PATCH v1 01/25] lib/vsprintf: Remove useless NULL checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2017-06-08 at 22:59 +0200, Rasmus Villemoes wrote:
> On Thu, Jun 08 2017, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxxxx>
Intel Finland Oy



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux