Skip to contentSkip to conversation

ath10k: remove an unnecessary NULL check

PATCH In review Dan Carpenter 2 participants 6 messages Nov 29, 2018 – Dec 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: remove an unnecessary NULL check

The "survey" pointer is the address of an array element. We know that it can't be NULL so this check can be removed.

---
 drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi.c +1 -1
index 659513bf4ddc..6a04727b63ce 100644
@@ -2578,7 +2578,7 @@ static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar,
 
 	survey = &ar->survey[idx];
 
-	if (!params->mac_clk_mhz || !survey)
+	if (!params->mac_clk_mhz)
 		return;
 
 	memset(survey, 0, sizeof(*survey));
Signature · 1 line
2.11.0
#1 lore raw
Quoted 13 lines · Dan Carpenter

The "survey" pointer is the address of an array element. We know that it can't be NULL so this check can be removed.

---
 drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi.c +0 -0
index 659513bf4ddc..6a04727b63ce 100644

drivers/net/wireless/ath/ath10k/wmi.c static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar, · line 2582

Quoted 6 lines
drivers/net/wireless/ath/ath10k/wmi.c +1 -1
@@ -2578,7 +2578,7 @@ static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar,
 
 	survey = &ar->survey[idx];
 
-	if (!params->mac_clk_mhz || !survey)
+	if (!params->mac_clk_mhz)
 		return;

Can you please CC linux-wireless so that patchwork sees this?

Signature · 1 line
Kalle Valo
#2 lore raw
Quoted 16 lines · Kalle Valo
Quoted 14 lines · Dan Carpenter

The "survey" pointer is the address of an array element. We know that it can't be NULL so this check can be removed.

---
 drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi.c +0 -0
index 659513bf4ddc..6a04727b63ce 100644
@@ -2578,7 +2578,7 @@ static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar,
 
Quoted 8 lines

drivers/net/wireless/ath/ath10k/wmi.c static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar, · line 2582

Quoted 5 lines
drivers/net/wireless/ath/ath10k/wmi.c +1 -1
 	survey = &ar->survey[idx];
 
-	if (!params->mac_clk_mhz || !survey)
+	if (!params->mac_clk_mhz)
 		return;

Can you please CC linux-wireless so that patchwork sees this?

Sure. I can resend.

regards,
dan carpenter

#3 lore raw

PATCH 1/1 ath10k: remove an unnecessary NULL check

In reply to Dan Carpenter

The "survey" pointer is the address of an array element. We know that it can't be NULL so this check can be removed.

---
Resending with linux-wireless Cc for patchwork.

 drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi.c +1 -1
index 659513bf4ddc..6a04727b63ce 100644
@@ -2578,7 +2578,7 @@ static void ath10k_wmi_event_chan_info_unpaired(struct ath10k *ar,
 
 	survey = &ar->survey[idx];
 
-	if (!params->mac_clk_mhz || !survey)
+	if (!params->mac_clk_mhz)
 		return;
 
 	memset(survey, 0, sizeof(*survey));
Signature · 1 line
2.11.0
#4 lore raw
Quoted 5 lines · Dan Carpenter

The "survey" pointer is the address of an array element. We know that it can't be NULL so this check can be removed.

Patch applied to ath-next branch of ath.git, thanks.

27120f2ac995 ath10k: remove an unnecessary NULL check

Signature · 3 lines
https://patchwork.kernel.org/patch/10704625/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#5 lore raw
In reply to Dan Carpenter
Quoted 5 lines · Dan Carpenter

The "survey" pointer is the address of an array element. We know that it can't be NULL so this check can be removed.

Patch applied to ath-next branch of ath.git, thanks.

27120f2ac995 ath10k: remove an unnecessary NULL check

Signature · 9 lines
https://patchwork.kernel.org/patch/10704625/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k