lkml.org 
[lkml]   [2000]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: tty and ldisc module safety
Jeff Garzik wrote:
>
> On Wed, 27 Sep 2000, Andrew Morton wrote:
> >
> > --- linux-2.4.0-test9-pre7/include/linux/tty_driver.h Sat Aug 5 13:35:24 2000
> > +++ linux-akpm/include/linux/tty_driver.h Wed Sep 27 00:47:24 2000
> > @@ -117,6 +117,15 @@
> >
> > #include <linux/fs.h>
> >
> > +#ifdef CONFIG_MODULES
> > +#include <linux/module.h>
> > +struct module;
> > +#define SET_TTY_OWNER(driver) \
> > + do { (driver)->owner = THIS_MODULE; } while (0)
> > +#define SET_LDISC_OWNER(ldisc) \
> > + do { (ldisc)->owner = THIS_MODULE; } while (0)
> > +#endif
>
> Why ifdef MODULE?

So we can later do

#ifdef SET_TTY_OWNER

to determine in one hit whether we're compiling for a kernel which has
this change and whether we're supporting modules. Much more reliable
than LINUX_VERSION_CODE().

Those 4 bytes in the tty and ldisc structs may come in handy one day. I
really dislike adding little bits of creeping bloat.

> And why the "struct module;"?

Stupidity?

> Simply including
> linux/modules.h should take care of both cases... Like pci.h, modules.h
> should work fine even when !MODULES...

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

\
 
 \ /
  Last update: 2005-03-22 12:45    [W:0.065 / U:1.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site