linux-4.11-rc6/arch/sparc/kernel/setup_32.c:151]: (style) Redundant condition
David Miller
maintainerFrom: David Binderman <[email protected]>
Date: Mon, 10 Apr 2017 08:20:09 +0000
Quoted 12 lines
Hello there,
linux-4.11-rc6/arch/sparc/kernel/setup_32.c:151]: (style) Redundant condition: If 'EXPR = ' '', the comparison 'EXPR' is always true.Source code is
while (*commands && *commands = ' ')
Quoted 8 lines
Suggest new code
while (*commands = ' ')Also, there seems to be a duplicate in a similar file:
linux-4.11-rc6/arch/sparc/kernel/setup_64.c:136]: (style) Redundant condition: If 'EXPR = ' '', the comparison 'EXPR' is always true.
Yep, both are correct transformations, thanks.
==========
sparc: Remove redundant tests in boot_flags_init().
The test:
*commands && *commands = ' '
is equivalent to:
*commands = ' '
Reported-by David Binderman <[email protected]>
Signed-off-by David S. Miller <[email protected]>
--- arch/sparc/kernel/setup_32.c | 2 +- arch/sparc/kernel/setup_64.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/sparc/kernel/setup_32.c +1 -1
@@ -148,7 +148,7 @@ static void __init boot_flags_init(char *commands) {while (*commands) {/* Move to the start of the next "argument". */ -while (*commands && *commands =' ' ) +while (*commands =' ' ) commands++;/* Process any command switches, otherwise skip it. */
arch/sparc/kernel/setup_64.c +1 -1
@@ -133,7 +133,7 @@ static void __init boot_flags_init(char *commands) {while (*commands) {/* Move to the start of the next "argument". */ -while (*commands && *commands =' ' ) +while (*commands =' ' ) commands++;/* Process any command switches, otherwise skip it. */
Signature · 1 line
2.1.2.532.g19b5d50