[PATCH v3] drivers: wireless: ath5k: remove parameter check in ath5k_debug_init_device(struct ath5k_hw *ah)

Minjie Du posted 1 patch 2 years, 7 months ago
drivers/net/wireless/ath/ath5k/debug.c | 2 --
1 file changed, 2 deletions(-)
[PATCH v3] drivers: wireless: ath5k: remove parameter check in ath5k_debug_init_device(struct ath5k_hw *ah)
Posted by Minjie Du 2 years, 7 months ago
debugfs_create_file() will return early if phydir is an error
pointer, so an extra error check is not needed.

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 drivers/net/wireless/ath/ath5k/debug.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 4b41160e5..ec130510a 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -982,8 +982,6 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
 	ah->debug.level = ath5k_debug;
 
 	phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
-	if (!phydir)
-		return;
 
 	debugfs_create_file("debug", 0600, phydir, ah, &fops_debug);
 	debugfs_create_file("registers", 0400, phydir, ah, &registers_fops);
-- 
2.39.0
Re: [PATCH v3] drivers: wireless: ath5k: remove parameter check in ath5k_debug_init_device(struct ath5k_hw *ah)
Posted by Jiri Slaby 2 years, 7 months ago
The subject should be:
wifi: ath5k: remove parameter check in ath5k_debug_init_device()

I believe this is documented in SubmittingPatches.

On 13. 07. 23, 9:46, Minjie Du wrote:
> debugfs_create_file() will return early if phydir is an error
> pointer, so an extra error check is not needed.

It would be worth noting that the check is actually wrong.

> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---
>   drivers/net/wireless/ath/ath5k/debug.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
> index 4b41160e5..ec130510a 100644
> --- a/drivers/net/wireless/ath/ath5k/debug.c
> +++ b/drivers/net/wireless/ath/ath5k/debug.c
> @@ -982,8 +982,6 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
>   	ah->debug.level = ath5k_debug;
>   
>   	phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
> -	if (!phydir)
> -		return;
>   
>   	debugfs_create_file("debug", 0600, phydir, ah, &fops_debug);
>   	debugfs_create_file("registers", 0400, phydir, ah, &registers_fops);

-- 
js
suse labs
Re: [PATCH v3] drivers: wireless: ath5k: remove parameter check in ath5k_debug_init_device(struct ath5k_hw *ah)
Posted by Jiri Slaby 2 years, 7 months ago
On 13. 07. 23, 9:46, Minjie Du wrote:
> debugfs_create_file() will return early if phydir is an error
> pointer, so an extra error check is not needed.
> 
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> ---

And also: this is a v3 without a changelog.

>   drivers/net/wireless/ath/ath5k/debug.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
> index 4b41160e5..ec130510a 100644
> --- a/drivers/net/wireless/ath/ath5k/debug.c
> +++ b/drivers/net/wireless/ath/ath5k/debug.c
> @@ -982,8 +982,6 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
>   	ah->debug.level = ath5k_debug;
>   
>   	phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
> -	if (!phydir)
> -		return;
>   
>   	debugfs_create_file("debug", 0600, phydir, ah, &fops_debug);
>   	debugfs_create_file("registers", 0400, phydir, ah, &registers_fops);

-- 
js
suse labs