From patchwork Wed Mar 23 23:05:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12790206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CF9EC433EF for ; Wed, 23 Mar 2022 23:05:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 00EE36B007B; Wed, 23 Mar 2022 19:05:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EFFA68D0002; Wed, 23 Mar 2022 19:05:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC8466B007E; Wed, 23 Mar 2022 19:05:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id C6C666B007D for ; Wed, 23 Mar 2022 19:05:37 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A3D727B6 for ; Wed, 23 Mar 2022 23:05:37 +0000 (UTC) X-FDA: 79277184714.01.6EDAED6 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf31.hostedemail.com (Postfix) with ESMTP id 2F78420029 for ; Wed, 23 Mar 2022 23:05:37 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6A85BB82182; Wed, 23 Mar 2022 23:05:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28A5DC340E9; Wed, 23 Mar 2022 23:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1648076733; bh=huRtLd3IyAZiFcvOlbKYywi3pZj0ri9nk+6yuVYFGUM=; h=Date:To:From:In-Reply-To:Subject:From; b=YIm6DHiilnPB3zgKvBeimHM3MgU8Vhs+kHN9R4MwYfbhDPn8aT/jtyEKas19Oh1bg oItp3+oaI/RLslHXEE0K0I267/A7CSGIf5Bt9mOv4LLq8nq54eVGv1RMNYFa5GCv52 1/9n9ieojojiMvMy9Kg2qpiAmyiRPZr312wMSKyo= Date: Wed, 23 Mar 2022 16:05:32 -0700 To: ndesaulniers@google.com,nathan@kernel.org,mst@redhat.com,corbet@lwn.net,bhelgaas@google.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220323160453.65922ced539cbf445b191555@linux-foundation.org> Subject: [patch 05/41] Documentation/sparse: add hints about __CHECKER__ Message-Id: <20220323230533.28A5DC340E9@smtp.kernel.org> Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=YIm6DHii; spf=pass (imf31.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 2F78420029 X-Stat-Signature: 71crc5f6rmh36yuc44udb9trum8jipzo X-HE-Tag: 1648076737-887009 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Bjorn Helgaas Subject: Documentation/sparse: add hints about __CHECKER__ Several attributes depend on __CHECKER__, but previously there was no clue in the tree about when __CHECKER__ might be defined. Add hints at the most common places (__kernel, __user, __iomem, __bitwise) and in the sparse documentation. Link: https://lkml.kernel.org/r/20220310220927.245704-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: "Michael S . Tsirkin" Signed-off-by: Andrew Morton --- Documentation/dev-tools/sparse.rst | 2 ++ include/linux/compiler_types.h | 1 + include/uapi/linux/types.h | 1 + 3 files changed, 4 insertions(+) --- a/Documentation/dev-tools/sparse.rst~documentation-sparse-add-hints-about-__checker__ +++ a/Documentation/dev-tools/sparse.rst @@ -100,3 +100,5 @@ have already built it. The optional make variable CF can be used to pass arguments to sparse. The build system passes -Wbitwise to sparse automatically. + +Note that sparse defines the __CHECKER__ preprocessor symbol. --- a/include/linux/compiler_types.h~documentation-sparse-add-hints-about-__checker__ +++ a/include/linux/compiler_types.h @@ -4,6 +4,7 @@ #ifndef __ASSEMBLY__ +/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */ #ifdef __CHECKER__ /* address spaces */ # define __kernel __attribute__((address_space(0))) --- a/include/uapi/linux/types.h~documentation-sparse-add-hints-about-__checker__ +++ a/include/uapi/linux/types.h @@ -19,6 +19,7 @@ * any application/library that wants linux/types.h. */ +/* sparse defines __CHECKER__; see Documentation/dev-tools/sparse.rst */ #ifdef __CHECKER__ #define __bitwise __attribute__((bitwise)) #else