Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	codalist@coda.cs.cmu.edu, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Cc: Jan Harkes <jaharkes@cs.cmu.edu>,
	coda@cs.cmu.edu, Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>
Subject: [PATCH v1 1/1] coda: Remove set but unused variables
Date: Thu,  4 Jun 2026 12:33:19 +0200	[thread overview]
Message-ID: <20260604103319.342158-1-andriy.shevchenko@linux.intel.com> (raw)

The clang compiler is not happy with set and unused variables:

  fs/coda/upcall.c:115:27: error: variable 'outp' set but not used [-Werror,-Wunused-but-set-variable]
  ...
  fs/coda/upcall.c:577:20: error: variable 'outp' set but not used [-Werror,-Wunused-but-set-variable]

Clean up the unused variables and associated unused code pieces.
To make this happen, introduce a new UPARG_NO_OUTP() helper macro.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 fs/coda/upcall.c | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index 3438119b5dcf..3ed04d758322 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -66,6 +66,13 @@ do {\
         outsize = insize; \
 } while (0)
 
+#define UPARG_NO_OUTP(op)\
+do {\
+	inp = (union inputArgs *)alloc_upcall(op, insize); \
+	if (IS_ERR(inp)) { return PTR_ERR(inp); }\
+	outsize = insize; \
+} while (0)
+
 #define INSIZE(tag) sizeof(struct coda_ ## tag ## _in)
 #define OUTSIZE(tag) sizeof(struct coda_ ## tag ## _out)
 #define SIZE(tag)  max_t(unsigned int, INSIZE(tag), OUTSIZE(tag))
@@ -112,11 +119,10 @@ int venus_setattr(struct super_block *sb, struct CodaFid *fid,
 		  struct coda_vattr *vattr)
 {
         union inputArgs *inp;
-        union outputArgs *outp;
         int insize, outsize, error;
 	
 	insize = SIZE(setattr);
-	UPARG(CODA_SETATTR);
+	UPARG_NO_OUTP(CODA_SETATTR);
 
         inp->coda_setattr.VFid = *fid;
 	inp->coda_setattr.attr = *vattr;
@@ -161,11 +167,10 @@ int venus_close(struct super_block *sb, struct CodaFid *fid, int flags,
 		kuid_t uid)
 {
 	union inputArgs *inp;
-	union outputArgs *outp;
 	int insize, outsize, error;
 	
 	insize = SIZE(release);
-	UPARG(CODA_CLOSE);
+	UPARG_NO_OUTP(CODA_CLOSE);
 	
 	inp->ih.uid = from_kuid(&init_user_ns, uid);
         inp->coda_close.VFid = *fid;
@@ -235,14 +240,13 @@ int venus_rename(struct super_block *sb, struct CodaFid *old_fid,
 		 const char *new_name)
 {
 	union inputArgs *inp;
-        union outputArgs *outp;
         int insize, outsize, error; 
 	int offset, s;
 	
 	offset = INSIZE(rename);
 	insize = max_t(unsigned int, offset + new_length + old_length + 8,
 		     OUTSIZE(rename)); 
- 	UPARG(CODA_RENAME);
+	UPARG_NO_OUTP(CODA_RENAME);
 
         inp->coda_rename.sourceFid = *old_fid;
         inp->coda_rename.destFid =  *new_fid;
@@ -303,13 +307,12 @@ int venus_rmdir(struct super_block *sb, struct CodaFid *dirfid,
 		    const char *name, int length)
 {
         union inputArgs *inp;
-        union outputArgs *outp;
         int insize, outsize, error;
         int offset;
 
         offset = INSIZE(rmdir);
 	insize = max_t(unsigned int, offset + length + 1, OUTSIZE(rmdir));
-	UPARG(CODA_RMDIR);
+	UPARG_NO_OUTP(CODA_RMDIR);
 
         inp->coda_rmdir.VFid = *dirfid;
         inp->coda_rmdir.name = offset;
@@ -326,12 +329,11 @@ int venus_remove(struct super_block *sb, struct CodaFid *dirfid,
 		    const char *name, int length)
 {
         union inputArgs *inp;
-        union outputArgs *outp;
         int error=0, insize, outsize, offset;
 
         offset = INSIZE(remove);
 	insize = max_t(unsigned int, offset + length + 1, OUTSIZE(remove));
-	UPARG(CODA_REMOVE);
+	UPARG_NO_OUTP(CODA_REMOVE);
 
         inp->coda_remove.VFid = *dirfid;
         inp->coda_remove.name = offset;
@@ -380,13 +382,12 @@ int venus_link(struct super_block *sb, struct CodaFid *fid,
 		  struct CodaFid *dirfid, const char *name, int len )
 {
         union inputArgs *inp;
-        union outputArgs *outp;
         int insize, outsize, error;
         int offset;
 
 	offset = INSIZE(link);
 	insize = max_t(unsigned int, offset  + len + 1, OUTSIZE(link));
-        UPARG(CODA_LINK);
+        UPARG_NO_OUTP(CODA_LINK);
 
         inp->coda_link.sourceFid = *fid;
         inp->coda_link.destFid = *dirfid;
@@ -407,13 +408,12 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid,
 		     const char *symname, int symlen)
 {
         union inputArgs *inp;
-        union outputArgs *outp;
         int insize, outsize, error;
         int offset, s;
 
         offset = INSIZE(symlink);
 	insize = max_t(unsigned int, offset + len + symlen + 8, OUTSIZE(symlink));
-	UPARG(CODA_SYMLINK);
+	UPARG_NO_OUTP(CODA_SYMLINK);
         
         /*        inp->coda_symlink.attr = *tva; XXXXXX */ 
         inp->coda_symlink.VFid = *fid;
@@ -440,11 +440,10 @@ int venus_symlink(struct super_block *sb, struct CodaFid *fid,
 int venus_fsync(struct super_block *sb, struct CodaFid *fid)
 {
         union inputArgs *inp;
-        union outputArgs *outp; 
 	int insize, outsize, error;
 	
 	insize=SIZE(fsync);
-	UPARG(CODA_FSYNC);
+	UPARG_NO_OUTP(CODA_FSYNC);
 
 	inp->coda_fsync.VFid = *fid;
 	error = coda_upcall(coda_vcp(sb), insize, &outsize, inp);
@@ -456,11 +455,10 @@ int venus_fsync(struct super_block *sb, struct CodaFid *fid)
 int venus_access(struct super_block *sb, struct CodaFid *fid, int mask)
 {
         union inputArgs *inp;
-        union outputArgs *outp; 
 	int insize, outsize, error;
 
 	insize = SIZE(access);
-	UPARG(CODA_ACCESS);
+	UPARG_NO_OUTP(CODA_ACCESS);
 
         inp->coda_access.VFid = *fid;
         inp->coda_access.flags = mask;
@@ -574,7 +572,6 @@ int venus_access_intent(struct super_block *sb, struct CodaFid *fid,
 			size_t count, loff_t ppos, int type)
 {
 	union inputArgs *inp;
-	union outputArgs *outp;
 	int insize, outsize, error;
 	bool finalizer =
 		type == CODA_ACCESS_TYPE_READ_FINISH ||
@@ -584,7 +581,7 @@ int venus_access_intent(struct super_block *sb, struct CodaFid *fid,
 		return 0;
 
 	insize = SIZE(access_intent);
-	UPARG(CODA_ACCESS_INTENT);
+	UPARG_NO_OUTP(CODA_ACCESS_INTENT);
 
 	inp->coda_access_intent.VFid = *fid;
 	inp->coda_access_intent.count = count;
-- 
2.50.1


                 reply	other threads:[~2026-06-04 10:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260604103319.342158-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@coda.cs.cmu.edu \
    --cc=jaharkes@cs.cmu.edu \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox