* [PATCH] staging: gpib: enclose macro values in parentheses
@ 2025-09-19 7:03 Soumya Ranjan Patnaik
2025-09-19 8:01 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Soumya Ranjan Patnaik @ 2025-09-19 7:03 UTC (permalink / raw)
To: dpenkler; +Cc: gregkh, linux-staging, linux-kernel, Soumya Ranjan Patnaik
Macros with complex values should be enclosed in parentheses to avoid
unexpected behavior due to operator precedence or macro expansion issues.
This change wraps the LINVAL macro values in parentheses to comply with
kernel coding style and improve code safety.
Signed-off-by: Soumya Ranjan Patnaik <soumyaranjan1812@gmail.com>
---
drivers/staging/gpib/gpio/gpib_bitbang.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c
index 17884810f..ad82be69d 100644
--- a/drivers/staging/gpib/gpio/gpib_bitbang.c
+++ b/drivers/staging/gpib/gpio/gpib_bitbang.c
@@ -47,10 +47,10 @@
dev_dbg(board->gpib_dev, frm, ## __VA_ARGS__); } \
while (0)
-#define LINVAL gpiod_get_value(DAV), \
+#define LINVAL (gpiod_get_value(DAV), \
gpiod_get_value(NRFD), \
gpiod_get_value(NDAC), \
- gpiod_get_value(SRQ)
+ gpiod_get_value(SRQ))
#define LINFMT "DAV: %d NRFD:%d NDAC: %d SRQ: %d"
#include "gpibP.h"
--
2.47.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: gpib: enclose macro values in parentheses
2025-09-19 7:03 [PATCH] staging: gpib: enclose macro values in parentheses Soumya Ranjan Patnaik
@ 2025-09-19 8:01 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2025-09-19 8:01 UTC (permalink / raw)
To: Soumya Ranjan Patnaik; +Cc: dpenkler, gregkh, linux-staging, linux-kernel
On Fri, Sep 19, 2025 at 12:33:48PM +0530, Soumya Ranjan Patnaik wrote:
> Macros with complex values should be enclosed in parentheses to avoid
> unexpected behavior due to operator precedence or macro expansion issues.
> This change wraps the LINVAL macro values in parentheses to comply with
> kernel coding style and improve code safety.
>
> Signed-off-by: Soumya Ranjan Patnaik <soumyaranjan1812@gmail.com>
That's going to break the build.
https://lore.kernel.org/all/?q=LINVAL
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-19 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19 7:03 [PATCH] staging: gpib: enclose macro values in parentheses Soumya Ranjan Patnaik
2025-09-19 8:01 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox