mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 02:53:36 +02:00
wifi: wcn36xx: buff_to_be(): fix sparse warnings
Sparse warns: drivers/net/wireless/ath/wcn36xx/txrx.c: note: in included file (through drivers/net/wireless/ath/wcn36xx/txrx.h): drivers/net/wireless/ath/wcn36xx/wcn36xx.h:107:24: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/wcn36xx/wcn36xx.h:107:24: expected unsigned int [usertype] drivers/net/wireless/ath/wcn36xx/wcn36xx.h:107:24: got restricted __be32 [usertype] drivers/net/wireless/ath/wcn36xx/wcn36xx.h:107:24: warning: incorrect type in assignment (different base types) drivers/net/wireless/ath/wcn36xx/wcn36xx.h:107:24: expected unsigned int [usertype] drivers/net/wireless/ath/wcn36xx/wcn36xx.h:107:24: got restricted __be32 [usertype] Use void pointers and two separate variables to workaround the warning. Also now the callers don't need any casting. There's actually cpu_to_be32_array() available but decided to do minimal changes instead. Compile tested only. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240320182449.3757215-3-kvalo@kernel.org
This commit is contained in:
parent
ed769314f5
commit
fba52950e5
|
|
@ -318,7 +318,7 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
|
|||
memset(&status, 0, sizeof(status));
|
||||
|
||||
bd = (struct wcn36xx_rx_bd *)skb->data;
|
||||
buff_to_be((u32 *)bd, sizeof(*bd)/sizeof(u32));
|
||||
buff_to_be(bd, sizeof(*bd)/sizeof(u32));
|
||||
wcn36xx_dbg_dump(WCN36XX_DBG_RX_DUMP,
|
||||
"BD <<< ", (char *)bd,
|
||||
sizeof(struct wcn36xx_rx_bd));
|
||||
|
|
@ -692,7 +692,7 @@ int wcn36xx_start_tx(struct wcn36xx *wcn,
|
|||
/* MGMT and CTRL frames are handeld here*/
|
||||
wcn36xx_set_tx_mgmt(&bd, wcn, &vif_priv, skb, bcast);
|
||||
|
||||
buff_to_be((u32 *)&bd, sizeof(bd)/sizeof(u32));
|
||||
buff_to_be(&bd, sizeof(bd)/sizeof(u32));
|
||||
bd.tx_bd_sign = 0xbdbdbdbd;
|
||||
|
||||
ret = wcn36xx_dxe_tx_frame(wcn, vif_priv, &bd, skb, is_low);
|
||||
|
|
|
|||
|
|
@ -100,11 +100,14 @@ enum wcn36xx_ampdu_state {
|
|||
#define RF_IRIS_WCN3660 0x3660
|
||||
#define RF_IRIS_WCN3680 0x3680
|
||||
|
||||
static inline void buff_to_be(u32 *buf, size_t len)
|
||||
static inline void buff_to_be(void *buf, size_t len)
|
||||
{
|
||||
__be32 *to = buf;
|
||||
u32 *from = buf;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
buf[i] = cpu_to_be32(buf[i]);
|
||||
to[i] = cpu_to_be32(from[i]);
|
||||
}
|
||||
|
||||
struct nv_data {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user