[PATCH] mtd: nand: make more readable panic_nand_wait_ready() and nand_wait_ready()

Brian Norris computersforpeace at gmail.com
Mon Jan 20 14:19:08 EST 2014


On Tue, Jan 07, 2014 at 11:19:56PM +0000, Eunbong Song wrote:
> 
> panic_nand_wait_ready() and nand_wait_ready() calls dev_ready() without checking if it exists.

There are many occasions where we call a function pointer without
(locally) checking that it is non-NULL. That is by design.

If you see a problem with this behavior, please fix this properly rather
than covering it up. This patch will just make faulty drivers spin for
20ms rather than hitting a bug. Instead, you should aim to fix buggy
drivers that call dev_ready() without assigning it; or even better,
defensively improve nand_base to detect those drivers which are
utilizing nand_command_lp() or nand_command() without assigning
dev_ready().

> This patch add check routine dev_ready() before run dev_ready()
> and this makes the code more readable

This patch does not make the code more readable, nor does it improve the
state of the original code much. Please solve and document a real
problem.

Thanks,
Brian



More information about the linux-mtd mailing list