Skip to contentSkip to conversation

coda: avoid Wunused-but-set-variable warning

PATCH New Arnd Bergmann 1 participant 1 message Mar 22, 2024 Coda file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coda: avoid Wunused-but-set-variable warning

From: Arnd Bergmann <[email protected]>

The UPARG() macro implicitly sets the outp variable, but a lot of the callers never actually use the results instead, causing a W=1 warning:

fs/coda/upcall.c:115:27: error: variable 'outp' set but not used [-Werror,-Wunused-but-set-variable]
115 | union outputArgs *outp;
| ^

Add a cast to void to shut up that warning for callers that don't care bout the output.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
 fs/coda/upcall.c | 1 +
 1 file changed, 1 insertion(+)
fs/coda/upcall.c +1 -0
index cd6a3721f6f6..b7451fdef14d 100644
@@ -63,6 +63,7 @@ do {\
 	inp = (union inputArgs *)alloc_upcall(op, insize); \
         if (IS_ERR(inp)) { return PTR_ERR(inp); }\
         outp = (union outputArgs *)(inp); \
+	(void)outp; \
         outsize = insize; \
 } while (0)
 
Signature · 1 line
2.39.2