Skip to content

Commit 462272d

Browse files
Xichao ZhaoAndreas Hindborg
authored andcommitted
configfs: use PTR_ERR_OR_ZERO() to simplify code
Use the standard error pointer macro to shorten the code and simplify. Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com> Reviewed-by: Breno Leitao <leitao@debian.org> Link: https://lore.kernel.org/r/20250812082709.49796-1-zhao.xichao@vivo.com Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
1 parent b320789 commit 462272d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

fs/configfs/dir.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,10 +1601,7 @@ static int configfs_dir_open(struct inode *inode, struct file *file)
16011601
err = -ENOENT;
16021602
if (configfs_dirent_is_ready(parent_sd)) {
16031603
file->private_data = configfs_new_dirent(parent_sd, NULL, 0, NULL);
1604-
if (IS_ERR(file->private_data))
1605-
err = PTR_ERR(file->private_data);
1606-
else
1607-
err = 0;
1604+
err = PTR_ERR_OR_ZERO(file->private_data);
16081605
}
16091606
inode_unlock(d_inode(dentry));
16101607

0 commit comments

Comments
 (0)