Re: bogous binfmt_misc patch in 2.2.0-pre1

Rik van Riel (riel@humbolt.geo.uu.nl)
Sun, 3 Jan 1999 00:27:06 +0100 (CET)


On Sat, 2 Jan 1999, Horst von Brand wrote:
> Linus Torvalds <torvalds@transmeta.com> said:
>
> [...]
>
> > So what I suggested as the real fix is to leave the internal /proc
> > interfaces there even if /proc doesn't actually exist: that way, when
> > somebody disables /proc in the config, everything else will still happily
> > compile as if it was there, it just won't do anything.
> >
> > Yes, it might cause a few unnecessary functions to be compiled that aren't
> > actually ever used and thus wasting a few hundred bytes of memory, but I'd
> > _much_ prefer a clean kernel that doesn't have to worry about spurious
> > config options all over the place.
>
> Just #define them to empty or (<some magic constant>) then in the
> affected *.h files.

Couldn't an empty inline function do the trick?

include/linux/proc_fs.h:

#ifdef CONFIG_PROC_FS
....
extern int proc_register(....);
....
#else
....
static inline proc_register(....) {};
....
#endif

That should trick gcc into letting the function dissapear.
(I don't know how that would affect other kernel stuff
though ... it might be Very Bad(tm) for some things)

cheers,

Rik -- If a Microsoft product fails, who do you sue?
+-------------------------------------------------------------------+
| Linux memory management tour guide. riel@humbolt.geo.uu.nl |
| Scouting Vries cubscout leader. http://humbolt.geo.uu.nl/~riel |
+-------------------------------------------------------------------+

-
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/