]> git.hungrycats.org Git - linux/commitdiff
[PATCH] knfsd: NFS4XDR get rid of warning
authorNeil Brown <neilb@cse.unsw.edu.au>
Mon, 22 Sep 2003 12:22:28 +0000 (05:22 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 22 Sep 2003 12:22:28 +0000 (05:22 -0700)
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, change all
calling functions to return void.

fs/nfsd/nfs4xdr.c

index dd76f066aac06a0654c919e7ebdbd948c1188b9a..371f515f91436e8c73eef5509d64fe673c499ab6 100644 (file)
@@ -1116,13 +1116,13 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
  * 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] = {
@@ -1773,7 +1773,7 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open
        ENCODE_SEQID_OP_TAIL(open->op_stateowner);
 }
 
-static int
+static void
 nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open_confirm *oc)
 {
        ENCODE_HEAD;
@@ -1788,7 +1788,7 @@ nfsd4_encode_open_confirm(struct nfsd4_compoundres *resp, int nfserr, struct nfs
        ENCODE_SEQID_OP_TAIL(oc->oc_stateowner);
 }
 
-static int
+static void
 nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_open_downgrade *od)
 {
        ENCODE_HEAD;