From: Zhengchao Shao Date: Thu, 10 Aug 2023 13:50:04 +0000 (+0800) Subject: bonding: use IS_ERR instead of NULL check in bond_create_debugfs X-Git-Tag: v6.6.7~2079^2~141^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57647e6fdf174e3c84072a39d901036f867e4192;p=platform%2Fkernel%2Flinux-starfive.git bonding: use IS_ERR instead of NULL check in bond_create_debugfs Because debugfs_create_dir returns ERR_PTR, so IS_ERR should be used to check whether the directory is successfully created. Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller --- diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 94c2f35..50e4813 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c @@ -88,7 +88,7 @@ void __init bond_create_debugfs(void) { bonding_debug_root = debugfs_create_dir("bonding", NULL); - if (!bonding_debug_root) + if (IS_ERR(bonding_debug_root)) pr_warn("Warning: Cannot create bonding directory in debugfs\n"); }