Commit 90dc7d2796edf94a9eaa838321a9734c8513e717
Committed by
Trond Myklebust
1 parent
1227a74e2e
Exists in
master
and in
7 other branches
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>
Showing 4 changed files with 6 additions and 6 deletions Side-by-side Diff
fs/nfs/callback_xdr.c
... | ... | @@ -254,7 +254,7 @@ |
254 | 254 | if (!(bitmap[0] & FATTR4_WORD0_CHANGE)) |
255 | 255 | return 0; |
256 | 256 | p = xdr_reserve_space(xdr, 8); |
257 | - if (unlikely(p == 0)) | |
257 | + if (unlikely(!p)) | |
258 | 258 | return htonl(NFS4ERR_RESOURCE); |
259 | 259 | p = xdr_encode_hyper(p, change); |
260 | 260 | return 0; |
... | ... | @@ -267,7 +267,7 @@ |
267 | 267 | if (!(bitmap[0] & FATTR4_WORD0_SIZE)) |
268 | 268 | return 0; |
269 | 269 | p = xdr_reserve_space(xdr, 8); |
270 | - if (unlikely(p == 0)) | |
270 | + if (unlikely(!p)) | |
271 | 271 | return htonl(NFS4ERR_RESOURCE); |
272 | 272 | p = xdr_encode_hyper(p, size); |
273 | 273 | return 0; |
... | ... | @@ -278,7 +278,7 @@ |
278 | 278 | __be32 *p; |
279 | 279 | |
280 | 280 | p = xdr_reserve_space(xdr, 12); |
281 | - if (unlikely(p == 0)) | |
281 | + if (unlikely(!p)) | |
282 | 282 | return htonl(NFS4ERR_RESOURCE); |
283 | 283 | p = xdr_encode_hyper(p, time->tv_sec); |
284 | 284 | *p = htonl(time->tv_nsec); |
fs/nfs/delegation.c
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | struct file_lock *fl; |
50 | 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 | 53 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) |
54 | 54 | continue; |
55 | 55 | if (nfs_file_open_context(fl->fl_file) != ctx) |
fs/nfs/idmap.c
fs/nfs/nfs4state.c
... | ... | @@ -785,7 +785,7 @@ |
785 | 785 | struct file_lock *fl; |
786 | 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 | 789 | if (!(fl->fl_flags & (FL_POSIX|FL_FLOCK))) |
790 | 790 | continue; |
791 | 791 | if (nfs_file_open_context(fl->fl_file)->state != state) |