Re: [PATCH] mtd: nand: make more readable panic_nand_wait_ready()and nand_wait_ready()
From: Brian Norris
Date: Mon Jan 20 2014 - 14:19:17 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/