All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] nfsd4: typo logical vs bitwise negate
@ 2011-10-17  7:41 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-10-17  7:41 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Neil Brown, linux-nfs, kernel-janitors

This should be a bitwise negate here.  It silences a Sparse warning:
fs/nfsd/nfs4xdr.c:693:16: warning: dubious: x & !y

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 2cab33c..645a0a9 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -690,7 +690,7 @@ static __be32 nfsd4_decode_share_deny(struct nfsd4_compoundargs *argp, u32 *x)
 	READ_BUF(4);
 	READ32(*x);
 	/* Note: unlinke access bits, deny bits may be zero. */
-	if (*x & !NFS4_SHARE_DENY_BOTH)
+	if (*x & ~NFS4_SHARE_DENY_BOTH)
 		return nfserr_bad_xdr;
 	return nfs_ok;
 xdr_error:

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

* [patch] nfsd4: typo logical vs bitwise negate
@ 2011-10-17  7:41 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2011-10-17  7:41 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Neil Brown, linux-nfs, kernel-janitors

This should be a bitwise negate here.  It silences a Sparse warning:
fs/nfsd/nfs4xdr.c:693:16: warning: dubious: x & !y

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 2cab33c..645a0a9 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -690,7 +690,7 @@ static __be32 nfsd4_decode_share_deny(struct nfsd4_compoundargs *argp, u32 *x)
 	READ_BUF(4);
 	READ32(*x);
 	/* Note: unlinke access bits, deny bits may be zero. */
-	if (*x & !NFS4_SHARE_DENY_BOTH)
+	if (*x & ~NFS4_SHARE_DENY_BOTH)
 		return nfserr_bad_xdr;
 	return nfs_ok;
 xdr_error:

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

* Re: [patch] nfsd4: typo logical vs bitwise negate
  2011-10-17  7:41 ` Dan Carpenter
@ 2011-10-17 12:35   ` J. Bruce Fields
  -1 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2011-10-17 12:35 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Neil Brown, linux-nfs, kernel-janitors

On Mon, Oct 17, 2011 at 10:41:17AM +0300, Dan Carpenter wrote:
> This should be a bitwise negate here.  It silences a Sparse warning:
> fs/nfsd/nfs4xdr.c:693:16: warning: dubious: x & !y

Whoops, thanks for catching that!

Applying for 3.2.--b.

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 2cab33c..645a0a9 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -690,7 +690,7 @@ static __be32 nfsd4_decode_share_deny(struct nfsd4_compoundargs *argp, u32 *x)
>  	READ_BUF(4);
>  	READ32(*x);
>  	/* Note: unlinke access bits, deny bits may be zero. */
> -	if (*x & !NFS4_SHARE_DENY_BOTH)
> +	if (*x & ~NFS4_SHARE_DENY_BOTH)
>  		return nfserr_bad_xdr;
>  	return nfs_ok;
>  xdr_error:

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

* Re: [patch] nfsd4: typo logical vs bitwise negate
@ 2011-10-17 12:35   ` J. Bruce Fields
  0 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2011-10-17 12:35 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Neil Brown, linux-nfs, kernel-janitors

On Mon, Oct 17, 2011 at 10:41:17AM +0300, Dan Carpenter wrote:
> This should be a bitwise negate here.  It silences a Sparse warning:
> fs/nfsd/nfs4xdr.c:693:16: warning: dubious: x & !y

Whoops, thanks for catching that!

Applying for 3.2.--b.

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 2cab33c..645a0a9 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -690,7 +690,7 @@ static __be32 nfsd4_decode_share_deny(struct nfsd4_compoundargs *argp, u32 *x)
>  	READ_BUF(4);
>  	READ32(*x);
>  	/* Note: unlinke access bits, deny bits may be zero. */
> -	if (*x & !NFS4_SHARE_DENY_BOTH)
> +	if (*x & ~NFS4_SHARE_DENY_BOTH)
>  		return nfserr_bad_xdr;
>  	return nfs_ok;
>  xdr_error:

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

end of thread, other threads:[~2011-10-17 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17  7:41 [patch] nfsd4: typo logical vs bitwise negate Dan Carpenter
2011-10-17  7:41 ` Dan Carpenter
2011-10-17 12:35 ` J. Bruce Fields
2011-10-17 12:35   ` J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.