Re: [PATCH] staging: vt6656: fix Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2015-01-21 at 18:44 +0200, Lin Kassem wrote:
> This patch fixes the following checkpatch.pl warning:
> fix Prefer ether_addr_copy() over memcpy() 
> if the Ethernet addresses are __aligned(2)
> 
> Pahole showed that the 2 structs are aligned to u16
[]
> diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
[]
> @@ -749,7 +749,7 @@ static void vnt_fill_txkey(struct vnt_usb_send_context *tx_context,
>  		else
>  			mic_hdr->hlen = cpu_to_be16(22);
>  
> -		memcpy(mic_hdr->addr1, hdr->addr1, ETH_ALEN);
> +		ether_addr_copy(mic_hdr->addr1, hdr->addr1);
>  		memcpy(mic_hdr->addr2, hdr->addr2, ETH_ALEN);
>  		memcpy(mic_hdr->addr3, hdr->addr3, ETH_ALEN);
>  

Why would you modify only one of these?
Please modify all 4.


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux