Re: Fwd: struct inode size reduction.

Roman Zippel (zippel@linux-m68k.org)
Mon, 10 Mar 2003 11:58:17 +0100 (CET)


Hi,

On Mon, 10 Mar 2003, Andries Brouwer wrote:

> > My main question here is whether that code hurts in any way? Does it
> > prevent other cleanups? Sure this code needs more work to be really
> > useful, but as long as it only wastes a bit of space, I'd prefer to keep
> > it.
>
> Yes, dead code always hurts.

It's not really dead code, it's not yet used code and if it stays there as
a reminder to actually do something about it, it's good that it hurts.

>
> - error = register_chrdev(driver->major, driver->name, &tty_fops);
> + error = register_chrdev_region(driver->major, driver->minor_start,
> + driver->num, driver->name, &tty_fops);

Are that much parameters really needed?
When I look through the character device list, I basically see two usages.
1. A character device is mapped to n device numbers (where n is <= 8). In
this case it should be enough to register a really available character
device with a single device number. More can be configured e.g. through a
sysfs interface. Currently we have here misc devices users, which is
running out of number space and the other users which are often wasting a
complete major number for a few devices.
2. A large number of dynamic virtual devices (e.g. terminals), these want
a complete major anyway and currently they have to register multiple of
them.
These are the two cases a new character device core should be able to
handle. On top of this we can still think about a small compatibility
layer.

bye, Roman

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