* [PATCH] s390/dasd: use IS_ERR_OR_NULL() for debugfs error checking
@ 2025-08-14 7:12 Yang Xiuwei
2025-08-15 14:11 ` Stefan Haberland
0 siblings, 1 reply; 2+ messages in thread
From: Yang Xiuwei @ 2025-08-14 7:12 UTC (permalink / raw)
To: sth, hoeppner
Cc: hca, gor, agordeev, borntraeger, svens, linux-s390, linux-kernel,
Yang Xiuwei
From: Yang Xiuwei <yangxiuwei@kylinos.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@kylinos.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] s390/dasd: use IS_ERR_OR_NULL() for debugfs error checking
2025-08-14 7:12 [PATCH] s390/dasd: use IS_ERR_OR_NULL() for debugfs error checking Yang Xiuwei
@ 2025-08-15 14:11 ` Stefan Haberland
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Haberland @ 2025-08-15 14:11 UTC (permalink / raw)
To: Yang Xiuwei, hoeppner
Cc: hca, gor, agordeev, borntraeger, svens, linux-s390, linux-kernel,
Yang Xiuwei
Am 14.08.25 um 09:12 schrieb Yang Xiuwei:
> From: Yang Xiuwei <yangxiuwei@kylinos.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@kylinos.cn>
applied, thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-15 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14 7:12 [PATCH] s390/dasd: use IS_ERR_OR_NULL() for debugfs error checking Yang Xiuwei
2025-08-15 14:11 ` Stefan Haberland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).