orangefs: Adjust three checks for null pointers
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 17 Aug 2017 19:35:16 +0000 (21:35 +0200)
committerMike Marshall <hubcap@omnibond.com>
Thu, 14 Sep 2017 18:58:31 +0000 (14:58 -0400)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written !…

Thus fix affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/acl.c
fs/orangefs/xattr.c

index 45f27cf51fd866834893cb287671328dbf367709..9108ef433e6d7b09721360a4dc3c1e7f4f2caf3b 100644 (file)
@@ -35,7 +35,7 @@ struct posix_acl *orangefs_get_acl(struct inode *inode, int type)
         * I don't do that for now.
         */
        value = kmalloc(ORANGEFS_MAX_XATTR_VALUELEN, GFP_KERNEL);
-       if (value == NULL)
+       if (!value)
                return ERR_PTR(-ENOMEM);
 
        gossip_debug(GOSSIP_ACL_DEBUG,
index fed0e9aae23baa374299965e69aa71bb4141cbc6..81ac88bb91ff9fc6d0d77dc555b8142c86a8040d 100644 (file)
@@ -239,7 +239,7 @@ int orangefs_inode_setxattr(struct inode *inode, const char *name,
        internal_flag = convert_to_internal_xattr_flags(flags);
 
        /* This is equivalent to a removexattr */
-       if (size == 0 && value == NULL) {
+       if (size == 0 && !value) {
                gossip_debug(GOSSIP_XATTR_DEBUG,
                             "removing xattr (%s)\n",
                             name);
@@ -311,7 +311,7 @@ ssize_t orangefs_listxattr(struct dentry *dentry, char *buffer, size_t size)
        int i = 0;
        int returned_count = 0;
 
-       if (size > 0 && buffer == NULL) {
+       if (size > 0 && !buffer) {
                gossip_err("%s: bogus NULL pointers\n", __func__);
                return -EINVAL;
        }