Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4568940pxk; Wed, 30 Sep 2020 06:28:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn7VjwTNbzKbLlMph8CS+2TikkFkrJtdf9p4dZulgvKkAFnpxpl/ybzNk721xFz0/yOAb/ X-Received: by 2002:a50:ed94:: with SMTP id h20mr2746694edr.184.1601472505543; Wed, 30 Sep 2020 06:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601472505; cv=none; d=google.com; s=arc-20160816; b=uSHExIDm03Cb2nT7If5yVWrJnS6sHyGxrFEt3bhuVF2d+hdi0Ek2Bz08D32Maj8jyN jAAxBPGAm/O50Q8fixkA6OZXlzBXLYGwBEeC52/bpXVMFjM+jZxgXRPDOb7CAHz9BLAh 61O5O6d/jiMOLnHz+VIbd5cQ/Zdo3ZkxKkX/3fcsXGlzaC+5huIn0jB+awRqih9PeaDX hnbJF2W57KAsf3HVOHmpACLXpopwg+zJrYyvjdG0VL8ClDGXMp6sZ2CjxHy51dBU+Yo7 CxNRB3axrPj4WPBG8F+WLfF2kQf6vLgFoxn4LLYa3aWtbZ9erDMF3+bHg8pJh4kk5C8q qFhA== 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=ttBrsiCyunFt0pqc5wbWXm6W+2R4fuuBHHG6OslbnBphkFK/XTlJ60etxwByuOhO3Y YjnCSBNhPoGMq3Q3hmhiaHrKSdym0Yv0qZl7QmuejNaz54AHzp2lhT/wXxMqed4pMPXp x96lWuL+Etz4B8sIltHbvu2eQl0BVIflOF7U2osgVBxSVrar+D/JuYFanb/K5c9ik0Y3 gPi15uN9Bd1VvOoJOYqadiSodUKSeS84aLf2z7AofX6vmm/xlLrSgM/0z+Li37H+Q+fu BxeYqIqE/PcwLM3bMdMKZ7+BUe6k5W9ThCGHgwBB8cDzPpqCGotBixbxlePKEvfo4hOl 67/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kH6YRLIX; 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 y3si1007871edr.538.2020.09.30.06.28.02; Wed, 30 Sep 2020 06:28:25 -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=kH6YRLIX; 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 S1730482AbgI3N0X (ORCPT + 99 others); Wed, 30 Sep 2020 09:26:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:39018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730271AbgI3NZW (ORCPT ); Wed, 30 Sep 2020 09:25:22 -0400 Received: from mail.kernel.org (unknown [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 C5F5123A9D; Wed, 30 Sep 2020 13:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601472321; bh=7ozHOFOhTxOMv4Cj9/DZtWCYE/TGvOymYMA5/4LPf1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kH6YRLIXG0T+EF2qq+qdoT31HHlo5LGEw77OoNXAcr9zMyv6HiD++hXk/eCkZnZvI QbEPuhElIjrbpRS8ow4NPCUZtgAzGz+Pb84zv0DGYkvqR8oNo29ZTxzfKoFnsumN7B +8NVEEblHdNzSnmp1GLMf1rn9q6+PF2KOZavonVg= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1kNc6h-001XLJ-VM; Wed, 30 Sep 2020 15:25:19 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v4 51/52] docs: conf.py: fix c:function support with Sphinx 3.x Date: Wed, 30 Sep 2020 15:25:14 +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