[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1421855724.10574.11.camel@perches.com>
Date: Wed, 21 Jan 2015 07:55:24 -0800
From: Joe Perches <joe@...ches.com>
To: Lin Kassem <linsara1@...il.com>
Cc: devel@...verdev.osuosl.org, forest@...ttletooquiet.net,
gregkh@...uxfoundation.org, tvboxspy@...il.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vt6656: fix Prefer ether_addr_copy() over
memcpy() if the Ethernet addresses are __aligned(2)
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists