[PATCH] staging: gdm724x: Fix Duplication of Side Effects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix Duplication of Side Effects for GDM_TTY_READY(gdm) macro
reported by checkpatch
"CHECK: Macro argument reuse 'gdm' - possible side-effects?"

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@xxxxxxxxx>
---
 drivers/staging/gdm724x/gdm_tty.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
index 04df6f9f5403..6f0274470e69 100644
--- a/drivers/staging/gdm724x/gdm_tty.c
+++ b/drivers/staging/gdm724x/gdm_tty.c
@@ -27,7 +27,9 @@
 
 #define MUX_TX_MAX_SIZE 2048
 
-#define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count)
+#define GDM_TTY_READY(_gdm) \
+	({ typeof(_gdm) (gdm) = (_gdm); \
+	(gdm && gdm->tty_dev && gdm->port.count); })
 
 static struct tty_driver *gdm_driver[TTY_MAX_COUNT];
 static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR];
-- 
2.35.1





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux