Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp316395pxu; Tue, 6 Oct 2020 07:10:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzhrs9gb0/Qj+sh4lpm6bvvczoKbTSvhYuSb0ur257ApyGPG3NcPRKSUhliIzv0ZV74Ebu X-Received: by 2002:a17:906:4d57:: with SMTP id b23mr5430286ejv.496.1601993417659; Tue, 06 Oct 2020 07:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601993417; cv=none; d=google.com; s=arc-20160816; b=i/l94Y7hOT1+2Zn2NYO4kbmWzHv14MRAavQGinUD7g1IAqhi1ranyKOLxgD27F+D6D am1+LBqCJZXThJTIj9aAy8FPTB1V967ypqBxe3FnbLYX2NCkQFeyOK5Py1raHBpZYVoh wibEYE8eHbC1DSsKeUu0J9FArjMAQ3+dR5mzU2LHhcv1Jwp4yAowoqf54m9smK7xRgWE FCAtBk4XHXlbE6l9y0e/KYLQg7afPlg7xi958fZn8q7Id2Oq9KXcphYKhoeHvo3Mk7nJ 1ZWeSIzMiI7b1iMpUOk2oTj5HvPOOZ5p5d5ysWroEFY92mdO6CtfPcblw9wrxQxc0Czw 2gSg== 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=4Bar5scgfHdgWQhB/CPxSOnPiNF9b2VaGRe8S6Wp0HM=; b=d3Y4SBR8zmkZyUvTsjIkHaYtMzqqAsnp6NbgjrE3CP04WMSfYlfhtEHGcjV4bNeaZI 7gtjMVyy8atdAOhoKcuZ4uDm8z0yfP1MR3zZwEgZNHB95Gu2wgrfWXZFLbUi8JyvakTF NRlhkpxfOk1+GWD/rgnxz8PjdPUVWffY6SljNFdw5IwbNOwSo7ODgeKDGGaZdvNc2ZHS bHS3PuEsUR/1nUGZESX9EdxwXTNwdE52tRdTgGy7BgsfqdSkl2aY3vs+O6lgJSBDjSXz HmUglabUCkn8mDJy37zsruCfXItVILFedwHea0usnokEIs3tFvPO+Z47Pgdzt3GYw8bC 5wog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ztrQBk1G; 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 df7si2979051edb.271.2020.10.06.07.09.54; Tue, 06 Oct 2020 07:10:17 -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=ztrQBk1G; 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 S1727132AbgJFOHf (ORCPT + 99 others); Tue, 6 Oct 2020 10:07:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:33130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbgJFODy (ORCPT ); Tue, 6 Oct 2020 10:03:54 -0400 Received: from mail.kernel.org (ip5f5ad5bd.dynamic.kabel-deutschland.de [95.90.213.189]) (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 6882F207EA; Tue, 6 Oct 2020 14:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601993033; bh=u0Ejw1NVIXMtPdidzb9uDuQjyovU4BtMfQmfTFTMrZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ztrQBk1GT4cz/v2OncBiplVlQfmgzUnDzcrAE5Sza0Yb+09ewjXtYRK/kYMjl0ALU PmQUhFnBNf22mo9mLavIjt2L/njmjj91ntVIIrLbIo0xQp+Hjkk0Nc7EAPP/6KX8sH 2AyHDM6KPHtHxbAUgKlXeSqXj8d1HW8cm7E+Sek8= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1kPnZH-0019Eg-5d; Tue, 06 Oct 2020 16:03:51 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v5 05/52] scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x Date: Tue, 6 Oct 2020 16:03:02 +0200 Message-Id: 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 096317ef2e97..d9783c98f33b 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