From patchwork Wed Aug 24 22:46:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Corbet X-Patchwork-Id: 74632 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp545935qga; Wed, 24 Aug 2016 15:49:02 -0700 (PDT) X-Received: by 10.98.69.73 with SMTP id s70mr4098673pfa.115.1472078942790; Wed, 24 Aug 2016 15:49:02 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si11750719pfd.242.2016.08.24.15.49.02; Wed, 24 Aug 2016 15:49:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756936AbcHXWsy convert rfc822-to-8bit (ORCPT + 27 others); Wed, 24 Aug 2016 18:48:54 -0400 Received: from tex.lwn.net ([70.33.254.29]:57414 "EHLO vena.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756625AbcHXWsx (ORCPT ); Wed, 24 Aug 2016 18:48:53 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by vena.lwn.net (Postfix) with ESMTP id 8A8681540033; Wed, 24 Aug 2016 16:46:24 -0600 (MDT) Date: Wed, 24 Aug 2016 16:46:22 -0600 From: Jonathan Corbet To: Mauro Carvalho Chehab Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Jani Nikula Subject: Re: [PATCH 2/3] docs: split up the driver book Message-ID: <20160824164622.1f7c6309@lwn.net> In-Reply-To: <20160823113016.2d131a02@vento.lan> References: <1471899463-5774-1-git-send-email-corbet@lwn.net> <1471899463-5774-3-git-send-email-corbet@lwn.net> <20160823113016.2d131a02@vento.lan> Organization: LWN.net X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Aug 2016 11:30:16 -0300 Mauro Carvalho Chehab 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 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 --- scripts/kernel-doc | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 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 = '\\&((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>`"],