[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5328D1EF.70709@gmail.com>
Date: Tue, 18 Mar 2014 17:08:31 -0600
From: Joel Pelaez Jorge <joelpelaez@...il.com>
To: Jingoo Han <jg1.han@...sung.com>
CC: 'Greg Kroah-Hartman' <gregkh@...uxfoundation.org>,
'Joe Perches' <joe@...ches.com>,
'Rashika Kheria' <rashika.kheria@...il.com>,
'Peter P Waskiewicz Jr' <peter.p.waskiewicz.jr@...el.com>,
linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
'Wei Yongjun' <yongjun_wei@...ndmicro.com.cn>,
'Dan Carpenter' <dan.carpenter@...cle.com>
Subject: Re: [PATCH] staging: slicoss: Fix prefer ether_addr_copy over memcpy
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
--
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