Message ID | 20230423122932.31274-1-u202112092@hust.edu.cn (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drivers: ras: cec: return value check of `d` | expand |
On Sun, Apr 23, 2023 at 08:29:32PM +0800, Ruliang Lin wrote: > According to the documentation of the debugfs_create_dir() function, > there is no need to check the return value of this function. " * Drivers should generally work fine even if debugfs fails to init anyway." Except that this particular driver won't if there is no debugfs hierarchy created. > Just delete the dead code. So no, in this case it is not dead code but very much alive.
diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c index 321af498ee11..d2a03f94cbfe 100644 --- a/drivers/ras/cec.c +++ b/drivers/ras/cec.c @@ -483,10 +483,6 @@ static int __init create_debugfs_nodes(void) struct dentry *d, *pfn, *decay, *count, *array; d = debugfs_create_dir("cec", ras_debugfs_dir); - if (!d) { - pr_warn("Error creating cec debugfs node!\n"); - return -1; - } decay = debugfs_create_file("decay_interval", S_IRUSR | S_IWUSR, d, &decay_interval, &decay_interval_ops);