summaryrefslogtreecommitdiff
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-08-20 20:22:02 +0200
committerIlya Dryomov <idryomov@gmail.com>2017-09-06 19:56:52 +0200
commitd37b1d9943d5138b9b2630b7b7082629a82a1386 (patch)
treebf904513456933cbd93e22ce0068e2a6e34802a5 /fs/ceph/inode.c
parentb529d1b382f77ec6221f9c5fffb17939e92629e4 (diff)
downloadlwn-d37b1d9943d5138b9b2630b7b7082629a82a1386.tar.gz
lwn-d37b1d9943d5138b9b2630b7b7082629a82a1386.zip
ceph: adjust 36 checks for NULL pointers
The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written ... Thus fix the affected source code places. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Yan, Zheng <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 277c7cd7b1ab..a19fafdf87f8 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -52,7 +52,7 @@ struct inode *ceph_get_inode(struct super_block *sb, struct ceph_vino vino)
ino_t t = ceph_vino_to_ino(vino);
inode = iget5_locked(sb, t, ceph_ino_compare, ceph_set_ino_cb, &vino);
- if (inode == NULL)
+ if (!inode)
return ERR_PTR(-ENOMEM);
if (inode->i_state & I_NEW) {
dout("get_inode created new inode %p %llx.%llx ino %llx\n",
@@ -1173,7 +1173,7 @@ retry_lookup:
dn = d_alloc(parent, &dname);
dout("d_alloc %p '%.*s' = %p\n", parent,
dname.len, dname.name, dn);
- if (dn == NULL) {
+ if (!dn) {
dput(parent);
err = -ENOMEM;
goto done;
@@ -1562,7 +1562,7 @@ retry_lookup:
dn = d_alloc(parent, &dname);
dout("d_alloc %p '%.*s' = %p\n", parent,
dname.len, dname.name, dn);
- if (dn == NULL) {
+ if (!dn) {
dout("d_alloc badness\n");
err = -ENOMEM;
goto out;