LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/4] nfs: fix sparse warning in nfs4state.c
@ 2008-02-20 20:10 Harvey Harrison
2008-02-20 20:43 ` Trond Myklebust
0 siblings, 1 reply; 4+ messages in thread
From: Harvey Harrison @ 2008-02-20 20:10 UTC (permalink / raw)
To: Trond Myklebust, Andrew Morton; +Cc: LKML
fs/nfs/nfs4state.c:788:34: warning: Using plain integer as NULL pointer
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
fs/nfs/nfs4state.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 6233eb5..b962397 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -785,7 +785,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s
struct file_lock *fl;
int status = 0;
- for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) {
+ for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
continue;
if (nfs_file_open_context(fl->fl_file)->state != state)
--
1.5.4.2.200.g99e75
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/4] nfs: fix sparse warning in nfs4state.c
2008-02-20 20:10 [PATCH 1/4] nfs: fix sparse warning in nfs4state.c Harvey Harrison
@ 2008-02-20 20:43 ` Trond Myklebust
2008-02-20 21:03 ` [PATCH] nfs: fix sparse warnings Harvey Harrison
0 siblings, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2008-02-20 20:43 UTC (permalink / raw)
To: Harvey Harrison; +Cc: Andrew Morton, LKML
On Wed, 2008-02-20 at 12:10 -0800, Harvey Harrison wrote:
> fs/nfs/nfs4state.c:788:34: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> fs/nfs/nfs4state.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
> index 6233eb5..b962397 100644
> --- a/fs/nfs/nfs4state.c
> +++ b/fs/nfs/nfs4state.c
> @@ -785,7 +785,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s
> struct file_lock *fl;
> int status = 0;
>
> - for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) {
> + for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
> if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
> continue;
> if (nfs_file_open_context(fl->fl_file)->state != state)
Could you please just wrap these 4 up into a single patch? They are all
fixing up the same issue, and they are trivial to review, so there is
very little benefit in separating them.
Thanks
Trond
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] nfs: fix sparse warnings
2008-02-20 20:43 ` Trond Myklebust
@ 2008-02-20 21:03 ` Harvey Harrison
2008-02-20 21:14 ` Trond Myklebust
0 siblings, 1 reply; 4+ messages in thread
From: Harvey Harrison @ 2008-02-20 21:03 UTC (permalink / raw)
To: Trond Myklebust; +Cc: Andrew Morton, LKML
fs/nfs/nfs4state.c:788:34: warning: Using plain integer as NULL pointer
fs/nfs/delegation.c:52:34: warning: Using plain integer as NULL pointer
fs/nfs/idmap.c:312:12: warning: Using plain integer as NULL pointer
fs/nfs/callback_xdr.c:257:6: warning: Using plain integer as NULL pointer
fs/nfs/callback_xdr.c:270:6: warning: Using plain integer as NULL pointer
fs/nfs/callback_xdr.c:281:6: warning: Using plain integer as NULL pointer
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
Rollup patches 1-4.
fs/nfs/callback_xdr.c | 6 +++---
fs/nfs/delegation.c | 2 +-
fs/nfs/idmap.c | 2 +-
fs/nfs/nfs4state.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index c63eb72..13619d2 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -254,7 +254,7 @@ static __be32 encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap,
if (!(bitmap[0] & FATTR4_WORD0_CHANGE))
return 0;
p = xdr_reserve_space(xdr, 8);
- if (unlikely(p == 0))
+ if (unlikely(!p))
return htonl(NFS4ERR_RESOURCE);
p = xdr_encode_hyper(p, change);
return 0;
@@ -267,7 +267,7 @@ static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, u
if (!(bitmap[0] & FATTR4_WORD0_SIZE))
return 0;
p = xdr_reserve_space(xdr, 8);
- if (unlikely(p == 0))
+ if (unlikely(!p))
return htonl(NFS4ERR_RESOURCE);
p = xdr_encode_hyper(p, size);
return 0;
@@ -278,7 +278,7 @@ static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *ti
__be32 *p;
p = xdr_reserve_space(xdr, 12);
- if (unlikely(p == 0))
+ if (unlikely(!p))
return htonl(NFS4ERR_RESOURCE);
p = xdr_encode_hyper(p, time->tv_sec);
*p = htonl(time->tv_nsec);
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index b9eadd1..00a5e44 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -49,7 +49,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
struct file_lock *fl;
int status;
- for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) {
+ for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
continue;
if (nfs_file_open_context(fl->fl_file) != ctx)
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index 8ae5dba..86147b0 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -309,7 +309,7 @@ nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h,
mutex_lock(&idmap->idmap_im_lock);
he = idmap_lookup_id(h, id);
- if (he != 0) {
+ if (he) {
memcpy(name, he->ih_name, he->ih_namelen);
ret = he->ih_namelen;
goto out;
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 6233eb5..b962397 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -785,7 +785,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s
struct file_lock *fl;
int status = 0;
- for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) {
+ for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK)))
continue;
if (nfs_file_open_context(fl->fl_file)->state != state)
--
1.5.4.2.200.g99e75
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nfs: fix sparse warnings
2008-02-20 21:03 ` [PATCH] nfs: fix sparse warnings Harvey Harrison
@ 2008-02-20 21:14 ` Trond Myklebust
0 siblings, 0 replies; 4+ messages in thread
From: Trond Myklebust @ 2008-02-20 21:14 UTC (permalink / raw)
To: Harvey Harrison; +Cc: Andrew Morton, LKML
On Wed, 2008-02-20 at 13:03 -0800, Harvey Harrison wrote:
> fs/nfs/nfs4state.c:788:34: warning: Using plain integer as NULL pointer
> fs/nfs/delegation.c:52:34: warning: Using plain integer as NULL pointer
> fs/nfs/idmap.c:312:12: warning: Using plain integer as NULL pointer
> fs/nfs/callback_xdr.c:257:6: warning: Using plain integer as NULL pointer
> fs/nfs/callback_xdr.c:270:6: warning: Using plain integer as NULL pointer
> fs/nfs/callback_xdr.c:281:6: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> Rollup patches 1-4.
> fs/nfs/callback_xdr.c | 6 +++---
> fs/nfs/delegation.c | 2 +-
> fs/nfs/idmap.c | 2 +-
> fs/nfs/nfs4state.c | 2 +-
> 4 files changed, 6 insertions(+), 6 deletions(-)
Thanks! I'll apply...
Cheers
Trond
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-02-20 21:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-20 20:10 [PATCH 1/4] nfs: fix sparse warning in nfs4state.c Harvey Harrison
2008-02-20 20:43 ` Trond Myklebust
2008-02-20 21:03 ` [PATCH] nfs: fix sparse warnings Harvey Harrison
2008-02-20 21:14 ` Trond Myklebust
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).