Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

isofs: Adjust four 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>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Markus Elfring and committed by
Jan Kara
e96e8a1d 88986622

+4 -4
+4 -4
fs/isofs/inode.c
··· 96 96 0, (SLAB_RECLAIM_ACCOUNT| 97 97 SLAB_MEM_SPREAD|SLAB_ACCOUNT), 98 98 init_once); 99 - if (isofs_inode_cachep == NULL) 99 + if (!isofs_inode_cachep) 100 100 return -ENOMEM; 101 101 return 0; 102 102 } ··· 678 678 if (isonum_711(vdp->type) == ISO_VD_END) 679 679 break; 680 680 if (isonum_711(vdp->type) == ISO_VD_PRIMARY) { 681 - if (pri == NULL) { 681 + if (!pri) { 682 682 pri = (struct iso_primary_descriptor *)vdp; 683 683 /* Save the buffer in case we need it ... */ 684 684 pri_bh = bh; ··· 742 742 goto out_freebh; 743 743 } 744 744 745 - if (joliet_level && (pri == NULL || !opt.rock)) { 745 + if (joliet_level && (!pri || !opt.rock)) { 746 746 /* This is the case of Joliet with the norock mount flag. 747 747 * A disc with both Joliet and Rock Ridge is handled later 748 748 */ ··· 1320 1320 int frag1 = bufsize - offset; 1321 1321 1322 1322 tmpde = kmalloc(de_len, GFP_KERNEL); 1323 - if (tmpde == NULL) { 1323 + if (!tmpde) { 1324 1324 ret = -ENOMEM; 1325 1325 goto fail; 1326 1326 }