From: "Paolo 'Blaisorblade' Giarrusso" <blaisorblade@yahoo.it>
To: Andrew Morton <akpm@osdl.org>
Cc: Jeff Dike <jdike@addtoit.com>,
linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [PATCH 3/3] uml: clean our set_ether_mac
Date: Sun, 06 Aug 2006 17:47:05 +0200 [thread overview]
Message-ID: <20060806154705.536.49855.stgit@memento.home.lan> (raw)
In-Reply-To: <20060806154700.536.32978.stgit@memento.home.lan>
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Clean set_ether_mac usage. Maybe could also be removed, but surely it can't be a
global function taking a void* argument.
You may want to defer this patch to next kernel release.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
arch/um/drivers/net_kern.c | 14 ++++++--------
arch/um/include/net_user.h | 1 -
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index f5fba74..e26601a 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -31,6 +31,11 @@ #include "init.h"
#include "irq_user.h"
#include "irq_kern.h"
+static inline void set_ether_mac(struct net_device *dev, unsigned char *addr)
+{
+ memcpy(dev->dev_addr, addr, ETH_ALEN);
+}
+
#define DRIVER_NAME "uml-netdev"
static DEFINE_SPINLOCK(opened_lock);
@@ -234,7 +239,7 @@ static int uml_net_set_mac(struct net_de
struct sockaddr *hwaddr = addr;
spin_lock_irq(&lp->lock);
- memcpy(dev->dev_addr, hwaddr->sa_data, ETH_ALEN);
+ set_ether_mac(dev, hwaddr->sa_data);
spin_unlock_irq(&lp->lock);
return(0);
@@ -788,13 +793,6 @@ void dev_ip_addr(void *d, unsigned char
memcpy(bin_buf, &in->ifa_address, sizeof(in->ifa_address));
}
-void set_ether_mac(void *d, unsigned char *addr)
-{
- struct net_device *dev = d;
-
- memcpy(dev->dev_addr, addr, ETH_ALEN);
-}
-
struct sk_buff *ether_adjust_skb(struct sk_buff *skb, int extra)
{
if((skb != NULL) && (skb_tailroom(skb) < extra)){
diff --git a/arch/um/include/net_user.h b/arch/um/include/net_user.h
index 800c403..47ef7cb 100644
--- a/arch/um/include/net_user.h
+++ b/arch/um/include/net_user.h
@@ -26,7 +26,6 @@ struct net_user_info {
extern void ether_user_init(void *data, void *dev);
extern void dev_ip_addr(void *d, unsigned char *bin_buf);
-extern void set_ether_mac(void *d, unsigned char *addr);
extern void iter_addresses(void *d, void (*cb)(unsigned char *,
unsigned char *, void *),
void *arg);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2006-08-06 15:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-06 15:47 [uml-devel] [PATCH 1/3] uml: use -mcmodel=kernel for x86_64 Paolo 'Blaisorblade' Giarrusso
2006-08-06 15:47 ` [uml-devel] [PATCH 2/3] uml: fix proc-vs-interrupt context spinlock deadlock Paolo 'Blaisorblade' Giarrusso
2006-08-07 22:14 ` Jeff Dike
2006-08-08 10:59 ` Paolo Giarrusso
2006-08-08 20:02 ` Jeff Dike
2006-08-09 14:44 ` Paolo Giarrusso
2006-08-06 15:47 ` Paolo 'Blaisorblade' Giarrusso [this message]
2006-08-07 22:17 ` [uml-devel] [PATCH 3/3] uml: clean our set_ether_mac Jeff Dike
2006-08-07 21:18 ` [uml-devel] [PATCH 1/3] uml: use -mcmodel=kernel for x86_64 Jeff Dike
2006-08-08 10:46 ` Paolo Giarrusso
2006-08-08 11:22 ` Andi Kleen
2006-08-08 14:03 ` Paolo Giarrusso
2006-08-08 14:14 ` Andi Kleen
2006-08-08 14:47 ` Daniel Gryniewicz
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=20060806154705.536.49855.stgit@memento.home.lan \
--to=blaisorblade@yahoo.it \
--cc=akpm@osdl.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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