diff mbox series

[ath-next,2/2] wifi: ath12k: Introduce check against zero for ahvif->key_cipher in ath12k_mac_op_tx()

Message ID 20250403082207.3323938-3-aaradhana.sahu@oss.qualcomm.com
State New
Headers show
Series wifi: ath12k: Handle of key_cipher in MLD AP | expand

Commit Message

Aaradhana Sahu April 3, 2025, 8:22 a.m. UTC
Currently, ahvif->key_cipher is compared with the enum value
(WMI_CIPHER_NONE) inside ath12k_mac_op_tx(). However, ahvif->key_cipher is
set using the macro value WLAN_CIPHER_SUITE_XXXX which seems inconsistent.

To improve code consistency and readability, introduce check against zero
for ahvif->key_cipher instead of comparing it with the enum
(WMI_CIPHER_NONE).

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00209-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vasanthakumar Thiagarajan April 9, 2025, 7:28 a.m. UTC | #1
On 4/3/2025 1:52 PM, Aaradhana Sahu wrote:
> Currently, ahvif->key_cipher is compared with the enum value
> (WMI_CIPHER_NONE) inside ath12k_mac_op_tx(). However, ahvif->key_cipher is
> set using the macro value WLAN_CIPHER_SUITE_XXXX which seems inconsistent.
> 
> To improve code consistency and readability, introduce check against zero
> for ahvif->key_cipher instead of comparing it with the enum
> (WMI_CIPHER_NONE).
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00209-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 0036178cf999..628504ac05f2 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -7493,7 +7493,7 @@  static void ath12k_mac_op_tx(struct ieee80211_hw *hw,
 			skb_cb->link_id = link_id;
 
 			/* For open mode, skip peer find logic */
-			if (unlikely(ahvif->key_cipher == WMI_CIPHER_NONE))
+			if (unlikely(!ahvif->key_cipher))
 				goto skip_peer_find;
 
 			spin_lock_bh(&tmp_ar->ab->base_lock);