diff mbox series

[1/6] memory: ti-aemif: Correct macro to ensure avoiding precedence issues

Message ID 20241021151330.1860929-2-bastien.curutchet@bootlin.com
State Accepted
Delegated to: Tom Rini
Headers show
Series memory: ti-aemif: Add DM support | expand

Commit Message

Bastien Curutchet Oct. 21, 2024, 3:13 p.m. UTC
Fix following CHECK pointed out by checkpatch:

   CHECK: Macro argument 'cs' may be better as '(cs)' to avoid precedence issues
   #62: FILE: drivers/memory/ti-aemif.c:15:
   +#define AEMIF_CONFIG(cs)               (0x10 + (cs * 4))

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
---
 drivers/memory/ti-aemif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Oct. 22, 2024, 2:01 p.m. UTC | #1
On Mon, Oct 21, 2024 at 05:13:25PM +0200, Bastien Curutchet wrote:

> Fix following CHECK pointed out by checkpatch:
> 
>    CHECK: Macro argument 'cs' may be better as '(cs)' to avoid precedence issues
>    #62: FILE: drivers/memory/ti-aemif.c:15:
>    +#define AEMIF_CONFIG(cs)               (0x10 + (cs * 4))
> 
> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox series

Patch

diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c
index 29131f536a..127a262894 100644
--- a/drivers/memory/ti-aemif.c
+++ b/drivers/memory/ti-aemif.c
@@ -12,7 +12,7 @@ 
 #define AEMIF_WAITCYCLE_CONFIG		(KS2_AEMIF_CNTRL_BASE + 0x4)
 #define AEMIF_NAND_CONTROL		(KS2_AEMIF_CNTRL_BASE + 0x60)
 #define AEMIF_ONENAND_CONTROL		(KS2_AEMIF_CNTRL_BASE + 0x5c)
-#define AEMIF_CONFIG(cs)		(KS2_AEMIF_CNTRL_BASE + 0x10 + (cs * 4))
+#define AEMIF_CONFIG(cs)		(KS2_AEMIF_CNTRL_BASE + 0x10 + ((cs) * 4))
 
 #define AEMIF_CFG_SELECT_STROBE(v)	((v) ? 1 << 31 : 0)
 #define AEMIF_CFG_EXTEND_WAIT(v)	((v) ? 1 << 30 : 0)