linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joel Pelaez Jorge <joelpelaez@gmail.com>
To: Jingoo Han <jg1.han@samsung.com>
Cc: "'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>,
	"'Joe Perches'" <joe@perches.com>,
	"'Rashika Kheria'" <rashika.kheria@gmail.com>,
	"'Peter P Waskiewicz Jr'" <peter.p.waskiewicz.jr@intel.com>,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
	"'Wei Yongjun'" <yongjun_wei@trendmicro.com.cn>,
	"'Dan Carpenter'" <dan.carpenter@oracle.com>
Subject: Re: [PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy
Date: Tue, 18 Mar 2014 17:08:31 -0600	[thread overview]
Message-ID: <5328D1EF.70709@gmail.com> (raw)
In-Reply-To: <000101cf426d$cba30240$62e906c0$%han@samsung.com>

El 17/03/14 23:49, Jingoo Han escribió:
> On Tuesday, March 18, 2014 2:04 PM, Joel Pelaez Jorge wrote:
>>
>>
>> @@ -810,8 +810,8 @@ static int slic_mac_set_address(struct net_device
>> *dev, void *ptr)
>>    	if (!is_valid_ether_addr(addr->sa_data))
>>    		return -EINVAL;
>>
>> -	memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
>> -	memcpy(adapter->currmacaddr, addr->sa_data, dev->addr_len);
>> +	ether_addr_copy(dev->dev_addr, addr->sa_data);
>> +	ether_addr_copy(adapter->currmacaddr, addr->sa_data);
>
> By the way, I am wondering if 'dev->addr_len' is 6 bytes.
> Is there anyone who can confirm it?
>
> If nobody can confirm 'dev->addr_len' is 6 bytes, it should
> not be changed to 'ether_addr_copy()'.
>
> Best regards,
> Jingoo Han
>
In the first case, is necessary use memcpy for copy te ethernet address 
to dev->dev_addr because this is a pointer, uses dev->addr_len for 
define size.

But in the second, adapter->currmacaddr is fixed to 6 size, so that here 
one can use ether_addr_copy without issues.

--
Best regards,
Joel Pelaez Jorge
Joel Pelaez Jorge



  reply	other threads:[~2014-03-18 23:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18  5:04 [PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy Joel Pelaez Jorge
2014-03-18  5:49 ` Jingoo Han
2014-03-18 23:08   ` Joel Pelaez Jorge [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-18  3:17 Joel Pelaez Jorge
2014-03-18  3:38 ` Jingoo Han
2014-03-18  3:48   ` Joe Perches
2014-03-18 20:06 ` Greg Kroah-Hartman
2014-03-18  1:32 Joel Peláez Jorge

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=5328D1EF.70709@gmail.com \
    --to=joelpelaez@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jg1.han@samsung.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=rashika.kheria@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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;
as well as URLs for NNTP newsgroup(s).