Re: [idea] request_module(const char *fmt, ...);

From: Tigran Aivazian (tigran@sco.COM)
Date: Wed Jan 12 2000 - 02:41:29 EST


On Tue, 11 Jan 2000, Alexander Viro wrote:
> First of all, #ifdef... is bogus - check kmod.h and you'll see what
> happens if CONFIG_KMOD is undefined.

Alexander,

If I was talking on the level of disassembling anything that calls
request_module() then, of course, I *knew* what exactly happens if
CONFIG_KMOD is undefined.

> So removing it is OK right now.

No, it is not OK. Because, as I said in the message, gcc will *not*
optimize away the bogus sprintf(name...) calculation which I considered
unacceptable. If we are willing to make a function call to sprintf() and
actually do some work in it we should be more than willing to make a
function call to an almost empty request_module() (when CONFIG_KMOD is
undefined). See my point?

> Another thing being that yes, it would be nice to have printf-like _real_
> request_module(). The only thing to watch for is literal module name
> passing - if you know that name will never contain % you are fine,
> otherwise you'll need to go for "%s",name.

I thought va_start/va_end magic handles that automatically, i.e. if
sprintf(buf, "%s", "hello") does the same as sprintf(buf, "hello") then
our new request_module() should work fine as well.

Thanks,
Tigran.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:19 EST