[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vc3gEyP+h_XtJV7zKZV0J++Nyr04au7Rtu3h5y0JJASXg@mail.gmail.com>
Date: Tue, 26 Jun 2018 20:32:59 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Michael Straube <straube.linux@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Joe Perches <joe@...ches.com>,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH v3 3/4] staging: rtl8723bs: use ether_addr_copy() in rtw_macaddr_cfg()
On Tue, Jun 26, 2018 at 11:14 AM, Michael Straube
<straube.linux@...il.com> wrote:
> Use ether_addr_copy() instead of memcpy() to copy the mac address.
>
Suggested-by ?
Btw, ensure that the source and destination buffers are aligned to u16
as required by API.
(It applies to all changes to ether_*addr_*() replacements)
> Signed-off-by: Michael Straube <straube.linux@...il.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> index 7aa00d1391f7..8af4a89e632f 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> @@ -1172,15 +1172,15 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
> for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) {
> mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk + 1]);
> }
> - memcpy(mac_addr, mac, ETH_ALEN);
> + ether_addr_copy(mac_addr, mac);
> } else{ /* Use the mac address stored in the Efuse */
> - memcpy(mac, mac_addr, ETH_ALEN);
> + ether_addr_copy(mac, mac_addr);
> }
>
> if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) {
> if ((addr = of_get_property(np, "local-mac-address", &len)) &&
> len == ETH_ALEN) {
> - memcpy(mac_addr, addr, ETH_ALEN);
> + ether_addr_copy(mac_addr, addr);
> } else {
> eth_random_addr(mac_addr);
> DBG_871X("MAC Address from efuse error, assign random one !!!\n");
> --
> 2.18.0
>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists