* [PATCH] ethertap can use alloc_etherdev
@ 2003-11-11 22:45 Stephen Hemminger
2003-11-11 23:52 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2003-11-11 22:45 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
Can use alloc_etherdev, don't need to call ether_setup.
Found by viro.
diff -Nru a/drivers/net/ethertap.c b/drivers/net/ethertap.c
--- a/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003
+++ b/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003
@@ -72,8 +72,7 @@
struct net_device *dev;
int err = -ENOMEM;
- dev = alloc_netdev(sizeof(struct net_local), "tap%d",
- ether_setup);
+ dev = alloc_etherdev(sizeof(struct net_local));
if (!dev)
goto out;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ethertap can use alloc_etherdev
2003-11-11 22:45 [PATCH] ethertap can use alloc_etherdev Stephen Hemminger
@ 2003-11-11 23:52 ` Jeff Garzik
2003-11-12 0:47 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2003-11-11 23:52 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
Stephen Hemminger wrote:
> Can use alloc_etherdev, don't need to call ether_setup.
> Found by viro.
>
> diff -Nru a/drivers/net/ethertap.c b/drivers/net/ethertap.c
> --- a/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003
> +++ b/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003
> @@ -72,8 +72,7 @@
> struct net_device *dev;
> int err = -ENOMEM;
>
> - dev = alloc_netdev(sizeof(struct net_local), "tap%d",
> - ether_setup);
> + dev = alloc_etherdev(sizeof(struct net_local));
Um? This clearly changes the device's interface name, which
alloc_etherdev() not ether_setup() assigns.
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ethertap can use alloc_etherdev
2003-11-11 23:52 ` Jeff Garzik
@ 2003-11-12 0:47 ` Stephen Hemminger
2003-11-12 0:50 ` Jeff Garzik
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2003-11-12 0:47 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
On Tue, 11 Nov 2003 18:52:48 -0500
Jeff Garzik <jgarzik@pobox.com> wrote:
> Stephen Hemminger wrote:
> > Can use alloc_etherdev, don't need to call ether_setup.
> > Found by viro.
> >
> > diff -Nru a/drivers/net/ethertap.c b/drivers/net/ethertap.c
> > --- a/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003
> > +++ b/drivers/net/ethertap.c Tue Nov 11 09:36:15 2003
> > @@ -72,8 +72,7 @@
> > struct net_device *dev;
> > int err = -ENOMEM;
> >
> > - dev = alloc_netdev(sizeof(struct net_local), "tap%d",
> > - ether_setup);
> > + dev = alloc_etherdev(sizeof(struct net_local));
>
>
> Um? This clearly changes the device's interface name, which
> alloc_etherdev() not ether_setup() assigns.
>
It forces it already several lines later and it hasn't registered yet.
if (!dev)
goto out;
SET_MODULE_OWNER(dev);
sprintf(dev->name, "tap%d", unit);
dev->base_addr = unit + NETLINK_TAPBASE;
--
Stephen Hemminger <shemminger@osdl.org>
Open Source Development Lab http://developer.osdl.org
:-) Ignorance never settles a question
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ethertap can use alloc_etherdev
2003-11-12 0:47 ` Stephen Hemminger
@ 2003-11-12 0:50 ` Jeff Garzik
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2003-11-12 0:50 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
Stephen Hemminger wrote:
> It forces it already several lines later and it hasn't registered yet.
OK. I applied all but this patch and another one that didn't apply
cleanly. Grab the latest net-drivers-2.5-exp patch I just posted, and
resend against that...
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-11-12 0:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-11 22:45 [PATCH] ethertap can use alloc_etherdev Stephen Hemminger
2003-11-11 23:52 ` Jeff Garzik
2003-11-12 0:47 ` Stephen Hemminger
2003-11-12 0:50 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).