* [PATCH] fix compile warning in fs/nfsd/nfs4xdr.c, 2.6.0-t5-cvs
@ 2003-09-21 8:09 Muli Ben-Yehuda
2003-09-22 23:34 ` Neil Brown
0 siblings, 1 reply; 2+ messages in thread
From: Muli Ben-Yehuda @ 2003-09-21 8:09 UTC (permalink / raw)
To: Neil Brown; +Cc: Linux-Kernel, nfs
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
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...
diff --exclude-from /home/muli/p/dontdiff -Naur ../linux-2.5/fs/nfsd/nfs4xdr.c 2.6.0-t5-Werror/fs/nfsd/nfs4xdr.c
--- ../linux-2.5/fs/nfsd/nfs4xdr.c Tue Sep 2 12:51:06 2003
+++ 2.6.0-t5-Werror/fs/nfsd/nfs4xdr.c Sun Sep 21 10:18:19 2003
@@ -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);
--
Muli Ben-Yehuda
http://www.mulix.org
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix compile warning in fs/nfsd/nfs4xdr.c, 2.6.0-t5-cvs
2003-09-21 8:09 [PATCH] fix compile warning in fs/nfsd/nfs4xdr.c, 2.6.0-t5-cvs Muli Ben-Yehuda
@ 2003-09-22 23:34 ` Neil Brown
0 siblings, 0 replies; 2+ messages in thread
From: Neil Brown @ 2003-09-22 23:34 UTC (permalink / raw)
To: Muli Ben-Yehuda; +Cc: Linux-Kernel, nfs
On Sunday September 21, mulix@mulix.org 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
>
> diff --exclude-from /home/muli/p/dontdiff -Naur ../linux-2.5/fs/nfsd/nfs4xdr.c 2.6.0-t5-Werror/fs/nfsd/nfs4xdr.c
> --- ../linux-2.5/fs/nfsd/nfs4xdr.c Tue Sep 2 12:51:06 2003
> +++ 2.6.0-t5-Werror/fs/nfsd/nfs4xdr.c Sun Sep 21 10:18:19 2003
> @@ -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);
>
> --
> Muli Ben-Yehuda
> http://www.mulix.org
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-09-23 0:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-21 8:09 [PATCH] fix compile warning in fs/nfsd/nfs4xdr.c, 2.6.0-t5-cvs Muli Ben-Yehuda
2003-09-22 23:34 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox