Skip to contentSkip to conversation

struct tty_driver

DISCUSSION [email protected] 2 participants 2 messages Feb 11, 2003 – Feb 12, 2003

lore
Share & tools
lore
#0 lore raw

Ted, I wondered:

Looking at 2.5.60 I see

struct tty_struct {
	int     magic;
	struct tty_driver driver;

...

and it looks like this struct tty_driver is never modified. Since it is rather large, why not replace it by

	struct tty_driver *driver;

?

As it is now, the initialization in init_dev() does

	tty->driver = *driver;

just duplicating constant data.

Is this a historical relict, or does this duplication have a function?

Andries

#1 lore raw
Quoted 11 lines · On Tue, Feb 11, 2003 at 03:44:07PM +0100, [email protected] wrote:

Ted, I wondered:

Looking at 2.5.60 I see

struct tty_struct {
	int     magic;
	struct tty_driver driver;

...

and it looks like this struct tty_driver is never modified. Since it is rather large, why not replace it by

Quoted 8 lines
	struct tty_driver *driver;

?

As it is now, the initialization in init_dev() does

	tty->driver = *driver;

just duplicating constant data.

Is this a historical relict, or does this duplication have a function?

Nope. The tty->ldisc should also be made into a pointer as well. It's a historic relict; it's been a very, very long time since there's been any variable data in the driver or ldisc structures.

- Ted