From: Linus Torvalds <torvalds@linux-foundation.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: rusty@rustcorp.com.au, linux-kernel@vger.kernel.org,
linux-mips@linux-mips.org
Subject: Re: [PATCH] cpumask fallout: Initialize irq_default_affinity earlier.
Date: Thu, 8 Jan 2009 12:33:38 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.2.00.0901081227360.3283@localhost.localdomain> (raw)
In-Reply-To: <1231446081-8448-1-git-send-email-ddaney@caviumnetworks.com>
On Thu, 8 Jan 2009, David Daney wrote:
>
> +#ifdef CONFIG_SMP
> + init_irq_default_affinity();
> +#endif
Don't do this. It's horrible. It makes the code much harder to read.
What's so wrong with initializing affinity on UP? It's still conceptually
a fine thing to do, although it's obviously trivially a no-op.
Also, since it's only used in "handle.c", why not just move it there?
Then, just make it static, and make it a no-op for the non-SMP case. Ok?
In fact, I think it already is a no-op in the UP case, and you can
literally just do
static inline void __init init_irq_default_affinity(void)
{
alloc_cpumask_var(&irq_default_affinity, GFP_KERNEL);
cpumask_setall(irq_default_affinity);
}
and be done with it. I think it should all compile away to nothing if
CONFIG_SMP isn't set.
Linus
next prev parent reply other threads:[~2009-01-08 20:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 20:21 David Daney
2009-01-08 20:33 ` Linus Torvalds [this message]
2009-01-08 20:49 ` David Daney
2009-01-08 20:56 ` Linus Torvalds
2009-01-10 5:11 ` Rusty Russell
2009-01-08 21:25 ` Mike Travis
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=alpine.LFD.2.00.0901081227360.3283@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=ddaney@caviumnetworks.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=rusty@rustcorp.com.au \
/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
all inboxes | Powered by JetHome®