diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-02-20 16:03:05 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-02-20 16:15:44 -0500 |
commit | 90dc7d2796edf94a9eaa838321a9734c8513e717 (patch) | |
tree | 818c8899555efa3f5598f1ee9aa1fd5a5264c6c4 /fs | |
parent | 1227a74e2e0217a4ca155d1677bdbf5f69e32bed (diff) |
nfs: fix sparse warnings
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>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/callback_xdr.c | 6 | ||||
-rw-r--r-- | fs/nfs/delegation.c | 2 | ||||
-rw-r--r-- | fs/nfs/idmap.c | 2 | ||||
-rw-r--r-- | 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 c63eb720b68b..13619d24f023 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, | |||
254 | if (!(bitmap[0] & FATTR4_WORD0_CHANGE)) | 254 | if (!(bitmap[0] & FATTR4_WORD0_CHANGE)) |
255 | return 0; | 255 | return 0; |
256 | p = xdr_reserve_space(xdr, 8); | 256 | p = xdr_reserve_space(xdr, 8); |
257 | if (unlikely(p == 0)) | 257 | if (unlikely(!p)) |
258 | return htonl(NFS4ERR_RESOURCE); | 258 | return htonl(NFS4ERR_RESOURCE); |
259 | p = xdr_encode_hyper(p, change); | 259 | p = xdr_encode_hyper(p, change); |
260 | return 0; | 260 | return 0; |
@@ -267,7 +267,7 @@ static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, u | |||
267 | if (!(bitmap[0] & FATTR4_WORD0_SIZE)) | 267 | if (!(bitmap[0] & FATTR4_WORD0_SIZE)) |
268 | return 0; | 268 | return 0; |
269 | p = xdr_reserve_space(xdr, 8); | 269 | p = xdr_reserve_space(xdr, 8); |
270 | if (unlikely(p == 0)) | 270 | if (unlikely(!p)) |
271 | return htonl(NFS4ERR_RESOURCE); | 271 | return htonl(NFS4ERR_RESOURCE); |
272 | p = xdr_encode_hyper(p, size); | 272 | p = xdr_encode_hyper(p, size); |
273 | return 0; | 273 | return 0; |
@@ -278,7 +278,7 @@ static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *ti | |||
278 | __be32 *p; | 278 | __be32 *p; |
279 | 279 | ||
280 | p = xdr_reserve_space(xdr, 12); | 280 | p = xdr_reserve_space(xdr, 12); |
281 | if (unlikely(p == 0)) | 281 | if (unlikely(!p)) |
282 | return htonl(NFS4ERR_RESOURCE); | 282 | return htonl(NFS4ERR_RESOURCE); |
283 | p = xdr_encode_hyper(p, time->tv_sec); | 283 | p = xdr_encode_hyper(p, time->tv_sec); |
284 | *p = htonl(time->tv_nsec); | 284 | *p = htonl(time->tv_nsec); |
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index b9eadd18ba70..00a5e4405e16 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_ | |||
49 | struct file_lock *fl; | 49 | struct file_lock *fl; |
50 | int status; | 50 | int status; |
51 | 51 | ||
52 | for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) { | 52 | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { |
53 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) | 53 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) |
54 | continue; | 54 | continue; |
55 | if (nfs_file_open_context(fl->fl_file) != ctx) | 55 | if (nfs_file_open_context(fl->fl_file) != ctx) |
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index 8ae5dba2d4e5..86147b0ab2cf 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, | |||
309 | mutex_lock(&idmap->idmap_im_lock); | 309 | mutex_lock(&idmap->idmap_im_lock); |
310 | 310 | ||
311 | he = idmap_lookup_id(h, id); | 311 | he = idmap_lookup_id(h, id); |
312 | if (he != 0) { | 312 | if (he) { |
313 | memcpy(name, he->ih_name, he->ih_namelen); | 313 | memcpy(name, he->ih_name, he->ih_namelen); |
314 | ret = he->ih_namelen; | 314 | ret = he->ih_namelen; |
315 | goto out; | 315 | goto out; |
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 6233eb5e98c1..b962397004c1 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 | |||
785 | struct file_lock *fl; | 785 | struct file_lock *fl; |
786 | int status = 0; | 786 | int status = 0; |
787 | 787 | ||
788 | for (fl = inode->i_flock; fl != 0; fl = fl->fl_next) { | 788 | for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) { |
789 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) | 789 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) |
790 | continue; | 790 | continue; |
791 | if (nfs_file_open_context(fl->fl_file)->state != state) | 791 | if (nfs_file_open_context(fl->fl_file)->state != state) |