[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080325154009.GC24160@solarflare.com>
Date: Tue, 25 Mar 2008 15:40:10 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, linux-net-drivers@...arflare.com,
jgarzik@...ox.com
Subject: Re: [PATCH 1/8] New driver "sfc" for Solarstorm SFC4000 controller (try #8)
David Miller wrote:
> > +/* Allocate the NAPI dev's.
> > + * Called after we know how many channels there are.
> > + */
> > +static int efx_init_napi(struct efx_nic *efx)
> > +{
> > + struct efx_channel *channel;
> > + int rc;
> > +
> > + /* Allocate the NAPI dev for the port */
> > + efx->net_dev = alloc_etherdev(0);
> > + if (!efx->net_dev) {
> > + rc = -ENOMEM;
> > + goto err;
> > + }
> > + efx->net_dev->priv = efx;
> > + efx->mii.dev = efx->net_dev;
>
> Please use alloc_etherdev() how is was designed, by
> specifying sizeof(struct efx_nic) as the size argument
> and that way your private area gets setup transparently
> and none of these explicit assignments are necessary.
This late allocation of the net-device is a relic of support for
devices with 2 ports on the same PCI function. I'm fixing it now.
However, I don't see that there's any net saving of assignments.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists