From: Michael Straube <straube.linux@gmail.com>
To: gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
joe@perches.com, dan.carpenter@oracle.com,
andy.shevchenko@gmail.com,
Michael Straube <straube.linux@gmail.com>
Subject: [PATCH v3 3/4] staging: rtl8723bs: use ether_addr_copy() in rtw_macaddr_cfg()
Date: Tue, 26 Jun 2018 10:14:08 +0200 [thread overview]
Message-ID: <20180626081409.9518-3-straube.linux@gmail.com> (raw)
In-Reply-To: <20180626081409.9518-1-straube.linux@gmail.com>
Use ether_addr_copy() instead of memcpy() to copy the mac address.
Signed-off-by: Michael Straube <straube.linux@gmail.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
next prev parent reply other threads:[~2018-06-26 8:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-26 8:14 [PATCH v3 1/4] staging: rtl8723bs: fix comparsion to NULL - coding style Michael Straube
2018-06-26 8:14 ` [PATCH v3 2/4] staging: rtl8723bs: refactor rtw_macaddr_cfg() Michael Straube
2018-06-26 17:29 ` Andy Shevchenko
2018-06-26 19:19 ` Michael Straube
2018-06-26 8:14 ` Michael Straube [this message]
2018-06-26 17:32 ` [PATCH v3 3/4] staging: rtl8723bs: use ether_addr_copy() in rtw_macaddr_cfg() Andy Shevchenko
2018-06-26 19:44 ` Michael Straube
2018-06-26 20:17 ` Joe Perches
2018-06-26 20:32 ` Michael Straube
2018-06-26 21:36 ` Joe Perches
2018-06-27 8:33 ` Dan Carpenter
2018-06-27 12:56 ` Michael Straube
2018-06-27 13:11 ` Dan Carpenter
2018-06-27 16:14 ` Andy Shevchenko
2018-06-27 16:42 ` Joe Perches
2018-06-27 18:35 ` Dan Carpenter
2018-06-26 8:14 ` [PATCH v3 4/4] staging: rtl8723bs: use mac_pton() " Michael Straube
2018-06-26 17:34 ` Andy Shevchenko
2018-06-26 20:48 ` Michael Straube
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=20180626081409.9518-3-straube.linux@gmail.com \
--to=straube.linux@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@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