[U-Boot] [U-Boot,RFC] common: cli_hush: avoid dead code

Tom Rini trini at konsulko.com
Sun Dec 6 23:06:00 CET 2015


On Tue, Nov 24, 2015 at 04:54:21PM +0800, Peng Fan wrote:

> Condition "(value == NULL && ++value == NULL)" actully will
> always return false.
> 
> Instead, use condition "(value == NULL || *(value + 1) == 0)" to detect
> such expression "c=". To "c=", *(value + 1) is 0, so directly return -1,
> but not continue.
> 
> Signed-off-by: Peng Fan <Peng.Fan at freescale.com>
> Cc: Rabin Vincent <rabin at rab.in>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151206/b1d1b087/attachment.sig>


More information about the U-Boot mailing list