Skip to contentSkip to conversation

NFS4XDR get rid of warning

PATCH In review Stephen Hemminger 2 participants 2 messages Sep 9, 2003 – Sep 12, 2003

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

PATCH 1/1 NFS4XDR get rid of warning

On 2.6.0-test5 there is a warning because of calling return with an argument on a void function. The root cause is putting a return statement in a macro (evil side effect).

Change ENCODE_SEQID_OP_TAIL to be a more proper macro, and add the return's where needed.

fs/nfsd/nfs4xdr.c +4 -2
diff -Nru a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
@@ -1116,13 +1116,13 @@
  * where seqids are incremented
  */
 
-#define ENCODE_SEQID_OP_TAIL(stateowner)		\
+#define ENCODE_SEQID_OP_TAIL(stateowner) do {		\
 	BUG_ON(!stateowner);				\
 	if (seqid_mutating_err(nfserr) && stateowner) {	\
 		if (stateowner->so_confirmed)		\
 			stateowner->so_seqid++;		\
 	}						\
-	return nfserr;
+} while(0)
 
 
 static u32 nfs4_ftypes[16] = {
@@ -1786,6 +1786,7 @@
 	}
 
 	ENCODE_SEQID_OP_TAIL(oc->oc_stateowner);
+	return nfserr;
 }
 
 static int
@@ -1801,6 +1802,7 @@
 	}
 
 	ENCODE_SEQID_OP_TAIL(od->od_stateowner);
+	return nfserr;
 }
 
 static int

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 6 lines · On Tuesday September 9, [email protected] wrote:

On 2.6.0-test5 there is a warning because of calling return with an argument on a void function. The root cause is putting a return statement in a macro (evil side effect).

Change ENCODE_SEQID_OP_TAIL to be a more proper macro, and add the return's where needed.

Looks good, thanks.

NeilBrown

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs