lkml.org 
[lkml]   [2008]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/13] proc tty: introduce ->proc_fops
On Tue, 29 Jul 2008 05:29:08 +0400
Alexey Dobriyan <adobriyan@gmail.com> 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


\
 
 \ /
  Last update: 2008-07-29 12:15    [W:0.052 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site