From: Tilman Schmidt <tilman@imap.cc>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
isdn@linux-pingi.de, mac@melware.de
Subject: Re: [PATCH] proc_fops: convert drivers/isdn/ to seq_file
Date: Sat, 28 Nov 2009 13:26:26 +0100 [thread overview]
Message-ID: <4B1116F2.20308@imap.cc> (raw)
In-Reply-To: <20091123015625.GA32088@x200.localdomain>
[-- Attachment #1: Type: text/plain, Size: 2243 bytes --]
Am 23.11.2009 02:56 schrieb Alexey Dobriyan:
> --- a/Documentation/isdn/INTERFACE.CAPI
> +++ b/Documentation/isdn/INTERFACE.CAPI
> @@ -149,8 +149,8 @@ char *(*procinfo)(struct capi_ctr *ctrlr)
> pointer to a callback function returning the entry for the device in
> the CAPI controller info table, /proc/capi/controller
>
> -read_proc_t *ctr_read_proc
> - pointer to the read_proc callback function for the device's proc file
> +const struct file_operations *proc_fops
> + pointers to callback functions for the device's proc file
> system entry, /proc/capi/controllers/<n>; will be called with a
> pointer to the device's capi_ctr structure as the last (data) argument
>
This doesn't look correct. AFACIS, most of the callback functions in proc_fops
don't have a last argument named data or looking as if it might lend itself to
passing a pointer to the device's capi_ctr structure. In fact, later in your
patch you replace uses of that last argument by accesses to the m->private
member of the struct seq_file *m argument, like here:
> --- a/drivers/isdn/hardware/avm/b1.c
> +++ b/drivers/isdn/hardware/avm/b1.c
[...]
> @@ -634,18 +636,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr)
> }
>
> /* ------------------------------------------------------------- */
> -int b1ctl_read_proc(char *page, char **start, off_t off,
> - int count, int *eof, struct capi_ctr *ctrl)
> +static int b1ctl_proc_show(struct seq_file *m, void *v)
> {
> + struct capi_ctr *ctrl = m->private;
> avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
> avmcard *card = cinfo->card;
> u8 flag;
[...]
So I guess the paragraph Documentation/isdn/INTERFACE.CAPI needs to be
adapted to describe correctly where the callbacks will find their
controller data structure after that change.
OTOH, the new proc_show functions sport a second argument void *v that
doesn't appear to get used anywhere. It would be nice if that could be
explained a bit somewhere.
Thanks,
Tilman
--
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
next prev parent reply other threads:[~2009-11-28 12:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-23 1:56 [PATCH] proc_fops: convert drivers/isdn/ to seq_file Alexey Dobriyan
2009-11-25 0:25 ` Andrew Morton
2009-11-25 4:59 ` Alexey Dobriyan
2009-11-30 0:42 ` Tilman Schmidt
2009-11-30 20:17 ` Alexey Dobriyan
2009-12-02 9:01 ` Tilman Schmidt
2009-11-28 12:26 ` Tilman Schmidt [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-01-14 10:27 Karsten Keil
2010-01-14 11:11 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B1116F2.20308@imap.cc \
--to=tilman@imap.cc \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=isdn@linux-pingi.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mac@melware.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.