Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp313725pxu; Tue, 6 Oct 2020 07:07:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUQ6DVELrCrtsm0HWeZaaBuunbsK8izoeM8CfahfVwxfyYnC1Vw/IxpyVA7SZeN+lUoXb1 X-Received: by 2002:a17:906:32da:: with SMTP id k26mr5775019ejk.354.1601993239764; Tue, 06 Oct 2020 07:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601993239; cv=none; d=google.com; s=arc-20160816; b=CHCscm9QiuF3mLYzvyHFtxXhjiVuTqPFsg0Hh4PP8pPr/HQUnkh3Cj9G8uBXSsJ0vo gSTxIMHA0imjq3MfdcGYbg9yYaQkRFMbVA6uhEfpy4bpFykoMgtR3hw0QJoKmw08tOwi ll31FPbqDZ7H8++fYe7AfaCVrXzHht6QvvJwpACuX4PLFgnlg3lG/0Ay4HXb4hrqLlMG YjV8SBnVRYNscOEkcrq75OnbX3n9HRNOfjyOp73+NZ9obYxMS6iXHefT9BfSAsXVjiR3 ye3JFVmAg/7Yz2TeLs6Ah5eBeaQMp2gL6sgVMUyEP+utjU3WSAzV13OGTLH7sAyPRXn1 /rbw== 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=038kfUgkPxk4D0hyK/t+TOh4ID62ogTFUZ4HKTmsKAE=; b=RbgBfN57CcDSLLG+0rsE5t0rayrDkgc3vT4xvMdze73PBAgepy/jtyU7wQTog1rfq8 80wuYdz+NXI1eg61Vd6XdM8OXikC33S1iNppJdrwRodw7RXJ71nLQKcAzrHhl/d28FY1 3101QaZkNRfEJZJKq8IG1AWZl89XpZVOSPnbVIDyeA88cGbUsMQ8oBzmN2u1/E3CYe4f 5dvuFqJKYEhSOFwkDlqvj8yO3L3XSf7hlxNvDz55McKxtJlvP2bcvrjZjRr8HyyIoNsS olZ0fsd/7vKWCXqyjzSby0p+ur/WhULdS5geub7L1mkC1BocKnOaVDVCZv/rPBhUuRa6 K4AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xWRKtIRn; 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 p15si2433232edy.474.2020.10.06.07.06.47; Tue, 06 Oct 2020 07:07:19 -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=xWRKtIRn; 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 S1726786AbgJFOFC (ORCPT + 99 others); Tue, 6 Oct 2020 10:05:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:33530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726551AbgJFOD4 (ORCPT ); Tue, 6 Oct 2020 10:03:56 -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 1633723718; Tue, 6 Oct 2020 14:03:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601993035; bh=7ozHOFOhTxOMv4Cj9/DZtWCYE/TGvOymYMA5/4LPf1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xWRKtIRnoocJiQuPQHdXVrCZFsRQNlsXOK+3gA1/CL056+twRe3RNIm9C8UcEV6uU Vz/i7OXMNkHOHgR3NK6LsK5zPpU9F7s8EZg+cAAZtFgKHhaLlRdpsSu+RTbFt43VH2 1m25ovxatq77D5qvYbM1cG0pGu3uiBd9LPZ581ec= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1kPnZJ-0019Gq-6l; Tue, 06 Oct 2020 16:03:53 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v5 51/52] docs: conf.py: fix c:function support with Sphinx 3.x Date: Tue, 6 Oct 2020 16:03:48 +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 Sphinx C parser for the C domain is now more pedantic when trying to identify the function types. That prevents scope macros to be used as type defines. Yet, since 3.0.2, it is possible to provide it a list of such macros. Add them, in order to solve several Sphinx 3.x warnings. Signed-off-by: Mauro Carvalho Chehab --- Documentation/conf.py | 65 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index 3875401486de..b402bd8f6f71 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -47,9 +47,68 @@ extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', # if major >= 3: sys.stderr.write('''WARNING: The kernel documentation build process - does not work correctly with Sphinx v3.0 and above. Expect errors - in the generated output. - ''') + does not work correctly with Sphinx v3.0 and above. Expect errors + in the generated output. + ''') + if minor > 0 or patch >= 2: + # Sphinx c function parser is more pedantic with regards to type + # checking. Due to that, having macros at c:function cause problems. + # Those needed to be scaped by using c_id_attributes[] array + c_id_attributes = [ + # GCC Compiler types not parsed by Sphinx: + "__restrict__", + + # include/linux/compiler_types.h: + "__iomem", + "__kernel", + "noinstr", + "notrace", + "__percpu", + "__rcu", + "__user", + + # include/linux/compiler_attributes.h: + "__alias", + "__aligned", + "__aligned_largest", + "__always_inline", + "__assume_aligned", + "__cold", + "__attribute_const__", + "__copy", + "__pure", + "__designated_init", + "__visible", + "__printf", + "__scanf", + "__gnu_inline", + "__malloc", + "__mode", + "__no_caller_saved_registers", + "__noclone", + "__nonstring", + "__noreturn", + "__packed", + "__pure", + "__section", + "__always_unused", + "__maybe_unused", + "__used", + "__weak", + "noinline", + + # include/linux/memblock.h: + "__init_memblock", + "__meminit", + + # include/linux/init.h: + "__init", + "__ref", + + # include/linux/linkage.h: + "asmlinkage", + ] + else: extensions.append('cdomain') extensions.append('automarkup') -- 2.26.2