All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8723au: core: coding style ether_addr_copy
@ 2015-02-22 18:04 Hatice ERTÜRK
  2015-02-22 19:50 ` [Outreachy kernel] " Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Hatice ERTÜRK @ 2015-02-22 18:04 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Hatice ERTURK

This fixes the following issues detected by checkpatch.pl:

WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
---
 drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
index 59d08f4..04717dc 100644
--- a/drivers/staging/rtl8723au/core/rtw_ap.c
+++ b/drivers/staging/rtl8723au/core/rtw_ap.c
@@ -817,7 +817,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter,
 
 	pbss_network->Rssi = 0;
 
-	memcpy(pbss_network->MacAddress, myid(&padapter->eeprompriv), ETH_ALEN);
+	ether_addr_copy(pbss_network->MacAddress, myid(&padapter->eeprompriv));
 
 	/* SSID */
 	p = rtw_get_ie23a(ie, WLAN_EID_SSID, &ie_len, pbss_network->IELength);
@@ -1079,7 +1079,7 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr)
 		if (!paclnode->valid) {
 			INIT_LIST_HEAD(&paclnode->list);
 
-			memcpy(paclnode->addr, addr, ETH_ALEN);
+			ether_addr_copy(paclnode->addr, addr);
 
 			paclnode->valid = true;
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH] Staging: rtl8723au: core: coding style ether_addr_copy
  2015-02-22 18:04 [PATCH] Staging: rtl8723au: core: coding style ether_addr_copy Hatice ERTÜRK
@ 2015-02-22 19:50 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2015-02-22 19:50 UTC (permalink / raw)
  To: Hatice ERTÜRK, outreachy-kernel

On 02/22/15 13:04, Hatice ERTÜRK wrote:
> This fixes the following issues detected by checkpatch.pl:
> 
> WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
> 
> Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
> ---
>  drivers/staging/rtl8723au/core/rtw_ap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Seems fine - did you verify that the structures are aligned correctly?

Cheers,
Jes


> diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c
> index 59d08f4..04717dc 100644
> --- a/drivers/staging/rtl8723au/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723au/core/rtw_ap.c
> @@ -817,7 +817,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter,
>  
>  	pbss_network->Rssi = 0;
>  
> -	memcpy(pbss_network->MacAddress, myid(&padapter->eeprompriv), ETH_ALEN);
> +	ether_addr_copy(pbss_network->MacAddress, myid(&padapter->eeprompriv));
>  
>  	/* SSID */
>  	p = rtw_get_ie23a(ie, WLAN_EID_SSID, &ie_len, pbss_network->IELength);
> @@ -1079,7 +1079,7 @@ int rtw_acl_add_sta23a(struct rtw_adapter *padapter, u8 *addr)
>  		if (!paclnode->valid) {
>  			INIT_LIST_HEAD(&paclnode->list);
>  
> -			memcpy(paclnode->addr, addr, ETH_ALEN);
> +			ether_addr_copy(paclnode->addr, addr);
>  
>  			paclnode->valid = true;
>  
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-22 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-22 18:04 [PATCH] Staging: rtl8723au: core: coding style ether_addr_copy Hatice ERTÜRK
2015-02-22 19:50 ` [Outreachy kernel] " Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.