From nobody Tue Feb 10 02:43:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819364; cv=none; d=zohomail.com; s=zohoarc; b=R6RAhJfVMEbMvFlDsWAiWvQ11mpzEsZQG6EA80KWp6UuJQ8cl/8hXCxCtmSWqosIL+N+2q0YK4T31ihH1KFgUEF7JLJdCFShFaBA1DNYYQGEhSjIGk2LoZczRr7abYKVyja4IEQ4YfYMmU1lR1pvV9XeZ/J7u5YqYkvzev05+nc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819364; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2u5vWAM3QV1XtIiQ8u3LMQS/2hhuLS683irIASUSqOA=; b=AxqXkYLG6tILxqBVZ2YbXUDcibcGbD+EGjFhJyXTokNeY5qc1Bl4W2rvPWmGNGT5vo/xm41GeFzS9OSge64qUVef6hhDMxDIYD/S1ck6MvWG1JtbnQvZYEHgCl24/qciOqyyT9UgH1WH/FHS/kmUR/Wac9Sqklo7iIEyrr45I7s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819364443775.7524642201431; Tue, 1 Dec 2020 02:42:44 -0800 (PST) Received: from localhost ([::1]:38020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk37L-0002ty-9u for importer@patchew.org; Tue, 01 Dec 2020 05:42:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk303-0002J5-Pr for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk301-0003ox-7R for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-224-QeppF_ZPMFqfjCXvV6gBOg-1; Tue, 01 Dec 2020 05:35:06 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E24C190A7A5; Tue, 1 Dec 2020 10:35:05 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A8DB10013C1; Tue, 1 Dec 2020 10:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2u5vWAM3QV1XtIiQ8u3LMQS/2hhuLS683irIASUSqOA=; b=bnIThSQX3dSkNO2iHLkjK1QpFfFoEw7stmlN+eQNmSkOpOHeyydjrG6eKHqb094Xlf9Tc3 DEyFtXJCd15ysinTB6UxZ3VL38gjVNNhVLteYwpe2+27TlV7mclACQDke/66y14JBim44N iGUYbFy+ClTs2QSx06dFCgY7dshr51U= X-MC-Unique: QeppF_ZPMFqfjCXvV6gBOg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 07/32] scripts: kernel-doc: accept blank lines on parameter description Date: Tue, 1 Dec 2020 05:34:37 -0500 Message-Id: <20201201103502.4024573-8-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Sphinx is very pedantic with respect to blank lines. Sometimes, in order to make it to properly handle something, we need to add a blank line. However, currently, any blank line inside a kernel-doc comment like: /* * @foo: bar * * foobar * * some description will be considered as if "foobar" was part of the description. This patch changes kernel-doc behavior. After it, foobar will be considered as part of the parameter text. The description will only be considered as such if it starts with: zero spaces after asterisk: *foo one space after asterisk: * foo or have a explicit Description section: * Description: Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c07d2862792d75a2691d69c9eceb7b89a0164cc0.15= 86881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-7-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index e4b3cd486f..95f2d7adcf 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -334,13 +334,14 @@ my $lineprefix=3D""; =20 # Parser states use constant { - STATE_NORMAL =3D> 0, # normal code - STATE_NAME =3D> 1, # looking for function name - STATE_BODY_MAYBE =3D> 2, # body - or maybe more description - STATE_BODY =3D> 3, # the body of the comment - STATE_PROTO =3D> 4, # scanning prototype - STATE_DOCBLOCK =3D> 5, # documentation block - STATE_INLINE =3D> 6, # gathering documentation outside main blo= ck + STATE_NORMAL =3D> 0, # normal code + STATE_NAME =3D> 1, # looking for function name + STATE_BODY_MAYBE =3D> 2, # body - or maybe more description + STATE_BODY =3D> 3, # the body of the comment + STATE_BODY_WITH_BLANK_LINE =3D> 4, # the body, which has a blank line + STATE_PROTO =3D> 5, # scanning prototype + STATE_DOCBLOCK =3D> 6, # documentation block + STATE_INLINE =3D> 7, # gathering doc outside main block }; my $state; my $in_doc_sect; @@ -1987,6 +1988,12 @@ sub process_body($$) { } } =20 + if ($state =3D=3D STATE_BODY_WITH_BLANK_LINE && /^\s*\*\s?\S/) { + dump_section($file, $section, $contents); + $section =3D $section_default; + $contents =3D ""; + } + if (/$doc_sect/i) { # case insensitive for supported section names $newsection =3D $1; $newcontents =3D $2; @@ -2040,18 +2047,21 @@ sub process_body($$) { $state =3D STATE_PROTO; $brcount =3D 0; } elsif (/$doc_content/) { - # miguel-style comment kludge, look for blank lines after - # @parameter line to signify start of description if ($1 eq "") { - if ($section =3D~ m/^@/ || $section eq $section_context) { + if ($section eq $section_context) { dump_section($file, $section, $contents); $section =3D $section_default; $contents =3D ""; $new_start_line =3D $.; + $state =3D STATE_BODY; } else { + if ($section ne $section_default) { + $state =3D STATE_BODY_WITH_BLANK_LINE; + } else { + $state =3D STATE_BODY; + } $contents .=3D "\n"; } - $state =3D STATE_BODY; } elsif ($state =3D=3D STATE_BODY_MAYBE) { # Continued declaration purpose chomp($declaration_purpose); @@ -2203,7 +2213,8 @@ sub process_file($) { process_normal(); } elsif ($state =3D=3D STATE_NAME) { process_name($file, $_); - } elsif ($state =3D=3D STATE_BODY || $state =3D=3D STATE_BODY_MAYBE) { + } elsif ($state =3D=3D STATE_BODY || $state =3D=3D STATE_BODY_MAYBE || + $state =3D=3D STATE_BODY_WITH_BLANK_LINE) { process_body($file, $_); } elsif ($state =3D=3D STATE_INLINE) { # scanning for inline parameters process_inline($file, $_); --=20 2.26.2