mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2] nfs: nfs4xdr.c do-while is not a compound statement
@ 2008-07-18  4:33 Harvey Harrison
  2008-07-18 19:07 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Harvey Harrison @ 2008-07-18  4:33 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Andrew Morton, LKML

The WRITEMEM macro produces sparse warnings of the form:
fs/nfsd/nfs4xdr.c:2668:2: warning: do-while statement is not a compound statement

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 fs/nfsd/nfs4xdr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 9612d66..0957ec1 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1162,11 +1162,11 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
 	*p++ = htonl((u32)((n) >> 32));				\
 	*p++ = htonl((u32)(n));					\
 } while (0)
-#define WRITEMEM(ptr,nbytes)     do if (nbytes > 0) {		\
+#define WRITEMEM(ptr,nbytes)     do { if (nbytes > 0) {		\
 	*(p + XDR_QUADLEN(nbytes) -1) = 0;                      \
 	memcpy(p, ptr, nbytes);					\
 	p += XDR_QUADLEN(nbytes);				\
-} while (0)
+}} while (0)
 #define WRITECINFO(c)		do {				\
 	*p++ = htonl(c.atomic);					\
 	*p++ = htonl(c.before_ctime_sec);				\
-- 
1.5.6.3.569.ga9185


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] nfs: nfs4xdr.c do-while is not a compound statement
  2008-07-18  4:33 [PATCH 2/2] nfs: nfs4xdr.c do-while is not a compound statement Harvey Harrison
@ 2008-07-18 19:07 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2008-07-18 19:07 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andrew Morton, LKML, Benny Halevy

Thanks, applied.--b.

On Thu, Jul 17, 2008 at 09:33:04PM -0700, Harvey Harrison wrote:
> The WRITEMEM macro produces sparse warnings of the form:
> fs/nfsd/nfs4xdr.c:2668:2: warning: do-while statement is not a compound statement
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
>  fs/nfsd/nfs4xdr.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 9612d66..0957ec1 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -1162,11 +1162,11 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
>  	*p++ = htonl((u32)((n) >> 32));				\
>  	*p++ = htonl((u32)(n));					\
>  } while (0)
> -#define WRITEMEM(ptr,nbytes)     do if (nbytes > 0) {		\
> +#define WRITEMEM(ptr,nbytes)     do { if (nbytes > 0) {		\
>  	*(p + XDR_QUADLEN(nbytes) -1) = 0;                      \
>  	memcpy(p, ptr, nbytes);					\
>  	p += XDR_QUADLEN(nbytes);				\
> -} while (0)
> +}} while (0)
>  #define WRITECINFO(c)		do {				\
>  	*p++ = htonl(c.atomic);					\
>  	*p++ = htonl(c.before_ctime_sec);				\
> -- 
> 1.5.6.3.569.ga9185
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-18 19:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-18  4:33 [PATCH 2/2] nfs: nfs4xdr.c do-while is not a compound statement Harvey Harrison
2008-07-18 19:07 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome