linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: gbittencourt <gabrielabittencourt00@gmail.com>,
	outreachy-kernel@googlegroups.com, sudipm.mukherjee@gmail.com,
	teddy.wang@siliconmotion.com, gregkh@linuxfoundation.org,
	linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org,
	trivial@kernel.org
Subject: Re: [PATCH] staging: sm750fb: format description of parameters the to kernel doc format
Date: Thu, 17 Oct 2019 01:52:34 +0000	[thread overview]
Message-ID: <c8fc60be-5bae-6b3c-d270-c0ca55be1c51@infradead.org> (raw)
In-Reply-To: <d55516db-28c5-aa53-8d07-20201dc4ffca@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

On 10/16/19 6:29 PM, gbittencourt wrote:
> Hi Randy,
> 
> On 10/16/19 10:25 PM, Randy Dunlap wrote:
>> Hi,
>>
>> On 10/16/19 6:18 PM, Gabriela Bittencourt wrote:
>>> Cluster comments that describes parameters of functions and create one
>>> single comment before the function in kernel doc format.
>> Good plan.
>>
>> How did you test this patch?
> I haven't test it. How can I do it?

Hm. There used to be a comment in a (now deleted) document named
Documentation/kernel-doc-nano-HOWTO.txt about how to test kernel-doc.

I took that comment and made a script from it.
I'll attach the script.  It's easy to use, but it is made to test only
one function or struct or union or enum at a time.

You need to have a script named 'kernel-doc' in your PATH or you can
specify where the script is located by using
$ KERNDOC=path/to/scripts/kernel-doc kdoc_function _parameters_

Its usage is:
  kdoc_function filename funcname [text|man|html|docbook|xml]

where funcname can be a function, struct, union, or enum name.
The output format can be any of those listed, but the default is "text".

Let me know if you have any questions or problems.

>>> Signed-off-by: Gabriela Bittencourt <gabrielabittencourt00@gmail.com>
>>> ---
>>>   drivers/staging/sm750fb/sm750_accel.c | 65 +++++++++++++++------------
>>>   1 file changed, 37 insertions(+), 28 deletions(-)


-- 
~Randy

[-- Attachment #2: kdoc_function --]
[-- Type: text/plain, Size: 1150 bytes --]

#! /bin/sh
# from linux/Documentation/kernel-doc-nano-HOWTO.txt
# uses linux/scripts/kernel-doc or a copy of it (in $PATH).
# using "LANG=C or LC_ALL=C kdoc_function <prms>" can be useful.
# Can use "KERNDOC=<script_filename> kdoc_function <prms>" to vary
# which kernel-doc script is used.

verbose=
debug=
if [ "$KERNDOC" = "" ]; then
	KERNDOC=kernel-doc
fi

# careful: must enter -v before -x:
if [ "$1" = "-v" ]; then
	verbose="-v"
	shift
fi
if [ "$1" = "-x" ]; then
	debug="-x"
	shift
fi

file="$1"
fn="$2"
# fmt can be "text|man|html|docbook|xml" (default is "text")
# docbook produces xml
fmt="$3"
if [ x$3 = x ]; then
	fmt="text"
fi

if [ "$2" = "" ]; then
	echo "usage: kdoc_function filename funcname [text|man|html|docbook|xml]"
	exit 1
fi

case $fmt in
    man)
	$KERNDOC $verbose $debug -man -function $fn $file | nroff -man | less
	;;
    html)
	$KERNDOC $verbose $debug -html -function $fn $file >kerneldoc.html
	echo "see kerneldoc.html"
	;;
    docbook|xml)
	$KERNDOC $verbose $debug -docbook -function $fn $file >kerneldoc.xml
	echo "see kerneldoc.xml"
	;;
    *)
	$KERNDOC $verbose $debug -text -function $fn $file | less
	;;
esac

      reply	other threads:[~2019-10-17  1:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17  1:18 [PATCH] staging: sm750fb: format description of parameters the to kernel doc format Gabriela Bittencourt
2019-10-17  1:25 ` Randy Dunlap
2019-10-17  1:29   ` gbittencourt
2019-10-17  1:52     ` Randy Dunlap [this message]

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=c8fc60be-5bae-6b3c-d270-c0ca55be1c51@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gabrielabittencourt00@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkcamp@lists.libreplanetbr.org \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=teddy.wang@siliconmotion.com \
    --cc=trivial@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).