Re: [PATCH 1/6] wifi: ath10k: use flexible array in struct wmi_host_mem_chunks

2023-12-18 Thread Gustavo A. R. Silva
6 patches applied to ath-next branch of ath.git, thanks. Awesome! :) Thanks -- Gustavo

Re: [PATCH 0/6] wifi: ath10k: use flexible arrays

2023-12-13 Thread Gustavo A. R. Silva
On 12/13/23 11:06, Jeff Johnson wrote: Clean up the last remaining zero-length and one-element arrays in ath10k to comply with: https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays With these cleanups done the ath10k-check script no longer reports any issues. T

Re: [PATCH 6/6] wifi: ath10k: remove duplicate memset() in 10.4 TDLS peer update

2023-12-13 Thread Gustavo A. R. Silva
y. [1] https://lore.kernel.org/linux-wireless/626ae2e7-66f8-423b-b17f-e75c1a6d2...@embeddedor.com/ Signed-off-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- drivers/net/wireless/ath/ath10k/wmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/wi

Re: [PATCH 5/6] wifi: ath10k: use flexible array in struct wmi_tdls_peer_capabilities

2023-12-13 Thread Gustavo A. R. Silva
[2] https://lore.kernel.org/linux-wireless/626ae2e7-66f8-423b-b17f-e75c1a6d2...@embeddedor.com/ [3] https://lore.kernel.org/linux-wireless/202308301529.AC90A9EF98@keescook/ Signed-off-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- drivers/net/wireless/ath/ath10k

Re: [PATCH 4/6] wifi: ath10k: remove unused template structs

2023-12-13 Thread Gustavo A. R. Silva
actually used, so just remove them. No functional changes, compile tested only. [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays Signed-off-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- drivers/net/wireless/ath/ath10k/wmi.h | 24

Re: [PATCH 3/6] wifi: ath10k: remove struct wmi_pdev_chanlist_update_event

2023-12-13 Thread Gustavo A. R. Silva
entire struct. Less code is always great. :) No functional changes, compile tested only. [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays Signed-off-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- drivers/net/wireless

Re: [PATCH 2/6] wifi: ath10k: use flexible arrays for WMI start scan TLVs

2023-12-13 Thread Gustavo A. R. Silva
tlvs[] array, just define the tlvs[] array where struct wmi_start_scan_tlvs is being used. No functional changes, compile tested only. [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays Signed-off-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva Thanks

Re: [PATCH 1/6] wifi: ath10k: use flexible array in struct wmi_host_mem_chunks

2023-12-13 Thread Gustavo A. R. Silva
, compile tested only. [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays [2] https://lore.kernel.org/linux-wireless/202308301529.AC90A9EF98@keescook/ Signed-off-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva Thanks! -- Gustavo --- drivers/net/wireless

Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record

2023-12-05 Thread Gustavo A. R. Silva
On 12/5/23 09:29, Kalle Valo wrote: Jeff Johnson writes: On 11/27/2023 8:23 AM, Gustavo A. R. Silva wrote: On 11/27/23 10:14, Jeff Johnson wrote: Transform the zero-length array in ath11k_htc_record into a proper flexible array via the DECLARE_FLEX_ARRAY() macro. This helps with

Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record

2023-11-27 Thread Gustavo A. R. Silva
On 11/27/23 10:14, Jeff Johnson wrote: Transform the zero-length array in ath11k_htc_record into a proper flexible array via the DECLARE_FLEX_ARRAY() macro. This helps with ongoing efforts to globally enable -Warray-bounds. Signed-off-by: Jeff Johnson --- drivers/net/wireless/ath/ath11k/ht

Re: [PATCH 2/4] wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record

2023-11-27 Thread Gustavo A. R. Silva
On 11/27/23 10:14, Jeff Johnson wrote: Transform the zero-length arrays in ath10k_htc_record into proper flexible arrays via the DECLARE_FLEX_ARRAY() macro. This helps with ongoing efforts to globally enable -Warray-bounds. Signed-off-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva

Re: [RFC - is this a bug?] wifi: ath10k: Asking for some light on this, please :)

2023-10-24 Thread Gustavo A. R. Silva
On 10/24/23 14:49, Johannes Berg wrote: On Tue, 2023-10-24 at 14:41 -0600, Gustavo A. R. Silva wrote: It seems we run into the same issue in the function below, even in the case this `memset()` is unnecessary (which it seems it's not): 8920 memset(skb->data, 0, siz

Re: [RFC - is this a bug?] wifi: ath10k: Asking for some light on this, please :)

2023-10-24 Thread Gustavo A. R. Silva
a63a70...@embeddedor.com/ On 10/24/23 13:50, Gustavo A. R. Silva wrote: Hi all, While working on tranforming one-element array `peer_chan_list` in `struct wmi_tdls_peer_capabilities` into a flex-array member 7187 struct wmi_tdls_peer_capabilities { ... 7199 struct wmi_channel peer_chan_list[1]

Re: [RFC - is this a bug?] wifi: ath10k: Asking for some light on this, please :)

2023-10-24 Thread Gustavo A. R. Silva
On 10/24/23 14:11, Johannes Berg wrote: On Tue, 2023-10-24 at 13:50 -0600, Gustavo A. R. Silva wrote: Hi all, While working on tranforming one-element array `peer_chan_list` in `struct wmi_tdls_peer_capabilities` into a flex-array member 7187 struct wmi_tdls_peer_capabilities { ... 7199

[RFC - is this a bug?] wifi: ath10k: Asking for some light on this, please :)

2023-10-24 Thread Gustavo A. R. Silva
Hi all, While working on tranforming one-element array `peer_chan_list` in `struct wmi_tdls_peer_capabilities` into a flex-array member 7187 struct wmi_tdls_peer_capabilities { ... 7199 struct wmi_channel peer_chan_list[1]; 7200 } __packed; the following line caught my attention: ./dri

Re: [PATCH] wifi: ath10k: Annotate struct ath10k_ce_ring with __counted_by

2023-09-15 Thread Gustavo A. R. Silva
...@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Thanks -- Gustavo --- drivers/net/wireless/ath/ath10k/ce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h index

[PATCH][next] ath10k: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper

2022-09-26 Thread Gustavo A. R. Silva
://github.com/KSPP/linux/issues/193 Link: https://github.com/KSPP/linux/issues/212 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/htt.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net

[PATCH][next] ath10k: Replace zero-length array with flexible-array member

2022-02-16 Thread Gustavo A. R. Silva
] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/swap.h | 2 +- 1 file

Re: [PATCH] wireless: remove unneeded break

2020-10-19 Thread Gustavo A. R. Silva
On 10/19/20 11:20, Joe Perches wrote: > On Mon, 2020-10-19 at 10:54 -0500, Gustavo A. R. Silva wrote: >> On 10/19/20 10:21, Joe Perches wrote: >>> On Mon, 2020-10-19 at 17:14 +0200, Christian Lamparter wrote: >>>> On 19/10/2020 17:05, t...@redhat.com wrote: >

Re: [PATCH] wireless: remove unneeded break

2020-10-19 Thread Gustavo A. R. Silva
On 10/19/20 10:21, Joe Perches wrote: > On Mon, 2020-10-19 at 17:14 +0200, Christian Lamparter wrote: >> On 19/10/2020 17:05, t...@redhat.com wrote: >>> From: Tom Rix >>> >>> A break is not needed if it is preceded by a return or goto >>> >>> Signed-off-by: Tom Rix >>> diff --git a/drivers/net

[PATCH][next] ath10k: Use fallthrough pseudo-keyword

2020-07-27 Thread Gustavo A. R. Silva
-through Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/core.c | 2 +- drivers/net/wireless/ath/ath10k/htt_rx.c | 2 +- drivers/net/wireless/ath/ath10k/htt_tx.c | 6 +++--- drivers/net/wireless/ath/ath10k/mac.c| 18 +- drivers/net/wireless/ath

[PATCH][next] ath10k: wmi: Use struct_size() helper in ath10k_wmi_alloc_skb()

2020-06-16 Thread Gustavo A. R. Silva
Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. Also, remove unnecessary variable _len_. This code was detected with the help of Coccinelle and, audited and fixed manually. Signed-off-by: Gustavo A. R. Silva --- drivers/net

Re: [PATCH net-next 1/2] ath10k: fix gcc-10 zero-length-bounds warnings

2020-05-09 Thread Gustavo A. R. Silva
Arnd, On Sat, May 09, 2020 at 02:06:32PM +0200, Arnd Bergmann wrote: > gcc-10 started warning about out-of-bounds access for zero-length > arrays: > > In file included from drivers/net/wireless/ath/ath10k/core.h:18, > from drivers/net/wireless/ath/ath10k/htt_rx.c:8: > drivers/net

Re: [PATCH] ath10k: Replace zero-length array with flexible-array

2020-05-06 Thread Gustavo A. R. Silva
Kalle, On 5/5/20 02:51, Kalle Valo wrote: > > Fails to apply, please rebase on top of ath.git master branch. > > error: patch failed: drivers/net/wireless/ath/ath10k/pci.h:182 > error: drivers/net/wireless/ath/ath10k/pci.h: patch does not apply > stg import: Diff does not apply cleanly > > Pat

[PATCH v2] ath10k: Replace zero-length array with flexible-array

2020-05-06 Thread Gustavo A. R. Silva
lso help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-of

[PATCH] ath10k: Replace zero-length array with flexible-array

2020-05-04 Thread Gustavo A. R. Silva
lso help to get completely rid of those sorts of issues. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-of

Re: [PATCH 04/15] ath10k: fix gcc-10 zero-length-bounds warnings

2020-05-04 Thread Gustavo A. R. Silva
On 5/4/20 06:54, Kalle Valo wrote: > "Gustavo A. R. Silva" writes: > >> Hi Arnd, >> >> On 4/30/20 16:30, Arnd Bergmann wrote: >>> gcc-10 started warning about out-of-bounds access for zero-length >>> arrays: >>> >&g

Re: [PATCH 04/15] ath10k: fix gcc-10 zero-length-bounds warnings

2020-04-30 Thread Gustavo A. R. Silva
Hi Arnd, On 4/30/20 16:30, Arnd Bergmann wrote: > gcc-10 started warning about out-of-bounds access for zero-length > arrays: > > In file included from drivers/net/wireless/ath/ath10k/core.h:18, > from drivers/net/wireless/ath/ath10k/htt_rx.c:8: > drivers/net/wireless/ath/ath10k/

[PATCH][next] ath: Replace zero-length array with flexible-array member

2020-02-24 Thread Gustavo A. R. Silva
lle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/ce.h | 2 +- drivers/net/wireless/ath/

[PATCH][next] ath10k: coredump: use struct_size() helper

2019-04-03 Thread Gustavo A. R. Silva
ize(ce_hdr, entries, CE_COUNT) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/coredump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/coredump.c b/drivers/

[PATCH][next] ath10k: Use struct_size() helper

2019-04-03 Thread Gustavo A. R. Silva
: struct_size(rx, mpdu_ranges, num_mpdu_ranges) This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/htt_rx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b

Re: -Wimplicit-fallthrough not working with ccache

2019-02-18 Thread Gustavo A. R. Silva
Hi Kalle, On 2/16/19 5:21 AM, Kalle Valo wrote: > (replying to an old thread but renaming it) > > Kalle Valo writes: > >> "Gustavo A. R. Silva" wrote: >> >>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases >>> where we a

Re: [PATCH] ath10k: htt_rx: Fix signedness bug in ath10k_update_per_peer_tx_stats

2018-10-13 Thread Gustavo A. R. Silva
On 10/13/18 7:23 PM, Kalle Valo wrote: > > Patch applied to ath-next branch of ath.git, thanks. > > 9d9cdbf3f9ed ath10k: htt_rx: fix signedness bug in > ath10k_update_per_peer_tx_stats > Thank you, Kalle. -- Gustavo ___ ath10k mailing list ath10k@

Re: [PATCH] ath10k: htt_rx: Fix signedness bug in ath10k_update_per_peer_tx_stats

2018-10-09 Thread Gustavo A. R. Silva
> > I have sent a patch to address this, > https://patchwork.kernel.org/patch/10611943/ > That's great. Thanks for letting me know. :) -- Gustavo ___ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k

Re: [PATCH] ath10k: htt_rx: Fix signedness bug in ath10k_update_per_peer_tx_stats

2018-10-05 Thread Gustavo A. R. Silva
On 10/5/18 9:14 PM, Gustavo A. R. Silva wrote: > > > On 10/5/18 9:09 PM, Ben Greear wrote: >> On 10/05/2018 11:42 AM, Gustavo A. R. Silva wrote: >>> Currently, the error handling for the call to function >>> ath10k_get_legacy_rate_idx() doesn't work b

Re: [PATCH] ath10k: htt_rx: Fix signedness bug in ath10k_update_per_peer_tx_stats

2018-10-05 Thread Gustavo A. R. Silva
On 10/5/18 9:09 PM, Ben Greear wrote: > On 10/05/2018 11:42 AM, Gustavo A. R. Silva wrote: >> Currently, the error handling for the call to function >> ath10k_get_legacy_rate_idx() doesn't work because >> *rate_idx* is of type u8 (8 bits, unsigned), which >> make

[PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0

2018-10-05 Thread Gustavo A. R. Silva
There is no need to compare *ps_state_enable* with < 0 because such variable is of type u8 (8 bits, unsigned), making it impossible to hold a negative value. Fix this by removing such comparison. Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0") Signed-off-by: Gustav

[PATCH] ath10k: htt_rx: Fix signedness bug in ath10k_update_per_peer_tx_stats

2018-10-05 Thread Gustavo A. R. Silva
igned). Addresses-Coverity-ID: 1473914 ("Unsigned compared against 0") Fixes: 0189dbd71cbd ("ath10k: get the legacy rate index to update the txrate table") Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/htt_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH] ath10k: use struct_size() in kzalloc()

2018-08-23 Thread Gustavo A. R. Silva
: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/ce.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 18c709c..d0381aa 100644 --- a/drivers/net/wireless/ath

[PATCH] ath10k: htt_tx: mark expected switch fall-throughs

2018-05-24 Thread Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that in this particular case, I replaced "pass through" with a proper "fall through" comment, which is what GCC is expecting to find. Signed-off-by:

[PATCH v2] ath10k: remove unnecessary code

2017-05-09 Thread Gustavo A. R. Silva
The array fields in struct wmi_start_scan_arg that are checked here are fixed size arrays so they can never be NULL. Addresses-Coverity-ID: 1260031 Cc: Arend Van Spriel Cc: Kalle Valo Signed-off-by: Gustavo A. R. Silva --- Changes in v2: Rephrase commit log. drivers/net/wireless/ath/ath10k

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

2017-05-09 Thread Gustavo A. R. Silva
Hi Arend, Quoting Arend Van Spriel : On 9-5-2017 7:33, Kalle Valo wrote: "Gustavo A. R. Silva" 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.

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

2017-05-09 Thread Gustavo A. R. Silva
Hi Kalle, Quoting Kalle Valo : "Gustavo A. R. Silva" 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 I d

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

2017-05-08 Thread 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 --- drivers/net/wireless/ath/ath10k/wmi.c | 9 - 1 file changed, 9 dele