netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: wireless: ath: ath10k: remove unnecessary code
@ 2017-05-09  4:21 Gustavo A. R. Silva
  2017-05-09  5:33 ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-09  4:21 UTC (permalink / raw)
  To: Kalle Valo
  Cc: ath10k, linux-wireless, netdev, linux-kernel, 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.

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code
  2017-05-09  4:21 [PATCH] net: wireless: ath: ath10k: remove unnecessary code Gustavo A. R. Silva
@ 2017-05-09  5:33 ` Kalle Valo
       [not found]   ` <87lgq6387s.fsf-HodKDYzPHsUD5k0oWYwrnHL1okKdlPRT@public.gmane.org>
  2017-05-09 12:07   ` Arend Van Spriel
  0 siblings, 2 replies; 6+ messages in thread
From: Kalle Valo @ 2017-05-09  5:33 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, ath10k@lists.infradead.org

"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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code
       [not found]   ` <87lgq6387s.fsf-HodKDYzPHsUD5k0oWYwrnHL1okKdlPRT@public.gmane.org>
@ 2017-05-09 12:00     ` Gustavo A. R. Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-09 12:00 UTC (permalink / raw)
  To: Kalle Valo
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi Kalle,

Quoting Kalle Valo <kvalo-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>:

> "Gustavo A. R. Silva" <garsilva-L1vi/lXTdts+Va1GwOuvDg@public.gmane.org> 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-L1vi/lXTdts+Va1GwOuvDg@public.gmane.org>
>
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code
  2017-05-09  5:33 ` Kalle Valo
       [not found]   ` <87lgq6387s.fsf-HodKDYzPHsUD5k0oWYwrnHL1okKdlPRT@public.gmane.org>
@ 2017-05-09 12:07   ` Arend Van Spriel
  2017-05-09 12:20     ` Kalle Valo
  2017-05-09 12:34     ` Gustavo A. R. Silva
  1 sibling, 2 replies; 6+ messages in thread
From: Arend Van Spriel @ 2017-05-09 12:07 UTC (permalink / raw)
  To: Kalle Valo, Gustavo A. R. Silva
  Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, ath10k@lists.infradead.org

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code
  2017-05-09 12:07   ` Arend Van Spriel
@ 2017-05-09 12:20     ` Kalle Valo
  2017-05-09 12:34     ` Gustavo A. R. Silva
  1 sibling, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2017-05-09 12:20 UTC (permalink / raw)
  To: Arend Van Spriel
  Cc: Gustavo A. R. Silva, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	ath10k@lists.infradead.org

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] net: wireless: ath: ath10k: remove unnecessary code
  2017-05-09 12:07   ` Arend Van Spriel
  2017-05-09 12:20     ` Kalle Valo
@ 2017-05-09 12:34     ` Gustavo A. R. Silva
  1 sibling, 0 replies; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-09 12:34 UTC (permalink / raw)
  To: Arend Van Spriel; +Cc: netdev, Kalle Valo, linux-wireless, linux-kernel, ath10k

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-09 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-09  4:21 [PATCH] net: wireless: ath: ath10k: remove unnecessary code Gustavo A. R. Silva
2017-05-09  5:33 ` Kalle Valo
     [not found]   ` <87lgq6387s.fsf-HodKDYzPHsUD5k0oWYwrnHL1okKdlPRT@public.gmane.org>
2017-05-09 12:00     ` Gustavo A. R. Silva
2017-05-09 12:07   ` Arend Van Spriel
2017-05-09 12:20     ` Kalle Valo
2017-05-09 12:34     ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).