From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com,
jgarzik@pobox.com
Subject: Re: [PATCH 1/8] New driver "sfc" for Solarstorm SFC4000 controller (try #8)
Date: Mon, 24 Mar 2008 10:29:38 +0000 [thread overview]
Message-ID: <20080324102936.GZ24160@solarflare.com> (raw)
In-Reply-To: <20080323.223238.86781188.davem@davemloft.net>
David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Wed, 12 Mar 2008 01:22:48 +0000
>
> > +static void efx_link_status_changed(struct efx_nic *efx)
> > +{
> > + unsigned long flags __attribute__ ((unused));
>
> Please just delete this variable, it really is never
> used not matter what the build configuration.
These are already gone from our internal version, as my colleague Steve
Hodgson also spotted that they are now unused.
>
> > +
> > + if (rss_cpus == 0) {
> > +#ifdef topology_core_siblings
> > + cpumask_t core_mask;
> > + int cpu;
> > +
> > + cpus_clear(core_mask);
> > + efx->rss_queues = 0;
> > + for_each_online_cpu(cpu) {
> > + if (!cpu_isset(cpu, core_mask)) {
> > + ++efx->rss_queues;
> > + cpus_or(core_mask, core_mask,
> > + topology_core_siblings(cpu));
> > + }
> > + }
> > +#else
> > + efx->rss_queues = num_online_cpus();
> > +#endif
>
> Please don't test feature availability this way.
>
> Either use the proper CONFIG_* option ifdef.
The macro is defined for some architectures and not for others, and does
not depend on config options. See Documentation/cputopology.txt.
> > +/* 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.
OK.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
next prev parent reply other threads:[~2008-03-24 10:30 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-12 1:21 [PATCH 0/8] New driver "sfc" for Solarstorm SFC4000 controller (try #8) Ben Hutchings
2008-03-12 1:22 ` [PATCH 1/8] " Ben Hutchings
2008-03-24 5:32 ` David Miller
2008-03-24 10:29 ` Ben Hutchings [this message]
2008-03-24 20:22 ` David Miller
2008-03-25 12:54 ` Ben Hutchings
2008-03-25 23:37 ` David Miller
2008-03-26 11:58 ` Ben Hutchings
2008-03-25 15:40 ` Ben Hutchings
2008-03-12 1:23 ` [PATCH 2/8] " Ben Hutchings
2008-03-24 5:35 ` David Miller
2008-03-12 1:24 ` [PATCH 3/8] " Ben Hutchings
2008-03-24 5:36 ` David Miller
2008-03-12 1:24 ` [PATCH 4/8] " Ben Hutchings
2008-03-24 5:37 ` David Miller
2008-03-12 1:25 ` [PATCH 5/8] " Ben Hutchings
2008-03-24 5:38 ` David Miller
2008-03-12 1:25 ` [PATCH 6/8] " Ben Hutchings
2008-03-24 5:39 ` David Miller
2008-03-12 1:26 ` [PATCH 7/8] " Ben Hutchings
2008-03-24 5:40 ` David Miller
2008-03-12 1:26 ` [PATCH 8/8] " Ben Hutchings
2008-03-12 1:45 ` Ben Hutchings
2008-03-12 2:01 ` David Miller
2008-03-12 2:29 ` David Miller
2008-03-24 5:40 ` David Miller
2008-03-24 8:52 ` Christoph Hellwig
2008-03-24 10:34 ` Ben Hutchings
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=20080324102936.GZ24160@solarflare.com \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=jgarzik@pobox.com \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
/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.