Re: [PATCH 01/13] proc tty: introduce ->proc_fops

From: Alan Cox
Date: Tue Jul 29 2008 - 06:11:43 EST


On Tue, 29 Jul 2008 05:29:08 +0400
Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:

> Add struct tty_operations:proc_fops .
>
> The intent is gradual switch of TTY drivers from ->read_proc usage.
> proc entries are created with proc_create_data() which even fixes
> early-read races.
>
> Eventually ->read_proc code will be removed from TTY code, thus helping
> remove ->read_proc from whole proc code.

I'm going to NAK this but not because I think the concept is wrong. I
think the way its been done is perhaps wrong.

You've added ifdefs to a lot of drivers and more basically duplicate
code. Is there a reason you can't keep the ->read_proc method in the tty
code but as a function called by a single instance of proc_fops and
seq_file methods for the whole tty driver layer.

Ie have a single tty seq_file method that calls driver->ops->read_proc as
the seqfile iterator ?

> int count, int *eof, void *data);
> +#ifdef CONFIG_PROC_FS
> + const struct file_operations *proc_fops;
> +#endif

I'd prefer you didn't put variables in the middle of the methods. Also
the ifdef isn't needed. It's not worth one pointer to create a load of
ifdefs

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