* [PATCH v2] drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device()
@ 2023-07-13 3:36 Minjie Du
2023-07-13 5:14 ` Jiri Slaby
2023-07-13 5:58 ` Jiri Slaby
0 siblings, 2 replies; 3+ messages in thread
From: Minjie Du @ 2023-07-13 3:36 UTC (permalink / raw)
To: Jiri Slaby, Nick Kossifidis, Luis Chamberlain, Kalle Valo,
open list:ATHEROS ATH5K WIRELESS DRIVER, open list
Cc: opensource.kernel, Minjie Du
Make IS_ERR_OR_NULL() judge the debugfs_create_dir() function return
in ath5k_debug_init_device().
Signed-off-by: Minjie Du <duminjie@vivo.com>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
---
v1-v2:
use IS_ERR_OR_NULL() instead of IS_ERR()
---
drivers/net/wireless/ath/ath5k/debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 4b41160e5..7c8823759 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -982,7 +982,7 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
ah->debug.level = ath5k_debug;
phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
- if (!phydir)
+ if (IS_ERR_OR_NULL(phydir))
return;
debugfs_create_file("debug", 0600, phydir, ah, &fops_debug);
--
2.39.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device()
2023-07-13 3:36 [PATCH v2] drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device() Minjie Du
@ 2023-07-13 5:14 ` Jiri Slaby
2023-07-13 5:58 ` Jiri Slaby
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2023-07-13 5:14 UTC (permalink / raw)
To: Minjie Du, Nick Kossifidis, Luis Chamberlain, Kalle Valo,
open list:ATHEROS ATH5K WIRELESS DRIVER, open list
Cc: opensource.kernel
On 13. 07. 23, 5:36, Minjie Du wrote:
> Make IS_ERR_OR_NULL() judge the debugfs_create_dir() function return
> in ath5k_debug_init_device().
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> Acked-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
> v1-v2:
> use IS_ERR_OR_NULL() instead of IS_ERR()
> ---
> drivers/net/wireless/ath/ath5k/debug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
> index 4b41160e5..7c8823759 100644
> --- a/drivers/net/wireless/ath/ath5k/debug.c
> +++ b/drivers/net/wireless/ath/ath5k/debug.c
> @@ -982,7 +982,7 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
> ah->debug.level = ath5k_debug;
>
> phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
> - if (!phydir)
> + if (IS_ERR_OR_NULL(phydir))
When can debugfs_create_dir() return NULL?
> return;
>
> debugfs_create_file("debug", 0600, phydir, ah, &fops_debug);
--
js
suse labs
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device()
2023-07-13 3:36 [PATCH v2] drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device() Minjie Du
2023-07-13 5:14 ` Jiri Slaby
@ 2023-07-13 5:58 ` Jiri Slaby
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2023-07-13 5:58 UTC (permalink / raw)
To: Minjie Du, Nick Kossifidis, Luis Chamberlain, Kalle Valo,
open list:ATHEROS ATH5K WIRELESS DRIVER, open list
Cc: opensource.kernel
On 13. 07. 23, 5:36, Minjie Du wrote:
> Make IS_ERR_OR_NULL() judge the debugfs_create_dir() function return
> in ath5k_debug_init_device().
>
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> Acked-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
> v1-v2:
> use IS_ERR_OR_NULL() instead of IS_ERR()
> ---
> drivers/net/wireless/ath/ath5k/debug.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
> index 4b41160e5..7c8823759 100644
> --- a/drivers/net/wireless/ath/ath5k/debug.c
> +++ b/drivers/net/wireless/ath/ath5k/debug.c
> @@ -982,7 +982,7 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
> ah->debug.level = ath5k_debug;
>
> phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
> - if (!phydir)
> + if (IS_ERR_OR_NULL(phydir))
> return;
And actually, in this case, remove the check completely (as per docs).
thanks,
--
js
suse labs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-13 5:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-13 3:36 [PATCH v2] drivers: wireless: ath5k: fix parameter check in ath5k_debug_init_device() Minjie Du
2023-07-13 5:14 ` Jiri Slaby
2023-07-13 5:58 ` Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®