diff options
author | Jeff Johnson <quic_jjohnson@quicinc.com> | 2023-10-09 09:39:42 -0700 |
---|---|---|
committer | Kalle Valo <quic_kvalo@quicinc.com> | 2023-10-12 19:08:22 +0300 |
commit | 10c65f97b424fcee439463f933140df2a0022f98 (patch) | |
tree | cb0fd0bb42695ca33acd13c99343f7ef8c0aaf4e /drivers/net/wireless/ath/ath11k/core.h | |
parent | wifi: ath11k: Remove unused struct ath11k_htc_frame (diff) | |
download | linux-10c65f97b424fcee439463f933140df2a0022f98.tar.xz linux-10c65f97b424fcee439463f933140df2a0022f98.zip |
wifi: ath11k: Introduce and use ath11k_sta_to_arsta()
Currently, the logic to return an ath11k_sta pointer, given a
ieee80211_sta pointer, uses typecasting throughout the driver. In
general, conversion functions are preferable to typecasting since
using a conversion function allows the compiler to validate the types
of both the input and output parameters.
ath11k already defines a conversion function ath11k_vif_to_arvif() for
a similar conversion. So introduce ath11k_sta_to_arsta() for this use
case, and convert all of the existing typecasting to use this
function.
No functional changes, compile tested only.
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20231009-ath11k_sta_to_arsta-v1-1-1563e3a307e8@quicinc.com
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/core.h')
-rw-r--r-- | drivers/net/wireless/ath/ath11k/core.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h index 650972f9d146..489c863215a4 100644 --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h @@ -1223,6 +1223,11 @@ static inline struct ath11k_vif *ath11k_vif_to_arvif(struct ieee80211_vif *vif) return (struct ath11k_vif *)vif->drv_priv; } +static inline struct ath11k_sta *ath11k_sta_to_arsta(struct ieee80211_sta *sta) +{ + return (struct ath11k_sta *)sta->drv_priv; +} + static inline struct ath11k *ath11k_ab_to_ar(struct ath11k_base *ab, int mac_id) { |