[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250814071247.2572569-1-yangxiuwei2025@163.com>
Date: Thu, 14 Aug 2025 15:12:47 +0800
From: Yang Xiuwei <yangxiuwei2025@....com>
To: sth@...ux.ibm.com,
hoeppner@...ux.ibm.com
Cc: hca@...ux.ibm.com,
gor@...ux.ibm.com,
agordeev@...ux.ibm.com,
borntraeger@...ux.ibm.com,
svens@...ux.ibm.com,
linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org,
Yang Xiuwei <yangxiuwei@...inos.cn>
Subject: [PATCH] s390/dasd: use IS_ERR_OR_NULL() for debugfs error checking
From: Yang Xiuwei <yangxiuwei@...inos.cn>
Current code checks both `!pde` and `IS_ERR(pde)` separately when
handling debugfs directory creation. Replace with IS_ERR_OR_NULL()
for more concise error checking.
This change applies to:
1. dasd_debugfs_setup() helper function
2. dasd_statistics_createroot() initialization code
Signed-off-by: Yang Xiuwei <yangxiuwei@...inos.cn>
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 506a947d00a5..78a9c8d781b3 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -215,7 +215,7 @@ static struct dentry *dasd_debugfs_setup(const char *name,
if (!base_dentry)
return NULL;
pde = debugfs_create_dir(name, base_dentry);
- if (!pde || IS_ERR(pde))
+ if (IS_ERR_OR_NULL(pde))
return NULL;
return pde;
}
@@ -1089,11 +1089,11 @@ static void dasd_statistics_createroot(void)
dasd_debugfs_root_entry = NULL;
pde = debugfs_create_dir("dasd", NULL);
- if (!pde || IS_ERR(pde))
+ if (IS_ERR_OR_NULL(pde))
goto error;
dasd_debugfs_root_entry = pde;
pde = debugfs_create_dir("global", dasd_debugfs_root_entry);
- if (!pde || IS_ERR(pde))
+ if (IS_ERR_OR_NULL(pde))
goto error;
dasd_debugfs_global_entry = pde;
dasd_profile_init(&dasd_global_profile, dasd_debugfs_global_entry);
--
2.25.1
Powered by blists - more mailing lists