linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: gdm724x: Fix Duplication of Side Effects
@ 2022-03-31 10:18 Alaa Mohamed
  2022-03-31 10:27 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alaa Mohamed @ 2022-03-31 10:18 UTC (permalink / raw)
  To: outreachy; +Cc: gregkh, linux-staging, linux-kernel, eng.alaamohamedsoliman.am

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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-31 11:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-31 10:18 [PATCH] staging: gdm724x: Fix Duplication of Side Effects Alaa Mohamed
2022-03-31 10:27 ` Dan Carpenter
2022-03-31 10:29 ` David Laight
2022-03-31 10:40   ` Dan Carpenter
2022-03-31 10:49     ` David Laight
2022-03-31 11:00       ` Dan Carpenter
2022-03-31 11:33 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).