From: Rusty Russell <rusty@rustcorp.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Richard Henderson <rth@twiddle.net>, Miles Bader <miles@gnu.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Make `obsolete params' work correctly if MODULE_SYMBOL_PREFIX is non-empty
Date: Sun, 12 Jan 2003 00:42:55 +1100 [thread overview]
Message-ID: <20030111223100.6C9CD2C055@lists.samba.org> (raw)
In-Reply-To: Your message of "Fri, 10 Jan 2003 21:36:02 -0800." <Pine.LNX.4.44.0301102134150.9532-100000@home.transmeta.com>
In message <Pine.LNX.4.44.0301102134150.9532-100000@home.transmeta.com> you wri
te:
>
> On Sat, 11 Jan 2003, Rusty Russell wrote:
> >
> > Just in case someone names a variable over 2000 chars, and uses it as
> > an old-style module parameter?
>
> No. Just because variable-sized arrays aren't C, and generate crappy code.
>
> > for (i = 0; i < num; i++) {
> > + char sym_name[strlen(obsparm[i].name)
> > + + sizeof(MODULE_SYMBOL_PREFIX)];
>
> It's still there.
OK, *please* explain to me in little words so I can understand.
Variable-sized arrays are C, as of C99. They've been a GNU extension
forever.
While gcc 2.95.4 generates fairly horrible code, gcc 3.0 does better
(the two compilers I have on my laptop).
Both generate correct code.
Speed is certainly of absolutely no importance here.
Changing it to do a kmalloc every time around the loop is complex,
inefficient, unneccessary, and introduces another failure path.
In summary, I can't see any reason why the clearest, simplest code
should be avoided.
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
next prev parent reply other threads:[~2003-01-11 22:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-07 6:32 [PATCH] Make `obsolete params' work correctly if MODULE_SYMBOL_PREFIX is non-empty Miles Bader
2003-01-08 11:56 ` Rusty Russell
2003-01-10 7:39 ` Miles Bader
2003-01-11 14:50 ` Bill Davidsen
2003-01-10 9:52 ` Richard Henderson
2003-01-10 10:20 ` Rusty Russell
2003-01-10 17:03 ` Linus Torvalds
2003-01-11 4:20 ` Rusty Russell
2003-01-11 5:36 ` Linus Torvalds
2003-01-11 13:42 ` Rusty Russell [this message]
2003-01-10 10:39 ` Miles Bader
-- strict thread matches above, loose matches on Subject: below --
2003-01-09 9:49 Miles Bader
2003-01-10 8:31 ` Rusty Russell
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=20030111223100.6C9CD2C055@lists.samba.org \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=miles@gnu.org \
--cc=rth@twiddle.net \
--cc=torvalds@transmeta.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