]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
configfs: use PTR_ERR_OR_ZERO() to simplify code
authorXichao Zhao <zhao.xichao@vivo.com>
Tue, 12 Aug 2025 08:27:09 +0000 (16:27 +0800)
committerAndreas Hindborg <a.hindborg@kernel.org>
Thu, 4 Sep 2025 14:49:17 +0000 (16:49 +0200)
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>
fs/configfs/dir.c

index f327fbb9a0cae39d9569a7b946586551642c4be3..81f4f06bc87e755c1c7d3ddc25c4bc3581577dc8 100644 (file)
@@ -1601,10 +1601,7 @@ static int configfs_dir_open(struct inode *inode, struct file *file)
        err = -ENOENT;
        if (configfs_dirent_is_ready(parent_sd)) {
                file->private_data = configfs_new_dirent(parent_sd, NULL, 0, NULL);
-               if (IS_ERR(file->private_data))
-                       err = PTR_ERR(file->private_data);
-               else
-                       err = 0;
+               err = PTR_ERR_OR_ZERO(file->private_data);
        }
        inode_unlock(d_inode(dentry));