From: Tilman Schmidt <tilman@imap.cc>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrew Morton <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: Mon, 30 Nov 2009 01:42:32 +0100 [thread overview]
Message-ID: <4B1314F8.10500@imap.cc> (raw)
In-Reply-To: <20091125045914.GA3528@x200.malnet.ru>
[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]
Am 25.11.2009 05:59 schrieb Alexey Dobriyan:
> --- a/drivers/isdn/gigaset/capi.c
> +++ b/drivers/isdn/gigaset/capi.c
> @@ -2106,35 +2106,22 @@ static char *gigaset_procinfo(struct capi_ctr *ctr)
> return ctr->name; /* ToDo: more? */
> }
>
> -/**
> - * gigaset_ctr_read_proc() - build controller proc file entry
> - * @page: buffer of PAGE_SIZE bytes for receiving the entry.
> - * @start: unused.
> - * @off: unused.
> - * @count: unused.
> - * @eof: unused.
> - * @ctr: controller descriptor structure.
> - *
> - * Return value: length of generated entry
> - */
> -static int gigaset_ctr_read_proc(char *page, char **start, off_t off,
> - int count, int *eof, struct capi_ctr *ctr)
> +static int gigaset_proc_show(struct seq_file *m, void *v)
I would prefer that, instead of throwing the kerneldoc comment away,
you adapted it to the new function. Specifically, I would like to
know what the second argument "void *v" is for.
> {
> + struct capi_ctr *ctr = m->private;
See below.
> +static int gigaset_proc_open(struct inode *inode, struct file *file)
> +{
> + return single_open(file, gigaset_proc_show, PDE(inode)->data);
I'd like to understand how that works.
According to Documentation/filesystems/seq_file.txt, the value of
the last argument will be passed to the proc_show function in the
private field of the seq_file structure. Your gigaset_proc_show()
function assumes that this will be the capi_ctr pointer for the
device.
So what is PDE(inode)->data and where does it get set to the
capi_ctr pointer for the device?
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-30 0:43 UTC|newest]
Thread overview: 7+ 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 [this message]
2009-11-30 20:17 ` Alexey Dobriyan
2009-12-02 9:01 ` Tilman Schmidt
2009-11-28 12:26 ` Tilman Schmidt
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=4B1314F8.10500@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox