summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXichao Zhao <zhao.xichao@vivo.com>2025-08-12 16:27:09 +0800
committerAndreas Hindborg <a.hindborg@kernel.org>2025-09-04 16:49:17 +0200
commit462272dd734b568f0190d01e24f5257c1a763fae (patch)
treea411b43de7f06766d7abf0a6a82400621c67a567
parentb320789d6883cc00ac78ce83bccbfe7ed58afcf0 (diff)
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>
-rw-r--r--fs/configfs/dir.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index f327fbb9a0ca..81f4f06bc87e 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -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));