Message ID | 20230809124107.360574-3-shaozhengchao@huawei.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | bonding: do some cleanups in bond driver | expand |
On Wed, Aug 09, 2023 at 08:41:04PM +0800, Zhengchao Shao wrote: > Because debugfs_create_dir returns ERR_PTR, so warning printing will never > be invoked in bond_create_debugfs, remove it. If failed to create > directory, failure information will be printed in debugfs_create_dir. > > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> > --- > drivers/net/bonding/bond_debugfs.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c > index 94c2f35e3bfc..e4e7f4ee48e0 100644 > --- a/drivers/net/bonding/bond_debugfs.c > +++ b/drivers/net/bonding/bond_debugfs.c > @@ -87,9 +87,6 @@ void bond_debug_reregister(struct bonding *bond) > void __init bond_create_debugfs(void) > { > bonding_debug_root = debugfs_create_dir("bonding", NULL); > - > - if (!bonding_debug_root) debugfs_create_dir() does not print information for all failures. We can use IS_ERR(bonding_debug_root) to check the value here. Thanks Hangbin > - pr_warn("Warning: Cannot create bonding directory in debugfs\n"); > } > > void bond_destroy_debugfs(void) > -- > 2.34.1 >
On 2023/8/10 10:53, Hangbin Liu wrote: > On Wed, Aug 09, 2023 at 08:41:04PM +0800, Zhengchao Shao wrote: >> Because debugfs_create_dir returns ERR_PTR, so warning printing will never >> be invoked in bond_create_debugfs, remove it. If failed to create >> directory, failure information will be printed in debugfs_create_dir. >> >> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> >> --- >> drivers/net/bonding/bond_debugfs.c | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c >> index 94c2f35e3bfc..e4e7f4ee48e0 100644 >> --- a/drivers/net/bonding/bond_debugfs.c >> +++ b/drivers/net/bonding/bond_debugfs.c >> @@ -87,9 +87,6 @@ void bond_debug_reregister(struct bonding *bond) >> void __init bond_create_debugfs(void) >> { >> bonding_debug_root = debugfs_create_dir("bonding", NULL); >> - >> - if (!bonding_debug_root) > Hi Hangbin: > debugfs_create_dir() does not print information for all failures. We can use > IS_ERR(bonding_debug_root) to check the value here. > Thank you for your review. I think you are right here, and I will modify it. Zhengchao Shao > Thanks > Hangbin >> - pr_warn("Warning: Cannot create bonding directory in debugfs\n"); >> } >> >> void bond_destroy_debugfs(void) >> -- >> 2.34.1 >>
diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c index 94c2f35e3bfc..e4e7f4ee48e0 100644 --- a/drivers/net/bonding/bond_debugfs.c +++ b/drivers/net/bonding/bond_debugfs.c @@ -87,9 +87,6 @@ void bond_debug_reregister(struct bonding *bond) void __init bond_create_debugfs(void) { bonding_debug_root = debugfs_create_dir("bonding", NULL); - - if (!bonding_debug_root) - pr_warn("Warning: Cannot create bonding directory in debugfs\n"); } void bond_destroy_debugfs(void)
Because debugfs_create_dir returns ERR_PTR, so warning printing will never be invoked in bond_create_debugfs, remove it. If failed to create directory, failure information will be printed in debugfs_create_dir. Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> --- drivers/net/bonding/bond_debugfs.c | 3 --- 1 file changed, 3 deletions(-)