[PATCH] CLKDEV: Add helper routines to allocate and add clkdevs for given struct clk *

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Apr 16 07:02:54 EDT 2012


On Mon, Apr 16, 2012 at 12:56:48PM +0200, Domenico Andreoli wrote:
> > I don't think these checks actually help anyone, especially if the user
> > forgets to check the return value (which makes them silent errors.)
> > 
> > If you're going to abuse the interface by passing a NULL clk_lookup or
> > num=0 then you deserve to get a big fat oops to tell you that you messed
> > up.  Same for NULL dev_id and con_id above.
> 
> I hope for a BUG_ON then.

Would you also like all the standard functions such as strcpy() to also
check for NULL pointers just in case you want it to copy your string to
the NULL pointer as well?

This is utterly rediculous.  If your programming ability is soo poor that
you need this kind of help (because you think you might abuse interfaces
by doing really stupid stuff like passing NULL clk_lookup pointers to
functions which can only ever take a valid pointer) then you shouldn't be
touching the kernel.



More information about the linux-arm-kernel mailing list