Skip to contentSkip to conversation

staging: nvec: silence macro argument warnings in NVEC_PHD()

PATCH In review Emre Cecanpunar 2 participants 2 messages Jul 4, 2025 – Jul 9, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: nvec: silence macro argument warnings in NVEC_PHD()

checkpatch.pl warns that the NVEC_PHD macro defines unused arguments. Use (void) casts to prevent unused argument warnings when the macro is disabled.

---
 drivers/staging/nvec/nvec_ps2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/staging/nvec/nvec_ps2.c +5 -1
index 575233fa1677..38e736b3761e 100644
@@ -28,7 +28,11 @@
 	print_hex_dump(KERN_DEBUG, str, DUMP_PREFIX_NONE, \
 			16, 1, buf, len, false)
 #else
-#define NVEC_PHD(str, buf, len) do { } while (0)
+#define NVEC_PHD(str, buf, len) do { \
+	(void)(str); \
+	(void)(buf); \
+	(void)(len); \
+} while (0)
 #endif
 
 enum ps2_subcmds {
Signature · 1 line
2.50.0
maintainer
#1 lore raw
Quoted 13 lines · Emre Cecanpunar

checkpatch.pl warns that the NVEC_PHD macro defines unused arguments. Use (void) casts to prevent unused argument warnings when the macro is disabled.

---
 drivers/staging/nvec/nvec_ps2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/staging/nvec/nvec_ps2.c +0 -0
index 575233fa1677..38e736b3761e 100644

drivers/staging/nvec/nvec_ps2.c line 35

Quoted 9 lines
drivers/staging/nvec/nvec_ps2.c +5 -1
@@ -28,7 +28,11 @@
 	print_hex_dump(KERN_DEBUG, str, DUMP_PREFIX_NONE, \
 			16, 1, buf, len, false)
 #else
-#define NVEC_PHD(str, buf, len) do { } while (0)
+#define NVEC_PHD(str, buf, len) do { \
+	(void)(str); \
+	(void)(buf); \
+	(void)(len); \
+} while (0)

This is really not needed at all, sorry. Especially for a define that will never even be used. Can you work to remove NVEC_PS2_DEBUG instead, as that's not a good idea.

thanks,

greg k-h