diff mbox

[U-Boot,2/2] board: ti: dra7xx: complex definitions should be protected with parentheses

Message ID 20160927073142.26058-3-mugunthanvnm@ti.com
State Accepted
Commit 1053a769fb14ff6824977a42a74a11bc8522a418
Delegated to: Tom Rini
Headers show

Commit Message

Mugunthan V N Sept. 27, 2016, 7:31 a.m. UTC
As a standard practice complex definitions should be protected
with parentheses, as it might fail when used in a complex if
statements.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 board/ti/dra7xx/evm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Tom Rini Sept. 27, 2016, 5:30 p.m. UTC | #1
On Tue, Sep 27, 2016 at 01:01:42PM +0530, Mugunthan V N wrote:

> As a standard practice complex definitions should be protected
> with parentheses, as it might fail when used in a complex if
> statements.
> 
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini Oct. 8, 2016, 5:08 p.m. UTC | #2
On Tue, Sep 27, 2016 at 01:01:42PM +0530, Mugunthan V N wrote:

> As a standard practice complex definitions should be protected
> with parentheses, as it might fail when used in a complex if
> statements.
> 
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

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

Patch

diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index be9af76..af4bc4e 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -36,10 +36,10 @@ 
 
 #define board_is_dra74x_evm()		board_ti_is("5777xCPU")
 #define board_is_dra72x_evm()		board_ti_is("DRA72x-T")
-#define board_is_dra74x_revh_or_later() board_is_dra74x_evm() &&	\
-				(strncmp("H", board_ti_get_rev(), 1) <= 0)
-#define board_is_dra72x_revc_or_later() board_is_dra72x_evm() &&	\
-				(strncmp("C", board_ti_get_rev(), 1) <= 0)
+#define board_is_dra74x_revh_or_later() (board_is_dra74x_evm() &&	\
+				(strncmp("H", board_ti_get_rev(), 1) <= 0))
+#define board_is_dra72x_revc_or_later() (board_is_dra72x_evm() &&	\
+				(strncmp("C", board_ti_get_rev(), 1) <= 0))
 #define board_ti_get_emif_size()	board_ti_get_emif1_size() +	\
 					board_ti_get_emif2_size()