All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Lin Kassem <linsara1@gmail.com>
Cc: devel@driverdev.osuosl.org, forest@alittletooquiet.net,
	gregkh@linuxfoundation.org, tvboxspy@gmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vt6656: fix Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
Date: Wed, 21 Jan 2015 07:55:24 -0800	[thread overview]
Message-ID: <1421855724.10574.11.camel@perches.com> (raw)
In-Reply-To: <20150121164458.GA10302@lin-535U4C>

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.



  reply	other threads:[~2015-01-21 15:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 16:44 [PATCH] staging: vt6656: fix Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) Lin Kassem
2015-01-21 15:55 ` Joe Perches [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-01-21 11:08 Heba Aamer
2015-01-23  0:09 ` Aya Mahfouz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421855724.10574.11.camel@perches.com \
    --to=joe@perches.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linsara1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tvboxspy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.