[PATCH] mt76: connac: use skb_put_data instead of open coding
sean.wang at mediatek.com
sean.wang at mediatek.com
Mon May 2 16:14:38 PDT 2022
From: Sean Wang <sean.wang at mediatek.com>
use skb_put_data instead of open coding in
mt76_connac_mcu_update_arp_filter.
Signed-off-by: Sean Wang <sean.wang at mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
index 51a9b5d60c7a..faa279bbbcb2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
@@ -2185,11 +2185,8 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
return -ENOMEM;
skb_put_data(skb, &req_hdr, sizeof(req_hdr));
- for (i = 0; i < len; i++) {
- u8 *addr = (u8 *)skb_put(skb, sizeof(__be32));
-
- memcpy(addr, &info->arp_addr_list[i], sizeof(__be32));
- }
+ for (i = 0; i < len; i++)
+ skb_put_data(skb, &info->arp_addr_list[i], sizeof(__be32));
return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(OFFLOAD), true);
}
--
2.25.1
More information about the Linux-mediatek
mailing list