All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH] staging: vt6656: replace memcpy by ether_addr_copy
Date: Tue, 17 Feb 2015 22:00:55 +0200	[thread overview]
Message-ID: <20150217200055.GA11277@localhost.localdomain> (raw)

This patch fixes the following checkpatch.pl warning:

Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are
__aligned(2)

The changes were applied using the following coccinelle
rule: 
@@ expression e1, e2; @@
- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2); 

All variables defined in vnt_mac_set_key start at even offsets
making the variables aligned to the u16 datatype.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/vt6656/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index bb37e33..5958ecf 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -126,7 +126,7 @@ void vnt_mac_set_keyentry(struct vnt_private *priv, u16 key_ctl, u32 entry_idx,
 	offset += (entry_idx * MISCFIFO_KEYENTRYSIZE);
 
 	set_key.u.write.key_ctl = cpu_to_le16(key_ctl);
-	memcpy(set_key.u.write.addr, addr, ETH_ALEN);
+	ether_addr_copy(set_key.u.write.addr, addr);
 
 	/* swap over swap[0] and swap[1] to get correct write order */
 	swap(set_key.u.swap[0], set_key.u.swap[1]);
-- 
1.9.3



             reply	other threads:[~2015-02-17 20:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-17 20:00 Aya Mahfouz [this message]
2015-02-26 18:28 ` [Outreachy kernel] [PATCH] staging: vt6656: replace memcpy by ether_addr_copy Greg KH
2015-02-26 20:32   ` Aya Mahfouz
2015-02-26 20:35     ` Julia Lawall
2015-02-26 20:41       ` Aya Mahfouz
2015-02-26 20:59     ` Greg KH
2015-02-27  1:32       ` Aya Mahfouz
2015-02-27  1:55         ` Greg KH
2015-02-27  1:59           ` Aya Mahfouz
2015-02-27  5:45             ` Julia Lawall
2015-02-27  5:53               ` Aya Mahfouz
2015-02-27  8:53                 ` Arnd Bergmann
2015-02-27 10:23                   ` Aya Mahfouz
  -- strict thread matches above, loose matches on Subject: below --
2015-02-21 11:32 [PATCH] Staging: " Yeliz Taneroglu

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=20150217200055.GA11277@localhost.localdomain \
    --to=mahfouz.saif.elyazal@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /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 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.