* [PATCH] Staging: wlan-ng: coding style ether_addr_copy
@ 2015-02-26 21:15 Hatice ERTÜRK
2015-02-26 21:25 ` [Outreachy kernel] " Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Hatice ERTÜRK @ 2015-02-26 21:15 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Hatice ERTURK
This fixes the following issues detected by checkpatch.pl:
WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet
addresses are __aligned(2)
Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
---
drivers/staging/wlan-ng/p80211conv.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index 7eaaf9a..5625c64 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -178,21 +178,21 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
switch (wlandev->macmode) {
case WLAN_MACMODE_IBSS_STA:
- memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
- memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
- memcpy(p80211_hdr->a3.a3, wlandev->bssid, ETH_ALEN);
+ ether_addr_copy(p80211_hdr->a3.a1, &e_hdr.daddr);
+ ether_addr_copy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr);
+ ether_addr_copy(p80211_hdr->a3.a3, wlandev->bssid);
break;
case WLAN_MACMODE_ESS_STA:
fc |= cpu_to_le16(WLAN_SET_FC_TODS(1));
- memcpy(p80211_hdr->a3.a1, wlandev->bssid, ETH_ALEN);
- memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
- memcpy(p80211_hdr->a3.a3, &e_hdr.daddr, ETH_ALEN);
+ ether_addr_copy(p80211_hdr->a3.a1, wlandev->bssid);
+ ether_addr_copy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr);
+ ether_addr_copy(p80211_hdr->a3.a3, &e_hdr.daddr);
break;
case WLAN_MACMODE_ESS_AP:
fc |= cpu_to_le16(WLAN_SET_FC_FROMDS(1));
- memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
- memcpy(p80211_hdr->a3.a2, wlandev->bssid, ETH_ALEN);
- memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN);
+ ether_addr_copy(p80211_hdr->a3.a1, &e_hdr.daddr);
+ ether_addr_copy(p80211_hdr->a3.a2, wlandev->bssid);
+ ether_addr_copy(p80211_hdr->a3.a3, &e_hdr.saddr);
break;
default:
netdev_err(wlandev->netdev,
@@ -241,7 +241,7 @@ static void orinoco_spy_gather(wlandevice_t *wlandev, char *mac,
for (i = 0; i < wlandev->spy_number; i++) {
if (!memcmp(wlandev->spy_address[i], mac, ETH_ALEN)) {
- memcpy(wlandev->spy_address[i], mac, ETH_ALEN);
+ ether_addr_copy(wlandev->spy_address[i], mac);
wlandev->spy_stat[i].level = rxmeta->signal;
wlandev->spy_stat[i].noise = rxmeta->noise;
wlandev->spy_stat[i].qual =
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wlan-ng: coding style ether_addr_copy
2015-02-26 21:15 [PATCH] Staging: wlan-ng: coding style ether_addr_copy Hatice ERTÜRK
@ 2015-02-26 21:25 ` Greg KH
2015-02-26 21:43 ` Hatice ERTÜRK
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2015-02-26 21:25 UTC (permalink / raw)
To: Hatice ERTÜRK; +Cc: outreachy-kernel
On Thu, Feb 26, 2015 at 11:15:52PM +0200, Hatice ERT�RK wrote:
> This fixes the following issues detected by checkpatch.pl:
>
> WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet
> addresses are __aligned(2)
Are they aligned? Please show some kind of proof in your commit log
when you resend this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wlan-ng: coding style ether_addr_copy
2015-02-26 21:25 ` [Outreachy kernel] " Greg KH
@ 2015-02-26 21:43 ` Hatice ERTÜRK
2015-02-26 23:21 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Hatice ERTÜRK @ 2015-02-26 21:43 UTC (permalink / raw)
To: outreachy-kernel; +Cc: haticeerturk27
[-- Attachment #1.1: Type: text/plain, Size: 471 bytes --]
How do I show proof?
26 Şubat 2015 Perşembe 23:25:09 UTC+2 tarihinde gregkh yazdı:
>
> On Thu, Feb 26, 2015 at 11:15:52PM +0200, Hatice ERTÜRK wrote:
> > This fixes the following issues detected by checkpatch.pl:
> >
> > WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet
> > addresses are __aligned(2)
>
> Are they aligned? Please show some kind of proof in your commit log
> when you resend this.
>
> thanks,
>
> greg k-h
>
[-- Attachment #1.2: Type: text/html, Size: 825 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: wlan-ng: coding style ether_addr_copy
2015-02-26 21:43 ` Hatice ERTÜRK
@ 2015-02-26 23:21 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2015-02-26 23:21 UTC (permalink / raw)
To: Hatice ERTÜRK; +Cc: outreachy-kernel
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
On Thu, Feb 26, 2015 at 01:43:12PM -0800, Hatice ERT�RK wrote:
> How do I show proof?
If you don't know how to prove this, then please don't make this type of
change to the kernel, as it might be wrong.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-26 23:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-26 21:15 [PATCH] Staging: wlan-ng: coding style ether_addr_copy Hatice ERTÜRK
2015-02-26 21:25 ` [Outreachy kernel] " Greg KH
2015-02-26 21:43 ` Hatice ERTÜRK
2015-02-26 23:21 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.