public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Mauro Carvalho Chehab <mchehab@s-opensource.com>
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: Wed, 24 Aug 2016 16:46:22 -0600	[thread overview]
Message-ID: <20160824164622.1f7c6309@lwn.net> (raw)
In-Reply-To: <20160823113016.2d131a02@vento.lan>

On Tue, 23 Aug 2016 11:30:16 -0300
Mauro Carvalho Chehab <mchehab@s-opensource.com> wrote:

> 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. 

I have a different idea: why not just add another regexp to the
kernel-doc house of cards? :)  The following seems to make these issues
go away pretty nicely, and didn't cause any change at all to the
media/gpu output...

Stacking up ordering-dependent regexps is not a path to long-term joy; at
some point, we will likely want a smarter parser for kerneldoc comments.
But this seems to improve things for the moment.

jon

>From 5dccd4fb9f3c0b6468f38efab8c1d6232d3e701b Mon Sep 17 00:00:00 2001
From: Jonathan Corbet <corbet@lwn.net>
Date: Wed, 24 Aug 2016 16:31:15 -0600
Subject: [PATCH] docs: Special-case function-pointer parameters in kernel-doc

Add yet another regex to kernel-doc to trap @param() references separately
and not produce corrupt RST markup.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
 scripts/kernel-doc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 4f2e9049e8fa..c681e8f0ecc2 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -212,6 +212,7 @@ my $anon_struct_union = 0;
 my $type_constant = '\%([-_\w]+)';
 my $type_func = '(\w+)\(\)';
 my $type_param = '\@(\w+)';
+my $type_fp_param = '\@(\w+)\(\)';  # Special RST handling for func ptr params
 my $type_struct = '\&((struct\s*)*[_\w]+)';
 my $type_struct_xml = '\\&amp;((struct\s*)*[_\w]+)';
 my $type_env = '(\$\w+)';
@@ -292,6 +293,7 @@ my @highlights_rst = (
                        # Note: need to escape () to avoid func matching later
                        [$type_member_func, "\\:c\\:type\\:`\$1\$2\\\\(\\\\) <\$1>`"],
                        [$type_member, "\\:c\\:type\\:`\$1\$2 <\$1>`"],
+		       [$type_fp_param, "**\$1\\\\(\\\\)**"],
                        [$type_func, "\\:c\\:func\\:`\$1()`"],
                        [$type_struct_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
                        [$type_enum_full, "\\:c\\:type\\:`\$1 \$2 <\$2>`"],
-- 
2.7.4

  reply	other threads:[~2016-08-24 22:48 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
2016-08-24 22:46     ` Jonathan Corbet [this message]
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=20160824164622.1f7c6309@lwn.net \
    --to=corbet@lwn.net \
    --cc=jani.nikula@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    /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