From patchwork Fri Aug 26 13:25:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Corbet X-Patchwork-Id: 74792 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp344887qga; Fri, 26 Aug 2016 06:25:52 -0700 (PDT) X-Received: by 10.98.130.137 with SMTP id w131mr6049437pfd.5.1472217952401; Fri, 26 Aug 2016 06:25:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si21245537pao.113.2016.08.26.06.25.52; Fri, 26 Aug 2016 06:25:52 -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 S1752065AbcHZNZs (ORCPT + 27 others); Fri, 26 Aug 2016 09:25:48 -0400 Received: from tex.lwn.net ([70.33.254.29]:39498 "EHLO vena.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751119AbcHZNZq (ORCPT ); Fri, 26 Aug 2016 09:25:46 -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 678E81540040; Fri, 26 Aug 2016 07:25:45 -0600 (MDT) Date: Fri, 26 Aug 2016 07:25:44 -0600 From: Jonathan Corbet To: linux-doc@vger.kernel.org Cc: LKML , Mauro Carvalho Chehab , Markus Heiser , Jani Nikula Subject: [PATCH] docs: make kernel-doc handle varargs properly Message-ID: <20160826072544.2baadd47@lwn.net> 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 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 --- scripts/kernel-doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 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*:(.*)'; 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"; }