Skip to contentSkip to conversation

drivers: wireless: ath5k: remove parameter check in ath5k_debug_init_device(struct ath5k_hw *ah)

PATCH In review Minjie Du 2 participants 3 messages Jul 13, 2023 Atheros ATH5K wireless driver

lore
Share & tools
lore

Minjie Du

author
#0 lore raw

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

debugfs_create_file() will return early if phydir is an error pointer, so an extra error check is not needed.

---
 drivers/net/wireless/ath/ath5k/debug.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/wireless/ath/ath5k/debug.c +0 -2
index 4b41160e5..ec130510a 100644
@@ -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);
Signature · 1 line
2.39.0
maintainer
#1 lore raw

The subject should be:
wifi: ath5k: remove parameter check in ath5k_debug_init_device()

I believe this is documented in SubmittingPatches.

Quoted 2 lines · Minjie Du

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.

Quoted 18 lines
---
  drivers/net/wireless/ath/ath5k/debug.c | 2 --
  1 file changed, 2 deletions(-)
drivers/net/wireless/ath/ath5k/debug.c +0 -2
index 4b41160e5..ec130510a 100644
@@ -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);
Signature · 2 lines
js
suse labs
maintainer
#2 lore raw
In reply to Minjie Du
Quoted 5 lines · Minjie Du

debugfs_create_file() will return early if phydir is an error pointer, so an extra error check is not needed.

---

And also: this is a v3 without a changelog.

Quoted 16 lines
  drivers/net/wireless/ath/ath5k/debug.c | 2 --
  1 file changed, 2 deletions(-)
drivers/net/wireless/ath/ath5k/debug.c +0 -2
index 4b41160e5..ec130510a 100644
@@ -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);
Signature · 2 lines
js
suse labs