diff mbox

[U-Boot,01/17] socrates: Fix a misleading indentation warning

Message ID 1494296075-29477-1-git-send-email-trini@konsulko.com
State Accepted
Commit 1f7efe82bdd5677500cc864ee53530d73367afab
Delegated to: Tom Rini
Headers show

Commit Message

Tom Rini May 9, 2017, 2:14 a.m. UTC
With gcc-6 and later we see a warning about the fact that we have a
construct of "if (test);\n\tstatement".  Upon reviewing the code, the
intention here is as the compiler suggests, we only want to execute the
indented statement if the test was true.

Cc: Sergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 board/socrates/socrates.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini May 12, 2017, 5:21 p.m. UTC | #1
On Mon, May 08, 2017 at 10:14:19PM -0400, Tom Rini wrote:

> With gcc-6 and later we see a warning about the fact that we have a
> construct of "if (test);\n\tstatement".  Upon reviewing the code, the
> intention here is as the compiler suggests, we only want to execute the
> indented statement if the test was true.
> 
> Cc: Sergei Poselenov <sposelenov@emcraft.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/board/socrates/socrates.c b/board/socrates/socrates.c
index 8b34a80e8f72..fb691c22d961 100644
--- a/board/socrates/socrates.c
+++ b/board/socrates/socrates.c
@@ -378,7 +378,7 @@  static void board_backlight_brightness(int br)
 
 		/* LEDs on */
 		reg = in_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c));
-		if (!(reg & BACKLIGHT_ENABLE));
+		if (!(reg & BACKLIGHT_ENABLE))
 			out_be32((void *)(CONFIG_SYS_FPGA_BASE + 0x0c),
 				 reg | BACKLIGHT_ENABLE);
 	} else {