Re: ARM: OMAP2: Delete unnecessary checks before three function calls

SF Markus Elfring
2015-07-16T06:40:59Z

> I have to say, I am a bit leery about applying the omap_device.c and
> omap_hwmod.c changes, since the called functions -- omap_device_delete()
> and clk_disable() -- don't explicitly document that NULLs are allowed
> to be passed in.

How are the chances to improve documentation around such implementation details?

> So there's no explicit contract that callers can rely upon, to (at least
> in theory) prevent those internal NULL pointer checks from being removed.

Are there any additional variations to consider for source files from different
processor architectures?

> So I would suggest that those two functions' kerneldoc be patched first to
> explicitly state that passing in a NULL pointer is allowed.

Should my static source code analysis approach help you any more to clarify
further open issues?

> So I'll apply that change now for v4.3, touching up the commit message accordingly.

Thanks for your constructive feedback.

>> arch/arm/mach-omap2/omap_device.c | 3 +--
>> arch/arm/mach-omap2/omap_hwmod.c | 5 +----
>> arch/arm/mach-omap2/timer.c | 3 +--

Did Tony Lindgren pick a similar update suggestion up, too?
https://lkml.org/lkml/2015/7/15/112

Regards,
Markus