Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1471125

Re: [PATCH] docs: make kernel-doc handle varargs properly

From Jani Nikula <jani.nikula@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] docs: make kernel-doc handle varargs properly
Date 2016-08-27 10:50 +0200
Message-ID <saHtn-2iP-1@gated-at.bofh.it> (permalink)
References <sapmN-7Bz-11@gated-at.bofh.it>
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Show all headers | View raw


On Fri, 26 Aug 2016, Jonathan Corbet <corbet@lwn.net> wrote:
> As far as I can tell, the handling of "..." arguments has never worked
> right, so any documentation provided was ignored in favor of "variable
> arguments."  This makes kernel-doc handle "@...:" as documented.  It does
> *not* fix spots in kerneldoc comments that don't follow that convention,
> but they are no more broken than before.
>
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
> ---
>  scripts/kernel-doc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index c681e8f0ecc2..e6c52ab938fd 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -414,7 +414,7 @@ my $doc_com_body = '\s*\* ?';
>  my $doc_decl = $doc_com . '(\w+)';
>  # @params and a strictly limited set of supported section names
>  my $doc_sect = $doc_com . 
> -    '\s*(\@\w+|description|context|returns?|notes?|examples?)\s*:(.*)';
> +    '\s*(\@[.\w]+|description|context|returns?|notes?|examples?)\s*:(.*)';

So this will now accept "@foo.bar.baz:" too, right? Should it be
something like this instead?

'\s*(\@\w+|\@\.\.\.|description|context|returns?|notes?|examples?)\s*:(.*)';

BR,
Jani.


>  my $doc_content = $doc_com_body . '(.*)';
>  my $doc_block = $doc_com . 'DOC:\s*(.*)?';
>  my $doc_inline_start = '^\s*/\*\*\s*$';
> @@ -2340,6 +2340,7 @@ sub push_parameter($$$) {
>  
>  	if ($type eq "" && $param =~ /\.\.\.$/)
>  	{
> +	    $param = "...";
>  	    if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") {
>  		$parameterdescs{$param} = "variable arguments";
>  	    }

-- 
Jani Nikula, Intel Open Source Technology Center

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] docs: make kernel-doc handle varargs properly Jonathan Corbet <corbet@lwn.net> - 2016-08-26 15:30 +0200
  Re: [PATCH] docs: make kernel-doc handle varargs properly kbuild test robot <lkp@intel.com> - 2016-08-26 18:10 +0200
  Re: [PATCH] docs: make kernel-doc handle varargs properly Jani Nikula <jani.nikula@intel.com> - 2016-08-27 10:50 +0200
    Re: [PATCH] docs: make kernel-doc handle varargs properly Jonathan Corbet <corbet@lwn.net> - 2016-09-06 15:40 +0200
      Re: [PATCH] docs: make kernel-doc handle varargs properly Markus Heiser <markus.heiser@darmarit.de> - 2016-09-07 09:30 +0200
        Re: [PATCH] docs: make kernel-doc handle varargs properly Jani Nikula <jani.nikula@intel.com> - 2016-09-07 15:10 +0200

csiph-web