diff mbox series

[v6] pktcdvd: Remove unnecessary debugfs_create_dir() error check in pkt_debugfs_dev_new()

Message ID 20240826062653.2137887-1-11162571@vivo.com (mailing list archive)
State New, archived
Headers show
Series [v6] pktcdvd: Remove unnecessary debugfs_create_dir() error check in pkt_debugfs_dev_new() | expand

Commit Message

Yang Ruibin Aug. 26, 2024, 6:26 a.m. UTC
Remove the debugfs_create_dir() error check.
It's safe to pass in errors that it gives you.

Signed-off-by: Yang Ruibin <11162571@vivo.com>
---
Changes v6:
-Add the Missing sapce
-Simplified commit message explanation
---
 drivers/block/pktcdvd.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jens Axboe Aug. 26, 2024, 8:16 p.m. UTC | #1
On 8/26/24 12:26 AM, Yang Ruibin wrote:
> Remove the debugfs_create_dir() error check.
> It's safe to pass in errors that it gives you.

Please make it:

Remove the debugfs_create_dir() error check. It's safe to pass in error
pointers to the debugfs API, hence the user isn't supposed to include
error checking of the return values.

Note both the rewording, and that commit messages should be formatted to
72-74 char line lengths, not tiny ones.
diff mbox series

Patch

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 7cece5884b9c..3edb37a41312 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -498,8 +498,6 @@  static void pkt_debugfs_dev_new(struct pktcdvd_device *pd)
 	if (!pkt_debugfs_root)
 		return;
 	pd->dfs_d_root = debugfs_create_dir(pd->disk->disk_name, pkt_debugfs_root);
-	if (!pd->dfs_d_root)
-		return;
 
 	pd->dfs_f_info = debugfs_create_file("info", 0444, pd->dfs_d_root,
 					     pd, &pkt_seq_fops);