[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210217142008.29699-1-chakravarthikulkarni2021@gmail.com>
Date: Wed, 17 Feb 2021 19:50:05 +0530
From: chakravarthikulkarni <chakravarthikulkarni2021@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: chakravarthikulkarni2021@...il.com, Ian Abbott <abbotti@....co.uk>,
H Hartley Sweeten <hsweeten@...ionengravers.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ethan Edwards <ethancarteredwards@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drivers: staging: comedi: Fixed side effects from macro definition.
Warning found by checkpatch.pl script.
Signed-off-by: chakravarthikulkarni <chakravarthikulkarni2021@...il.com>
---
drivers/staging/comedi/comedi.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index b5d00a006dbb..b2af6a88d389 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -1103,9 +1103,12 @@ enum ni_common_signal_names {
/* *** END GLOBALLY-NAMED NI TERMINALS/SIGNALS *** */
-#define NI_USUAL_PFI_SELECT(x) (((x) < 10) ? (0x1 + (x)) : (0xb + (x)))
-#define NI_USUAL_RTSI_SELECT(x) (((x) < 7) ? (0xb + (x)) : 0x1b)
-
+#define NI_USUAL_PFI_SELECT(x) \
+ ({ typeof(x) _x = x; \
+ (((_x) < 10) ? (0x1 + (_x)) : (0xb + (_x))); })
+#define NI_USUAL_RTSI_SELECT(x) \
+ ({ typeof(x) _x = x; \
+ (((_x) < 7) ? (0xb + (_x)) : 0x1b); })
/*
* mode bits for NI general-purpose counters, set with
* INSN_CONFIG_SET_COUNTER_MODE
--
2.17.1
Powered by blists - more mailing lists