From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Jani Nikula <jani.nikula@intel.com>
Subject: Re: [PATCH 2/3] docs: split up the driver book
Date: Tue, 23 Aug 2016 11:30:16 -0300 [thread overview]
Message-ID: <20160823113016.2d131a02@vento.lan> (raw)
In-Reply-To: <1471899463-5774-3-git-send-email-corbet@lwn.net>
Em Mon, 22 Aug 2016 14:57:42 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:
> We don't need to keep it as a single large file anymore; split it up so
> that it is easier to manage and the individual sections can be read
> directly as plain files.
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
> ---
> Documentation/driver-api/basics.rst | 120 +++++
Hi Jon,
I noticed several issues on the converted document. Just commenting
a few of them, as they all follow a pattern: kernel-doc markups
needs review during the conversion to RST, because, unfortunately,
the conversion is not transparent, as we would want to.
So, I'm pointing a few issues I noticed below.
> Documentation/driver-api/basics.rst | 120 +++++
At kernel/kthread.c, on the documentation for:
struct task_struct * kthread_create_on_node(int (*threadfn) (void *data, void * data, int node, const char namefmt[], ...)
The original description is:
* If thread is going to be bound on a particular cpu, give its node
* in @node, to get NUMA affinity for kthread stack, or else give NUMA_NO_NODE.
* When woken, the thread will run @threadfn() with @data as its
* argument. @threadfn() can either call do_exit() directly if it is a
* standalone thread for which no one will call kthread_stop(), or
* return when 'kthread_should_stop()' is true (which means
* kthread_stop() has been called). The return value should be zero
* or a negative error number; it will be passed to kthread_stop().
On the output text, you'll see two places with "@:c:func:threadfn()".
The problem here is that threadfn() is a function argument. While this
used to work with DocBooks, now with Sphinx this is not handled well.
I got some other similar cases on media. There, I opted to just remove
the () on some places, or to replace it by \(\) to avoid kernel-doc
to do the wrong thing. See changeset 564aaf69208d ("[media] doc-rst:
add some needed escape codes").
We could, instead, teach kernel-doc to be smarter, but I'm afraid
that there will always be border cases that it won't cover.
The same problem happened with:
void kmsg_dump_rewind(struct kmsg_dumper * dumper)
Also, you should notice that it added several references to
kthread_create(), with is actually a define:
include/linux/kthread.h:#define kthread_create(threadfn, data, namefmt, arg...) \
It probably makes sense to add some markup for kernel-doc to parse it.
> Documentation/driver-api/drivers.rst | 654 -------------------------
At struct device description:
bool:1 offline
Set after successful invocation of bus type’s .:c:func:offline().
At request_firmware_nowait() description, you'all also see:
->:c:func:probe()
(won't mention about other occurrences of c: - you got the idea)
> Documentation/driver-api/message-based.rst | 30 ++
You should probably change NOTES by:
.. note::
Like on this changeset:
f58cad224796 [media] media-entry.h: Fix a note markup
The description for:
int KickStart(MPT_ADAPTER * ioc, int force, int sleepFlag)
Looked weird on my eyes. The original kernel-nano tag is:
/**
* KickStart - Perform hard reset of MPT adapter.
* @ioc: Pointer to MPT_ADAPTER structure
* @force: Force hard reset
* @sleepFlag: Specifies whether the process can sleep
*
* This routine places MPT adapter in diagnostic mode via the
* WriteSequence register, and then performs a hard reset of adapter
* via the Diagnostic register.
*
* Inputs: sleepflag - CAN_SLEEP (non-interrupt thread)
* or NO_SLEEP (interrupt thread, use mdelay)
* force - 1 if doorbell active, board fault state
* board operational, IOC_RECOVERY or
* IOC_BRINGUP and there is an alt_ioc.
* 0 else
*
* Returns:
* 1 - hard reset, READY
* 0 - no reset due to History bit, READY
* -1 - no reset due to History bit but not READY
* OR reset but failed to come READY
* -2 - no reset, could not enter DIAG mode
* -3 - reset but bad FW bit
*/
static int
KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
The first input like:
* Inputs: sleepflag - CAN_SLEEP (non-interrupt thread)
Is internally converted to a bold output like:
*Inputs sleepflag - CAN_SLEEP (non-interrupt thread)*
And the remaining arguments will be mangled.
At returns arguments, for example, it should be changed to something
like (untested):
* Returns:
*
* - 1 - hard reset, READY
*
* - 0 - no reset due to History bit, READY
*
* - 1 - no reset due to History bit but not READY
* OR reset but failed to come READY
*
* - -2 - no reset, could not enter DIAG mode
*
* - -3 - reset but bad FW bit
So, basically, all kernel-doc tags should be reviewed for continuation
lines.
...
> diff --git a/Documentation/driver-api/index.rst b/Documentation/driver-api/index.rst
> new file mode 100644
> index 000000000000..b50c41011e47
> --- /dev/null
> +++ b/Documentation/driver-api/index.rst
> @@ -0,0 +1,24 @@
> +========================================
> +The Linux driver implementer's API guide
> +========================================
> +
> +The kernel offers a wide variety of interfaces to support the development
> +of device drivers. This document is an only somewhat organized collection
> +of some of those interfaces — it will hopefully get better over time! The
> +available subsections can be seen below.
> +
> +.. class:: toc-title
> +
> + Table of contents
> +
> +.. toctree::
> + :maxdepth: 2
I would add here a
:numbered:
This way, the entire section will be numbered, and you can remove the
manual numbers from the sections from
Documentation/driver-api/serial-interfaces.rst (patch 3/3).
> +
> + basics
> + infrastructure
> + message-based
> + sound
> + frame-buffer
> + input
> + serial-interfaces
> + miscellaneous
Regards,
Mauro
next prev parent reply other threads:[~2016-08-23 14:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-22 20:57 [PATCH 0/3] RFC: The beginning of a proper driver-api book Jonathan Corbet
2016-08-22 20:57 ` [PATCH 1/3] Docs: sphinxify device-drivers.tmpl Jonathan Corbet
2016-08-22 20:57 ` [PATCH 2/3] docs: split up the driver book Jonathan Corbet
2016-08-23 14:30 ` Mauro Carvalho Chehab [this message]
2016-08-24 22:46 ` Jonathan Corbet
2016-08-25 1:55 ` Mauro Carvalho Chehab
2016-08-25 20:09 ` Jonathan Corbet
2016-08-22 20:57 ` [PATCH 3/3] docs: Pull HSI documentation together Jonathan Corbet
2016-08-23 0:20 ` Sebastian Reichel
2016-09-06 15:12 ` Jonathan Corbet
2016-08-23 14:43 ` [PATCH 0/3] RFC: The beginning of a proper driver-api book Mauro Carvalho Chehab
2016-08-26 9:34 ` Markus Heiser
2016-08-26 9:59 ` Mauro Carvalho Chehab
2016-08-26 10:19 ` Jani Nikula
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=20160823113016.2d131a02@vento.lan \
--to=mchehab@s-opensource.com \
--cc=corbet@lwn.net \
--cc=jani.nikula@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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.