lkml.org 
[lkml]   [2018]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] staging: rtl8723bs: refactor rtw_macaddr_cfg()
On Sat, Jun 23, 2018 at 12:45 PM, Michael Straube
<michael.straube@posteo.de> wrote:
> Using is_broadcast_ether_addr() and is_zero_ether_addr() instead of
> testing each byte of the mac[] array for 0xff and 0x00 shortens the
> code and improves readability.
>
> If np == NULL, of_get_property() returns NULL, hence the "np" check
> is not needed.
>
> Instead of a fixed default mac address use a random one to reduce the
> likelihood of mac address collision.
>
> Thanks to Joe Perches and Dan Carpenter.

> + if ((addr = of_get_property(np, "local-mac-address", &len)) &&
> len == ETH_ALEN) {
> memcpy(mac_addr, addr, ETH_ALEN);

ether_addr_copy()?

> } else {

> + eth_random_addr(mac_addr);
> + DBG_871X("MAC Address from efuse error, assign random one !!!\n");
> }

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-06-25 11:52    [W:3.353 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site