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

Configure Feed

Select the types of activity you want to include in your feed.

ext4: prefer IS_ERR_OR_NULL over manual NULL check

Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: "Theodore Ts'o" <tytso@mit.edu>
To: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
Link: https://patch.msgid.link/20260310-b4-is_err_or_null-v1-4-bd63b656022d@avm.de
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Philipp Hahn and committed by
Theodore Ts'o
1d749e11 4edafa81

+4 -4
+1 -1
fs/ext4/fast_commit.c
··· 320 320 if (ext4_fc_disabled(sb)) 321 321 return; 322 322 323 - if (handle && !IS_ERR(handle)) 323 + if (!IS_ERR_OR_NULL(handle)) 324 324 tid = handle->h_transaction->t_tid; 325 325 else { 326 326 read_lock(&sbi->s_journal->j_state_lock);
+1 -1
fs/ext4/mballoc.c
··· 2876 2876 EXT4_MB_GRP_NEED_INIT(grp) && 2877 2877 ext4_free_group_clusters(sb, gdp) > 0 ) { 2878 2878 bh = ext4_read_block_bitmap_nowait(sb, group, true); 2879 - if (bh && !IS_ERR(bh)) { 2879 + if (!IS_ERR_OR_NULL(bh)) { 2880 2880 if (!buffer_uptodate(bh) && cnt) 2881 2881 (*cnt)++; 2882 2882 brelse(bh);
+1 -1
fs/ext4/namei.c
··· 723 723 struct stats stats; 724 724 printk("%s%3u:%03u hash %8x/%8x ",levels?"":" ", i, block, hash, range); 725 725 bh = ext4_bread(NULL,dir, block, 0); 726 - if (!bh || IS_ERR(bh)) 726 + if (IS_ERR_OR_NULL(bh)) 727 727 continue; 728 728 stats = levels? 729 729 dx_show_entries(hinfo, dir, ((struct dx_node *) bh->b_data)->entries, levels - 1):
+1 -1
fs/ext4/symlink.c
··· 92 92 93 93 if (!dentry) { 94 94 bh = ext4_getblk(NULL, inode, 0, EXT4_GET_BLOCKS_CACHED_NOWAIT); 95 - if (IS_ERR(bh) || !bh) 95 + if (IS_ERR_OR_NULL(bh)) 96 96 return ERR_PTR(-ECHILD); 97 97 if (!ext4_buffer_uptodate(bh)) { 98 98 brelse(bh);