Skip to contentSkip to conversation

net: wireless: ath: ath10k: remove unnecessary code

PATCH In review Gustavo A. R. Silva 3 participants 6 messages May 9, 2017

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

PATCH 1/1 net: wireless: ath: ath10k: remove unnecessary code

The name of an array used by itself will always return the array's address. So these tests will always evaluate as false and therefore the _return_ will never be executed.

---
 drivers/net/wireless/ath/ath10k/wmi.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/net/wireless/ath/ath10k/wmi.c +0 -9
index 2f1743e..135cf83 100644
@@ -5933,15 +5933,6 @@ static struct sk_buff *ath10k_wmi_10_4_op_gen_init(struct ath10k *ar)
 
 int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg)
 {
-	if (arg->ie_len && !arg->ie)
-		return -EINVAL;
-	if (arg->n_channels && !arg->channels)
-		return -EINVAL;
-	if (arg->n_ssids && !arg->ssids)
-		return -EINVAL;
-	if (arg->n_bssids && !arg->bssids)
-		return -EINVAL;
-
 	if (arg->ie_len > WLAN_SCAN_PARAMS_MAX_IE_LEN)
 		return -EINVAL;
 	if (arg->n_channels > ARRAY_SIZE(arg->channels))
Signature · 1 line
2.5.0
#1 lore raw
Quoted 5 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So these tests will always evaluate as false and therefore the _return_ will never be executed.

I don't understand the commit log, especially what does "The name of an array used by itself" mean?

Signature · 1 line
Kalle Valo
#2 lore raw

Hi Kalle,

Quoting Kalle Valo <[email protected]>:

Quoted 11 lines
Quoted 5 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So these tests will always evaluate as false and therefore the _return_ will never be executed.

I don't understand the commit log, especially what does "The name of an array used by itself" mean?

Let me correct that and I'll send the patch again.

Thanks!
--
Gustavo A. R. Silva

#3 lore raw
In reply to Kalle Valo
Quoted 10 lines · Kalle Valo
Quoted 5 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So these tests will always evaluate as false and therefore the _return_ will never be executed.

I don't understand the commit log, especially what does "The name of an array used by itself" mean?

The array fields in struct wmi_start_scan_arg that are checked here are fixed size arrays so they can never be NULL.

Maybe that helps rephrasing this commit message.

Regards,
Arend

#4 lore raw
Quoted 9 lines · Arend Van Spriel
Quoted 8 lines · Kalle Valo
Quoted 5 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So these tests will always evaluate as false and therefore the _return_ will never be executed.

Quoted 7 lines
Quoted 2 lines

I don't understand the commit log, especially what does "The name of an array used by itself" mean?

The array fields in struct wmi_start_scan_arg that are checked here are fixed size arrays so they can never be NULL.

Maybe that helps rephrasing this commit message.

Much much better, thanks!

Signature · 1 line
Kalle Valo
#5 lore raw
In reply to Arend Van Spriel

Hi Arend,

Quoting Arend Van Spriel <[email protected]>:

Quoted 9 lines · Kalle Valo
Quoted 8 lines
Quoted 5 lines · Gustavo A. R. Silva

The name of an array used by itself will always return the array's address. So these tests will always evaluate as false and therefore the _return_ will never be executed.

Quoted 8 lines
Quoted 2 lines

I don't understand the commit log, especially what does "The name of an array used by itself" mean?

The array fields in struct wmi_start_scan_arg that are checked here are fixed size arrays so they can never be NULL.

Maybe that helps rephrasing this commit message.

Definitely. Thank you!
--
Gustavo A. R. Silva