From: Joe Perches <joe@perches.com>
To: Balavasu <kp.balavasu@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: octeon: Replace memcpy with ETH_ALEN
Date: Fri, 17 Oct 2014 12:40:48 -0700 [thread overview]
Message-ID: <1413574848.14629.6.camel@perches.com> (raw)
In-Reply-To: <20141017184705.GA17944@vasu-Inspiron-3542>
On Sat, 2014-10-18 at 00:17 +0530, Balavasu wrote:
> This patch fixes the checkpatch.pl issue
> WARNING: memcpy(dev->dev_addr, mac, ETH_ALEN);
That is not the actual warning.
This is the warning:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
How have you made sure that mac can not have odd alignment?
Make sure your commit message shows how you know
that mac is appropriately aligned.
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
[]
> @@ -452,7 +452,7 @@ int cvm_oct_common_init(struct net_device *dev)
> mac = of_get_mac_address(priv->of_node);
>
> if (mac)
> - memcpy(dev->dev_addr, mac, ETH_ALEN);
> + ether_addr_copy(dev->dev_addr, mac);
> else
> eth_hw_addr_random(dev);
>
prev parent reply other threads:[~2014-10-17 19:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-17 18:47 Balavasu
2014-10-17 19:40 ` Joe Perches [this message]
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=1413574848.14629.6.camel@perches.com \
--to=joe@perches.com \
--cc=kp.balavasu@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®