diff mbox series

[net-next,2/5] bonding: remove warning printing in bond_create_debugfs

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

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1330 this patch: 1330
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shaozhengchao Aug. 9, 2023, 12:41 p.m. UTC
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(-)

Comments

Hangbin Liu Aug. 10, 2023, 2:53 a.m. UTC | #1
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
>
shaozhengchao Aug. 10, 2023, 8:06 a.m. UTC | #2
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 mbox series

Patch

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)