From: Johannes Berg <johannes@sipsolutions.net>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-wireless <linux-wireless@vger.kernel.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Tomas Winkler <tomasw@gmail.com>
Subject: Re: [PATCH] CONFIG_KMOD needs to be default y
Date: Tue, 08 Jul 2008 18:06:15 +0200 [thread overview]
Message-ID: <1215533175.9610.51.camel@johannes.berg> (raw)
In-Reply-To: <200807082303.26194.rusty@rustcorp.com.au>
[-- Attachment #1: Type: text/plain, Size: 2035 bytes --]
On Tue, 2008-07-08 at 23:03 +1000, Rusty Russell wrote:
> > What about just killing the config option entirely? It' basically
> > guarding a ~50 lines function + a sysctl variable. I think having
> > modules but not CONFIG_KMOD is entirely unreasonable.
>
> I agree with Christoph here.
Yeah, like I said, I wasn't sure why it's there anyway.
> But as a patch series please: it's spread pretty wide. eg. first make it a
> non-prompting CONFIG option, then remove the users, then finally kill it.
Sure.
> Some existing request_module users might be able to use
> try_then_request_module, too...
try_then_request_module seems buggy though. Or at least, doing something
unexpected. Here's the macro, for reference:
#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
I think it should be
#define try_then_request_module(x, mod...) \
((x) ?: ({request_module(mod); (x)}))
the difference being that it returns the result of the second "x" when
the first "x" fails. A potential user would be
net/bridge/netfilter/ebtables.c:
ret = find_inlist_lock_noload(head, name, error, mutex);
if (!ret) {
request_module("%s%s", prefix, name);
ret = find_inlist_lock_noload(head, name, error, mutex);
}
which could then be written as
ret = try_then_request_module(
find_inlist_lock_noload(head, name, error, mutex),
"%s%s", prefix, name);
Also, in the case of MODULES=n, I think it should just be
static inline void printf_check(char *name, ...) __attribute__((format(printf, 1, 2))) {};
#define try_then_request_module(x, mod...) \
({ printf_check(mod); (x) })
so (x) is only evaluated once.
A different variation you could make a case for is to not re-evaluate x
if request_module fails, which would then automatically collapse the
MODULES=n case:
#define try_then_request_module(x, mod...) \
({ typeof(x) __ret = (x); __ret ?: \
(request_module(mod) ? __r : (x)); })
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2008-07-08 16:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 11:49 Johannes Berg
2008-07-08 12:42 ` Christoph Hellwig
2008-07-08 13:03 ` Rusty Russell
2008-07-08 16:06 ` Johannes Berg [this message]
2008-07-08 16:15 ` Johannes Berg
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=1215533175.9610.51.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=tomasw@gmail.com \
/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®