fs-udf: Adjust two checks for null pointers
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 15 Aug 2017 15:03:06 +0000 (17:03 +0200)
committerJan Kara <jack@suse.cz>
Wed, 16 Aug 2017 14:38:54 +0000 (16:38 +0200)
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: Jan Kara <jack@suse.cz>
fs/udf/super.c

index 462ac2e9258c9e94bd79bdf87e06151667b72ce8..2c0844fae808bfe44b37bfcbf82e0dfa2ea1e48d 100644 (file)
@@ -324,7 +324,8 @@ static void udf_sb_free_partitions(struct super_block *sb)
 {
        struct udf_sb_info *sbi = UDF_SB(sb);
        int i;
-       if (sbi->s_partmaps == NULL)
+
+       if (!sbi->s_partmaps)
                return;
        for (i = 0; i < sbi->s_partitions; i++)
                udf_free_partition(&sbi->s_partmaps[i]);
@@ -1071,7 +1072,7 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
        else
                bitmap = vzalloc(size); /* TODO: get rid of vzalloc */
 
-       if (bitmap == NULL)
+       if (!bitmap)
                return NULL;
 
        bitmap->s_nr_groups = nr_groups;