generic: replace simple AQR hack patch with upstream version
[openwrt/staging/jow.git] / package / kernel / mac80211 / patches / ath11k / 0022-wifi-ath11k-remove-unnecessary-void-conversions.patch
1 From 87fd0602610d6965c45afc61780ac98842e8f902 Mon Sep 17 00:00:00 2001
2 From: Wu Yunchuan <yunchuan@nfschina.com>
3 Date: Thu, 21 Sep 2023 11:50:05 +0300
4 Subject: [PATCH] wifi: ath11k: remove unnecessary (void*) conversions
5
6 No need cast (void *) to (struct ath11k_base *),
7 struct hal_rx_msdu_link *), (struct ath11k_buffer_addr *) or
8 other types.
9
10 Signed-off-by: Wu Yunchuan <yunchuan@nfschina.com>
11 Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
12 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
13 Link: https://lore.kernel.org/r/20230919045150.524304-1-yunchuan@nfschina.com
14 ---
15 drivers/net/wireless/ath/ath11k/dp.c | 2 +-
16 drivers/net/wireless/ath/ath11k/dp_rx.c | 13 +++++--------
17 drivers/net/wireless/ath/ath11k/hal.c | 8 +++-----
18 drivers/net/wireless/ath/ath11k/hal_rx.c | 17 +++++++----------
19 drivers/net/wireless/ath/ath11k/hal_tx.c | 2 +-
20 drivers/net/wireless/ath/ath11k/mac.c | 4 ++--
21 drivers/net/wireless/ath/ath11k/spectral.c | 2 +-
22 drivers/net/wireless/ath/ath11k/wmi.c | 6 +++---
23 8 files changed, 23 insertions(+), 31 deletions(-)
24
25 --- a/drivers/net/wireless/ath/ath11k/dp.c
26 +++ b/drivers/net/wireless/ath/ath11k/dp.c
27 @@ -1009,7 +1009,7 @@ void ath11k_dp_vdev_tx_attach(struct ath
28
29 static int ath11k_dp_tx_pending_cleanup(int buf_id, void *skb, void *ctx)
30 {
31 - struct ath11k_base *ab = (struct ath11k_base *)ctx;
32 + struct ath11k_base *ab = ctx;
33 struct sk_buff *msdu = skb;
34
35 dma_unmap_single(ab->dev, ATH11K_SKB_CB(msdu)->paddr, msdu->len,
36 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c
37 +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
38 @@ -1256,7 +1256,7 @@ static int ath11k_htt_tlv_ppdu_stats_par
39 int cur_user;
40 u16 peer_id;
41
42 - ppdu_info = (struct htt_ppdu_stats_info *)data;
43 + ppdu_info = data;
44
45 switch (tag) {
46 case HTT_PPDU_STATS_TAG_COMMON:
47 @@ -4486,8 +4486,7 @@ int ath11k_dp_rx_monitor_link_desc_retur
48 src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng);
49
50 if (src_srng_desc) {
51 - struct ath11k_buffer_addr *src_desc =
52 - (struct ath11k_buffer_addr *)src_srng_desc;
53 + struct ath11k_buffer_addr *src_desc = src_srng_desc;
54
55 *src_desc = *((struct ath11k_buffer_addr *)p_last_buf_addr_info);
56 } else {
57 @@ -4506,8 +4505,7 @@ void ath11k_dp_rx_mon_next_link_desc_get
58 u8 *rbm,
59 void **pp_buf_addr_info)
60 {
61 - struct hal_rx_msdu_link *msdu_link =
62 - (struct hal_rx_msdu_link *)rx_msdu_link_desc;
63 + struct hal_rx_msdu_link *msdu_link = rx_msdu_link_desc;
64 struct ath11k_buffer_addr *buf_addr_info;
65
66 buf_addr_info = (struct ath11k_buffer_addr *)&msdu_link->buf_addr_info;
67 @@ -4548,7 +4546,7 @@ static void ath11k_hal_rx_msdu_list_get(
68 u32 first = FIELD_PREP(RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU, 1);
69 u8 tmp = 0;
70
71 - msdu_link = (struct hal_rx_msdu_link *)msdu_link_desc;
72 + msdu_link = msdu_link_desc;
73 msdu_details = &msdu_link->msdu_link[0];
74
75 for (i = 0; i < HAL_RX_NUM_MSDU_DESC; i++) {
76 @@ -4645,8 +4643,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k
77 bool is_frag, is_first_msdu;
78 bool drop_mpdu = false;
79 struct ath11k_skb_rxcb *rxcb;
80 - struct hal_reo_entrance_ring *ent_desc =
81 - (struct hal_reo_entrance_ring *)ring_entry;
82 + struct hal_reo_entrance_ring *ent_desc = ring_entry;
83 int buf_id;
84 u32 rx_link_buf_info[2];
85 u8 rbm;
86 --- a/drivers/net/wireless/ath/ath11k/hal.c
87 +++ b/drivers/net/wireless/ath/ath11k/hal.c
88 @@ -571,7 +571,7 @@ u32 ath11k_hal_ce_get_desc_size(enum hal
89 void ath11k_hal_ce_src_set_desc(void *buf, dma_addr_t paddr, u32 len, u32 id,
90 u8 byte_swap_data)
91 {
92 - struct hal_ce_srng_src_desc *desc = (struct hal_ce_srng_src_desc *)buf;
93 + struct hal_ce_srng_src_desc *desc = buf;
94
95 desc->buffer_addr_low = paddr & HAL_ADDR_LSB_REG_MASK;
96 desc->buffer_addr_info =
97 @@ -586,8 +586,7 @@ void ath11k_hal_ce_src_set_desc(void *bu
98
99 void ath11k_hal_ce_dst_set_desc(void *buf, dma_addr_t paddr)
100 {
101 - struct hal_ce_srng_dest_desc *desc =
102 - (struct hal_ce_srng_dest_desc *)buf;
103 + struct hal_ce_srng_dest_desc *desc = buf;
104
105 desc->buffer_addr_low = paddr & HAL_ADDR_LSB_REG_MASK;
106 desc->buffer_addr_info =
107 @@ -597,8 +596,7 @@ void ath11k_hal_ce_dst_set_desc(void *bu
108
109 u32 ath11k_hal_ce_dst_status_get_length(void *buf)
110 {
111 - struct hal_ce_srng_dst_status_desc *desc =
112 - (struct hal_ce_srng_dst_status_desc *)buf;
113 + struct hal_ce_srng_dst_status_desc *desc = buf;
114 u32 len;
115
116 len = FIELD_GET(HAL_CE_DST_STATUS_DESC_FLAGS_LEN, desc->flags);
117 --- a/drivers/net/wireless/ath/ath11k/hal_rx.c
118 +++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
119 @@ -265,7 +265,7 @@ out:
120 void ath11k_hal_rx_buf_addr_info_set(void *desc, dma_addr_t paddr,
121 u32 cookie, u8 manager)
122 {
123 - struct ath11k_buffer_addr *binfo = (struct ath11k_buffer_addr *)desc;
124 + struct ath11k_buffer_addr *binfo = desc;
125 u32 paddr_lo, paddr_hi;
126
127 paddr_lo = lower_32_bits(paddr);
128 @@ -279,7 +279,7 @@ void ath11k_hal_rx_buf_addr_info_set(voi
129 void ath11k_hal_rx_buf_addr_info_get(void *desc, dma_addr_t *paddr,
130 u32 *cookie, u8 *rbm)
131 {
132 - struct ath11k_buffer_addr *binfo = (struct ath11k_buffer_addr *)desc;
133 + struct ath11k_buffer_addr *binfo = desc;
134
135 *paddr =
136 (((u64)FIELD_GET(BUFFER_ADDR_INFO1_ADDR, binfo->info1)) << 32) |
137 @@ -292,7 +292,7 @@ void ath11k_hal_rx_msdu_link_info_get(vo
138 u32 *msdu_cookies,
139 enum hal_rx_buf_return_buf_manager *rbm)
140 {
141 - struct hal_rx_msdu_link *link = (struct hal_rx_msdu_link *)link_desc;
142 + struct hal_rx_msdu_link *link = link_desc;
143 struct hal_rx_msdu_details *msdu;
144 int i;
145
146 @@ -699,7 +699,7 @@ u32 ath11k_hal_reo_qdesc_size(u32 ba_win
147 void ath11k_hal_reo_qdesc_setup(void *vaddr, int tid, u32 ba_window_size,
148 u32 start_seq, enum hal_pn_type type)
149 {
150 - struct hal_rx_reo_queue *qdesc = (struct hal_rx_reo_queue *)vaddr;
151 + struct hal_rx_reo_queue *qdesc = vaddr;
152 struct hal_rx_reo_queue_ext *ext_desc;
153
154 memset(qdesc, 0, sizeof(*qdesc));
155 @@ -809,8 +809,7 @@ static inline void
156 ath11k_hal_rx_handle_ofdma_info(void *rx_tlv,
157 struct hal_rx_user_status *rx_user_status)
158 {
159 - struct hal_rx_ppdu_end_user_stats *ppdu_end_user =
160 - (struct hal_rx_ppdu_end_user_stats *)rx_tlv;
161 + struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv;
162
163 rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6);
164
165 @@ -821,8 +820,7 @@ static inline void
166 ath11k_hal_rx_populate_byte_count(void *rx_tlv, void *ppduinfo,
167 struct hal_rx_user_status *rx_user_status)
168 {
169 - struct hal_rx_ppdu_end_user_stats *ppdu_end_user =
170 - (struct hal_rx_ppdu_end_user_stats *)rx_tlv;
171 + struct hal_rx_ppdu_end_user_stats *ppdu_end_user = rx_tlv;
172
173 rx_user_status->mpdu_ok_byte_count =
174 FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT,
175 @@ -1540,8 +1538,7 @@ void ath11k_hal_rx_reo_ent_buf_paddr_get
176 u32 *sw_cookie, void **pp_buf_addr,
177 u8 *rbm, u32 *msdu_cnt)
178 {
179 - struct hal_reo_entrance_ring *reo_ent_ring =
180 - (struct hal_reo_entrance_ring *)rx_desc;
181 + struct hal_reo_entrance_ring *reo_ent_ring = rx_desc;
182 struct ath11k_buffer_addr *buf_addr_info;
183 struct rx_mpdu_desc *rx_mpdu_desc_info_details;
184
185 --- a/drivers/net/wireless/ath/ath11k/hal_tx.c
186 +++ b/drivers/net/wireless/ath/ath11k/hal_tx.c
187 @@ -37,7 +37,7 @@ static const u8 dscp_tid_map[DSCP_TID_MA
188 void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd,
189 struct hal_tx_info *ti)
190 {
191 - struct hal_tcl_data_cmd *tcl_cmd = (struct hal_tcl_data_cmd *)cmd;
192 + struct hal_tcl_data_cmd *tcl_cmd = cmd;
193
194 tcl_cmd->buf_addr_info.info0 =
195 FIELD_PREP(BUFFER_ADDR_INFO0_ADDR, ti->paddr);
196 --- a/drivers/net/wireless/ath/ath11k/mac.c
197 +++ b/drivers/net/wireless/ath/ath11k/mac.c
198 @@ -6970,8 +6970,8 @@ err:
199
200 static int ath11k_mac_vif_unref(int buf_id, void *skb, void *ctx)
201 {
202 - struct ieee80211_vif *vif = (struct ieee80211_vif *)ctx;
203 - struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB((struct sk_buff *)skb);
204 + struct ieee80211_vif *vif = ctx;
205 + struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB(skb);
206
207 if (skb_cb->vif == vif)
208 skb_cb->vif = NULL;
209 --- a/drivers/net/wireless/ath/ath11k/spectral.c
210 +++ b/drivers/net/wireless/ath/ath11k/spectral.c
211 @@ -592,7 +592,7 @@ int ath11k_spectral_process_fft(struct a
212 return -EINVAL;
213 }
214
215 - tlv = (struct spectral_tlv *)data;
216 + tlv = data;
217 tlv_len = FIELD_GET(SPECTRAL_TLV_HDR_LEN, __le32_to_cpu(tlv->header));
218 /* convert Dword into bytes */
219 tlv_len *= ATH11K_SPECTRAL_DWORD_SIZE;
220 --- a/drivers/net/wireless/ath/ath11k/wmi.c
221 +++ b/drivers/net/wireless/ath/ath11k/wmi.c
222 @@ -2281,7 +2281,7 @@ int ath11k_wmi_send_scan_start_cmd(struc
223 tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_UINT32) |
224 FIELD_PREP(WMI_TLV_LEN, len);
225 ptr += TLV_HDR_SIZE;
226 - tmp_ptr = (u32 *)ptr;
227 + tmp_ptr = ptr;
228
229 for (i = 0; i < params->num_chan; ++i)
230 tmp_ptr[i] = params->chan_list[i];
231 @@ -4148,7 +4148,7 @@ static int ath11k_init_cmd_send(struct a
232 ptr += TLV_HDR_SIZE + len;
233
234 if (param->hw_mode_id != WMI_HOST_HW_MODE_MAX) {
235 - hw_mode = (struct wmi_pdev_set_hw_mode_cmd_param *)ptr;
236 + hw_mode = ptr;
237 hw_mode->tlv_header = FIELD_PREP(WMI_TLV_TAG,
238 WMI_TAG_PDEV_SET_HW_MODE_CMD) |
239 FIELD_PREP(WMI_TLV_LEN,
240 @@ -4168,7 +4168,7 @@ static int ath11k_init_cmd_send(struct a
241 len = sizeof(*band_to_mac);
242
243 for (idx = 0; idx < param->num_band_to_mac; idx++) {
244 - band_to_mac = (void *)ptr;
245 + band_to_mac = ptr;
246
247 band_to_mac->tlv_header = FIELD_PREP(WMI_TLV_TAG,
248 WMI_TAG_PDEV_BAND_TO_MAC) |