Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1637859 > unrolled thread

[PATCH] net: wireless: ath: ath10k: remove unnecessary code

Started by"Gustavo A. R. Silva" <garsilva@embeddedor.com>
First post2017-05-09 06:30 +0200
Last post2017-05-09 14:30 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: wireless: ath: ath10k: remove unnecessary code "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-05-09 06:30 +0200
    Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code Kalle Valo <kvalo@qca.qualcomm.com> - 2017-05-09 07:40 +0200
      Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-05-09 14:10 +0200
        Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code Kalle Valo <kvalo@qca.qualcomm.com> - 2017-05-09 14:30 +0200
        Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-05-09 15:00 +0200
      Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-05-09 14:30 +0200

#1637859 — [PATCH] net: wireless: ath: ath10k: remove unnecessary code

From"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Date2017-05-09 06:30 +0200
Subject[PATCH] net: wireless: ath: ath10k: remove unnecessary code
Message-ID<tF4WB-54x-5@gated-at.bofh.it>
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.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 2f1743e..135cf83 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -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))
-- 
2.5.0

[toc] | [next] | [standalone]


#1637871

FromKalle Valo <kvalo@qca.qualcomm.com>
Date2017-05-09 07:40 +0200
Message-ID<tF62m-5K4-15@gated-at.bofh.it>
In reply to#1637859
"Gustavo A. R. Silva" <garsilva@embeddedor.com> writes:

> 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.
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

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

-- 
Kalle Valo

[toc] | [prev] | [next] | [standalone]


#1638072

FromArend Van Spriel <arend.vanspriel@broadcom.com>
Date2017-05-09 14:10 +0200
Message-ID<tFc7M-1x6-21@gated-at.bofh.it>
In reply to#1637871
On 9-5-2017 7:33, Kalle Valo wrote:
> "Gustavo A. R. Silva" <garsilva@embeddedor.com> writes:
> 
>> 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.
>>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> 
> 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

[toc] | [prev] | [next] | [standalone]


#1638083

FromKalle Valo <kvalo@qca.qualcomm.com>
Date2017-05-09 14:30 +0200
Message-ID<tFcr7-1Fu-7@gated-at.bofh.it>
In reply to#1638072
Arend Van Spriel <arend.vanspriel@broadcom.com> writes:

> On 9-5-2017 7:33, Kalle Valo wrote:
>> "Gustavo A. R. Silva" <garsilva@embeddedor.com> writes:
>> 
>>> 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.
>>>
>>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>> 
>> 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!

-- 
Kalle Valo

[toc] | [prev] | [next] | [standalone]


#1638109

From"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Date2017-05-09 15:00 +0200
Message-ID<tFcUa-1PU-9@gated-at.bofh.it>
In reply to#1638072
Hi Arend,

Quoting Arend Van Spriel <arend.vanspriel@broadcom.com>:

> On 9-5-2017 7:33, Kalle Valo wrote:
>> "Gustavo A. R. Silva" <garsilva@embeddedor.com> writes:
>>
>>> 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.
>>>
>>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>>
>> 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

[toc] | [prev] | [next] | [standalone]


#1638089

From"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Date2017-05-09 14:30 +0200
Message-ID<tFcr8-1Fu-29@gated-at.bofh.it>
In reply to#1637871
Hi Kalle,

Quoting Kalle Valo <kvalo@qca.qualcomm.com>:

> "Gustavo A. R. Silva" <garsilva@embeddedor.com> writes:
>
>> 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.
>>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>
> 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web