From: Aaradhana Sahu Date: Thu, 3 Apr 2025 08:22:07 +0000 (+0530) Subject: wifi: ath12k: Introduce check against zero for ahvif->key_cipher in ath12k_mac_op_tx() X-Git-Tag: v6.16-rc1~132^2~157^2~16^2~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f4b067dd61695e860f97cae6ed6589a3a7dfba3;p=thirdparty%2Fkernel%2Flinux.git wifi: ath12k: Introduce check against zero for ahvif->key_cipher in ath12k_mac_op_tx() 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 Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20250403082207.3323938-3-aaradhana.sahu@oss.qualcomm.com Signed-off-by: Jeff Johnson --- diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 1bc8e81ad525d..af89e1a2d0235 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -7502,7 +7502,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);