Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4571897pxk; Wed, 30 Sep 2020 06:32:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN5Gvt1ntXN3CZFTdc2zhoEGLmtCjxWSQ7nS9t2Hhk5uZjtDS9VAJxQkhji1LT6vVUHyJz X-Received: by 2002:a17:906:370a:: with SMTP id d10mr2954625ejc.393.1601472758898; Wed, 30 Sep 2020 06:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601472758; cv=none; d=google.com; s=arc-20160816; b=IjPZoP2L9loL0g8CWLDr57eNz3BhPSojrpYYf0e8dKgE1yayZxA0Yc0tQFpW8o7YGr pvGmt0U4Xr0DQiX8nB1OX0R68z7AqFTfMEFly1RT0TWpFeyccvUv4ttg2HzYOeT9cTuY lk3coI0jUGnIVR6qSnGhAOpYHX5LBUUWu8ssADDkmnVjTeWRXyZfME3heBdSnbXj/bSZ 9+OuON5OYA1YTA1He+Yazzccwmq6Lp8ycTXaYQsE0FniPUe/r8pnS1p+Oubnq1S2+Ccc UolItg+Ld0ifDlerMEZNETzh8XMfgy9kKxiPD7hlzx4XhnVI+USnMlT3wU+y4r5mVB4Y h5pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4HbBONC8NBaD1X53oEUJ2vGRmFExRD8qcA3cEo92onI=; b=BvLDJ4rJB8Ky8ldqCPOHPxm6dbs+Natk2WebiWFfH/C2Pjw3ZshnFYVnACcnHMCUJo KneY0/NWCYtfhngb6tlV8lN5JWznQVSZfe77kjRvxXJDNoctyLqUtmdqQajiBLe396DQ vsZFp1zFAcLJWL2Ra+33bNePnu6xN18DrPAyMQv94Xvzl/HbI4CSlGEK44E7S4fw+geT f7TBe2en6GenE5yzeAp6OQFwNE/4c4FyHTNfqoAYJAt5BlE1DOJFiGCA7O8OwkFSfRo7 sSxBR1vppj/QCCbIsq95hwrEWpWuMx9VN/La5PekFHU1ozrRxEnoEJhTWZGjJBWmNzQ9 sE3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ri5iEeYH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s16si1015456edq.536.2020.09.30.06.32.16; Wed, 30 Sep 2020 06:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ri5iEeYH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730813AbgI3N20 (ORCPT + 99 others); Wed, 30 Sep 2020 09:28:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:38786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730173AbgI3NZU (ORCPT ); Wed, 30 Sep 2020 09:25:20 -0400 Received: from mail.kernel.org (ip5f5ad5c4.dynamic.kabel-deutschland.de [95.90.213.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF21520BED; Wed, 30 Sep 2020 13:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601472320; bh=dvscQSQ3r76uf25CRGEczXRFWyqPHOnByQGLKLyfwNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ri5iEeYHdlLH6ctBLppZjoXcudnE3yGnfa/Z/p3XUmmkhN8zsPhku1y4nvp+gYN+4 0ezxfKrWbuhTdB7DT4LniGUx/7TqLr7LVDP5fetV7AyscLocyupQln+mkTjpxGwA5F 0YyG8jCwmOARWJH+dQn0ZSt5SPTnfH8Y3IJB6Fhc= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1kNc6f-001XJ0-NM; Wed, 30 Sep 2020 15:25:17 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v4 05/52] scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x Date: Wed, 30 Sep 2020 15:24:28 +0200 Message-Id: <65003bc1c62d1e6108961fba18e3e734e23d5c86.1601467849.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unfortunately, Sphinx 3.x parser for c functions is too pedantic: https://github.com/sphinx-doc/sphinx/issues/8241 While it could be relaxed with some configurations, there are several corner cases that it would make it hard to maintain, and will require teaching conf.py about several macros. So, let's instead use the :c:macro notation. This will produce an output that it is not as nice as currently, but it should still be acceptable, and will provide cross-references, removing thousands of warnings when building with newer versions of Sphinx. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 3efc06d6f82d..e1140869b889 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -886,19 +886,29 @@ sub output_function_rst(%) { my $oldprefix = $lineprefix; my $start = ""; - if ($args{'typedef'}) { - if ($sphinx_major < 3) { + if ($sphinx_major < 3) { + if ($args{'typedef'}) { print ".. c:type:: ". $args{'function'} . "\n\n"; + print_lineno($declaration_start_line); + print " **Typedef**: "; + $lineprefix = ""; + output_highlight_rst($args{'purpose'}); + $start = "\n\n**Syntax**\n\n ``"; } else { - print ".. c:function:: ". $args{'function'} . "\n\n"; + print ".. c:function:: "; } - print_lineno($declaration_start_line); - print " **Typedef**: "; - $lineprefix = ""; - output_highlight_rst($args{'purpose'}); - $start = "\n\n**Syntax**\n\n ``"; } else { - print ".. c:function:: "; + print ".. c:macro:: ". $args{'function'} . "\n\n"; + + if ($args{'typedef'}) { + print_lineno($declaration_start_line); + print " **Typedef**: "; + $lineprefix = ""; + output_highlight_rst($args{'purpose'}); + $start = "\n\n**Syntax**\n\n ``"; + } else { + print "``"; + } } if ($args{'functiontype'} ne "") { $start .= $args{'functiontype'} . " " . $args{'function'} . " ("; @@ -925,7 +935,11 @@ sub output_function_rst(%) { if ($args{'typedef'}) { print ");``\n\n"; } else { - print ")\n\n"; + if ($sphinx_major < 3) { + print ")\n\n"; + } else { + print ")``\n"; + } print_lineno($declaration_start_line); $lineprefix = " "; output_highlight_rst($args{'purpose'}); -- 2.26.2