mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
staging: rtl8723bs: use ether_addr_copy() for MAC address copying
Replaces multiple memcpy() calls with ether_addr_copy() for copying MAC/Ethernet addresses in rtl8723bs. This improves readability and aligns with Linux kernel best practices for handling Ethernet addresses. Fixes the following checkpatch.pl warning: "Use ether_addr_copy() instead of memcpy() for Ethernet addresses." These updates enhance code clarity and maintain consistency with network driver conventions. Signed-off-by: Dharanitharan R <dharanitharan725@gmail.com> Link: https://patch.msgid.link/20251023145903.2557-1-dharanitharan725@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
de4cbbdf2d
commit
79b6761260
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <drv_types.h>
|
||||
#include <rtl8723b_hal.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include "hal_com_h2c.h"
|
||||
|
||||
#define MAX_H2C_BOX_NUMS 4
|
||||
|
|
@ -117,8 +118,8 @@ static void ConstructBeacon(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
*(fctrl) = 0;
|
||||
|
||||
eth_broadcast_addr(pwlanhdr->addr1);
|
||||
memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, get_my_bssid(cur_network), ETH_ALEN);
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
|
||||
ether_addr_copy(pwlanhdr->addr3, get_my_bssid(cur_network));
|
||||
|
||||
SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/);
|
||||
/* pmlmeext->mgnt_seq++; */
|
||||
|
|
@ -209,10 +210,10 @@ static void ConstructPSPoll(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
SetDuration(pframe, (pmlmeinfo->aid | 0xc000));
|
||||
|
||||
/* BSSID. */
|
||||
memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
|
||||
ether_addr_copy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)));
|
||||
|
||||
/* TA. */
|
||||
memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
|
||||
|
||||
*pLength = 16;
|
||||
}
|
||||
|
|
@ -246,21 +247,21 @@ static void ConstructNullFunctionData(
|
|||
switch (cur_network->network.infrastructure_mode) {
|
||||
case Ndis802_11Infrastructure:
|
||||
SetToDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, StaAddr, ETH_ALEN);
|
||||
ether_addr_copy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)));
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
|
||||
ether_addr_copy(pwlanhdr->addr3, StaAddr);
|
||||
break;
|
||||
case Ndis802_11APMode:
|
||||
SetFrDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
ether_addr_copy(pwlanhdr->addr1, StaAddr);
|
||||
ether_addr_copy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)));
|
||||
ether_addr_copy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)));
|
||||
break;
|
||||
case Ndis802_11IBSS:
|
||||
default:
|
||||
memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
|
||||
ether_addr_copy(pwlanhdr->addr1, StaAddr);
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
|
||||
ether_addr_copy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -765,9 +766,9 @@ static void ConstructBtNullFunctionData(
|
|||
SetPwrMgt(fctrl);
|
||||
|
||||
SetFrDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, StaAddr, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, myid(&padapter->eeprompriv), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, myid(&padapter->eeprompriv), ETH_ALEN);
|
||||
ether_addr_copy(pwlanhdr->addr1, StaAddr);
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv));
|
||||
ether_addr_copy(pwlanhdr->addr3, myid(&padapter->eeprompriv));
|
||||
|
||||
SetDuration(pwlanhdr, 0);
|
||||
SetSeqNum(pwlanhdr, 0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user