[PATCH 3/3] wifi: ath10k: simplify ath10k_pci_pm_suspend()

2023-08-22 Thread Dmitry Antipov
Since 'ath10k_pci_suspend()' always returns 0, it may be converted to 'void' and 'ath10k_pci_pm_suspend()' may be simplified accordingly. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- drivers/net/

[PATCH 1/3] wifi: ath10k: cleanup CE initialization

2023-08-22 Thread Dmitry Antipov
7; and related code may be simplified as well. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- drivers/net/wireless/ath/ath10k/ahb.c | 6 +--- drivers/net/wireless/ath/ath10k/ce.c | 44 +++--- drivers/net/wireless/ath

[PATCH 2/3] wifi: ath10k: simplify ath10k_peer_assoc_h_vht()

2023-08-22 Thread Dmitry Antipov
Commit 3db24065c2c8 ("ath10k: enable VHT160 and VHT80+80 modes") introduces 'get_160mhz_nss_from_maxrate()' which never returns 0, which means that 'ath10k_peer_assoc_h_vht()' may be simplified. Found by Linux Verification Center (linuxtesting.org) with SVACE.

[PATCH] [v2] wifi: ath10k: cleanup CE initialization

2023-08-23 Thread Dmitry Antipov
7; and related code may be simplified as well. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- v2: change 'ath10k_ce_alloc_rri()' to return -ENOMEM in case of 'dma_alloc_coherent()' failure and fix error handling in '

[PATCH 2/3] [v2] wifi: ath10k: simplify ath10k_peer_assoc_h_vht()

2023-08-23 Thread Dmitry Antipov
Commit 3db24065c2c8 ("ath10k: enable VHT160 and VHT80+80 modes") introduces 'get_160mhz_nss_from_maxrate()' which never returns 0, which means that 'ath10k_peer_assoc_h_vht()' may be simplified. Found by Linux Verification Center (linuxtesting.org) with SVACE.

[PATCH 3/3] [v2] wifi: ath10k: simplify ath10k_pci_pm_suspend()

2023-08-23 Thread Dmitry Antipov
Since 'ath10k_pci_suspend()' always returns 0, it may be converted to 'void' and 'ath10k_pci_pm_suspend()' may be simplified accordingly. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- v2: adjust to match series

[PATCH 4/6] [v3] wifi: ath10k: do not ignore possible dma_alloc_coherent() error

2023-08-23 Thread Dmitry Antipov
Change 'ath10k_ce_alloc_rri()' to return -ENOMEM in case of 'dma_alloc_coherent()' failure and fix error handling in 'ath10k_snoc_hif_power_up()'. Signed-off-by: Dmitry Antipov --- v3: split from the larger v2 patch --- drivers/net/wireless/ath/ath10k/ce.c | 6 ++

[PATCH 5/6] [v3] wifi: ath10k: simplify ath10k_peer_assoc_h_vht()

2023-08-23 Thread Dmitry Antipov
d-by: Jeff Johnson Signed-off-by: Dmitry Antipov --- v3: add Acked-by: otherwise unchanged v2: adjust to match series --- drivers/net/wireless/ath/ath10k/mac.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/w

[PATCH 2/6] [v3] wifi: ath10k: simplify ath10k_ce_init_pipe()

2023-08-23 Thread Dmitry Antipov
Convert 'ath10k_ce_init_pipe()' to return 'void' and thus simplify 'ath10k_pci_init_pipes()' and 'ath10k_snoc_init_pipes()'. Signed-off-by: Dmitry Antipov --- v3: split from the larger v2 patch --- drivers/net/wireless/ath/ath10k/ce.c | 6 ++ dri

[PATCH 1/6] [v3] wifi: ath10k: cleanup CE ring initialization

2023-08-23 Thread Dmitry Antipov
and 'ath10k_ce_init_pipe()' may be simplified accordingly. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov --- v3: split to smaller units per Jeff's suggestion v2: change 'ath10k_ce_alloc_rri()' to return -ENOM

[PATCH 6/6] [v3] wifi: ath10k: simplify ath10k_pci_pm_suspend()

2023-08-23 Thread Dmitry Antipov
Since 'ath10k_pci_suspend()' always returns 0, it may be converted to 'void' and 'ath10k_pci_pm_suspend()' may be simplified accordingly. Found by Linux Verification Center (linuxtesting.org) with SVACE. Acked-by: Jeff Johnson Signed-off-by: Dmitry Antipov -

[PATCH 3/6] [v3] wifi: ath10k: cleanup CE pipes initialization

2023-08-23 Thread Dmitry Antipov
Convert 'ath10k_pci_init_pipes()' and 'ath10k_snoc_init_pipes()' to 'void' and thus simplify 'ath10k_ahb_hif_power_up()', 'ath10k_pci_qca988x_chip_reset()' and 'ath10k_snoc_hif_power_up()'. Signed-off-by: Dmitry Antipov --- v3: split f

[PATCH] wifi: ath10k: fix clang-specific fortify warning

2023-08-29 Thread Dmitry Antipov
dress of the whole array and not the first member to 'memcpy()'. Signed-off-by: Dmitry Antipov --- drivers/net/wireless/ath/ath10k/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c

On status handling in ath10k_htt_rx_tx_compl_ind()

2023-09-13 Thread Dmitry Antipov
In 'ath10k_htt_rx_tx_compl_ind()', int status = MS(resp->data_tx_completion.flags, HTT_DATA_TX_STATUS); actually is int status = (((resp->data_tx_completion.flags) & 0x07) >> 0); which can't be equal to HTT_DATA_TX_STATUS_DOWNLOAD_FAIL (128) regardless of the 'data_tx_completion.flags' value.

[PATCH] wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL

2023-09-14 Thread Dmitry Antipov
According to Jeff, 'HTT_DATA_TX_STATUS_DOWNLOAD_FAIL' from 'enum htt_data_tx_status' is never actually used by the firmware code and so may be dropped, with the related adjustment to 'ath10k_htt_rx_tx_compl_ind()'. Suggested-by: Jeff Johnson Signed-off-by: D

[PATCH] wifi: ath10k: simplify SDIO async handling

2023-09-18 Thread Dmitry Antipov
structures. Compile tested only so TESTERS WANTED. Signed-off-by: Dmitry Antipov --- drivers/net/wireless/ath/ath10k/sdio.c | 104 ++--- drivers/net/wireless/ath/ath10k/sdio.h | 14 +--- 2 files changed, 25 insertions(+), 93 deletions(-) diff --git a/drivers/net/wireless/

[PATCH] wifi: ath10k: consistently use kstrtoX_from_user() functions

2023-09-20 Thread Dmitry Antipov
Use 'kstrtoul_from_user()', 'kstrtobool_from_user()' and 'kstrtoint_from_user()' where appropriate and thus avoid some code duplication. Signed-off-by: Dmitry Antipov --- Hopefully this doesn't violate "if it isn't broke, don't fix it&quo

[PATCH] [v2] wifi: ath10k: consistently use kstrtoX_from_user() functions

2023-09-20 Thread Dmitry Antipov
Use 'kstrtoul_from_user()', 'kstrtobool_from_user()' and 'kstrtoint_from_user()' where appropriate and thus avoid some code duplication. Signed-off-by: Dmitry Antipov --- v2: fix ath10k_warn() format specifier (kernel test robot) --- drivers/net/wirel

Re: [PATCH 1/6] [v3] wifi: ath10k: cleanup CE ring initialization

2023-09-21 Thread Dmitry Antipov
On 9/20/23 16:23, Kalle Valo wrote: I have on purpose avoided to use void functions in ath10k/ath11k/ath12k. The problem is that if some of the functions return void and some of the functions return int it's much harder to review the code. I realize that you're constantly overloaded with revi

[PATCH] wifi: ath10k: prefer stack-allocated __le32 variables

2023-10-27 Thread Dmitry Antipov
There isn't too much sense to 'kzalloc()' buffer for the only __le32 value which is going to be freed in the same function, so switch to stack-allocated one in 'ath10k_sdio_writesb32()' and 'ath10k_sdio_diag_read32()'. Compile tested only. Signed-off-by: Dmitry

Re: [PATCH] wifi: ath10k: prefer stack-allocated __le32 variables

2023-10-27 Thread Dmitry Antipov
On 10/27/23 12:08, Johannes Berg wrote: Actually, there is. Consider what's done with it. It seems I should say sorry for being overconfident with this :-(. Locals can't be used for scatterlists/DMA/etc., right? Dmitry ___ ath10k mailing list ath1

[PATCH] wifi: ath10k: simplify __ath10k_htt_tx_txq_recalc()

2023-11-02 Thread Dmitry Antipov
Since 'ieee80211_txq_get_depth()' allows NULL for 2nd and 3rd arguments, simplify '__ath10k_htt_tx_txq_recalc()' by dropping unused 'frame_cnt'. Compile tested only. Signed-off-by: Dmitry Antipov --- drivers/net/wireless/ath/ath10k/htt_tx.c | 3 +-- 1 file change

[PATCH] wifi: ath10k: perform buffer size check in ath10k_wow_convert_8023_to_80211()

2024-12-25 Thread Dmitry Antipov
that [2] makes no sense after [1]. I.e. check for possible buffer overflow should be performed prior to touching both 'pattern' and 'mask' buffers with 'memcpy()' in 'ath10k_wow_convert_8023_to_80211()'. Compile tested only. Found by Linux Verification Cen