Skip to contentSkip to conversation

fix compile warning in fs/nfsd/nfs4xdr.c, 2.6.0-t5-cvs

PATCH In review Muli Ben-Yehuda 2 participants 2 messages Sep 21, 2003 – Sep 22, 2003

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

PATCH 1/1 fix compile warning in fs/nfsd/nfs4xdr.c, 2.6.0-t5-cvs

When compiling fs/nfsd/nfs4xdr.c, I get a warning:

fs/nfsd/nfs4xdr.c: In function `nfsd4_encode_open':
fs/nfsd/nfs4xdr.c:1773: warning: `return' with a value, in function returning void

This patch fixes it. I'm not 100% sure about it, but it seems correct, and the return value is ignored anyway...

fs/nfsd/nfs4xdr.c renamed from linux-2.5/fs/nfsd/nfs4xdr.c +2 -2
diff --exclude-from /home/muli/p/dontdiff -Naur ../linux-2.5/fs/nfsd/nfs4xdr.c 2.6.0-t5-Werror/fs/nfsd/nfs4xdr.c
@@ -1709,13 +1709,13 @@
 }
 
 
-static void
+static int
 nfsd4_encode_open(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open *open)
 {
 	ENCODE_HEAD;
 
 	if (nfserr)
-		return;
+		return nfserr;
 
 	RESERVE_SPACE(36 + sizeof(stateid_t));
 	WRITE32(open->op_stateid.si_generation);
Signature · 2 lines
Muli Ben-Yehuda
http://www.mulix.org
#1 lore raw
Quoted 8 lines · On Sunday September 21, [email protected] wrote:

When compiling fs/nfsd/nfs4xdr.c, I get a warning:

fs/nfsd/nfs4xdr.c: In function `nfsd4_encode_open':
fs/nfsd/nfs4xdr.c:1773: warning: `return' with a value, in function returning void

This patch fixes it. I'm not 100% sure about it, but it seems correct, and the return value is ignored anyway...

As the return value is ignored, we really shouldn't be returning one. I have just sent a patch to Linus which fixes this problem
differently: by making nfsd4_encode_open never return anything.

Thanks,
NeilBrown

Quoted 25 lines

diff --exclude-from /home/muli/p/dontdiff -Naur ../linux-2.5/fs/nfsd/nfs4xdr.c 2.6.0-t5-Werror/fs/nfsd/nfs4xdr.c

fs/nfsd/nfs4xdr.c renamed from linux-2.5/fs/nfsd/nfs4xdr.c +2 -2
@@ -1709,13 +1709,13 @@
 }
 
 
-static void
+static int
 nfsd4_encode_open(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open *open)
 {
 	ENCODE_HEAD;
 
 	if (nfserr)
-		return;
+		return nfserr;
 
 	RESERVE_SPACE(36 + sizeof(stateid_t));
 	WRITE32(open->op_stateid.si_generation);
Signature · 3 lines
-- 
Muli Ben-Yehuda
http://www.mulix.org

-------------------------------------------------------
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