From patchwork Wed Jan 4 08:55:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 89783 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp8394395qgi; Wed, 4 Jan 2017 00:58:25 -0800 (PST) X-Received: by 10.98.204.17 with SMTP id a17mr59696198pfg.150.1483520305339; Wed, 04 Jan 2017 00:58:25 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 33si71808187ply.304.2017.01.04.00.58.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jan 2017 00:58:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOhNm-00011Q-Eo; Wed, 04 Jan 2017 08:57:18 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOhNh-0000xT-Kg for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2017 08:57:15 +0000 Received: from pug.jp.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id v048u1dK002604; Wed, 4 Jan 2017 17:56:07 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v048u1dK002604 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1483520168; bh=+RIdiQX5UFl8JSzZ7RWu8JT7kkCPKGWmPjTitwS4JmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uxj2adnNK5iYYUFRTK0gmDiIJfPJqsRLfdLyy3XffkEhgYH+1RnckhpqvlFktders D+Kt4EIiR39j55d6t+p02HiTILXPYFT9lVEJoC8xDylW7DSMiXdC9FLGlLTKD3Moln q3vSTerR92SJLjmxyreVsTNpKlCTe3H4lgeafdv9C6xl03QkeN3LXGC7i7t9eEvfeH YOdUfSgf+gyfX2xXTsK/7hYfGbP0gjdVfiJnlO3wddLaDojLwX7iGT6CGbPbMjVBNt rXB05R09JJ8foS9IOnbR58avUVnRRsUT4yy6n0HsBM2Sr0LcVsEalPCoTPjymig2hg eVaV+NtLp2ZhA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Subject: [PATCH 3/3] linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly Date: Wed, 4 Jan 2017 17:55:27 +0900 Message-Id: <1483520127-29316-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483520127-29316-1-git-send-email-yamada.masahiro@socionext.com> References: <1483520127-29316-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170104_005714_082294_0B9D2EFA X-CRM114-Status: GOOD ( 12.32 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Shaohua Li , Arnd Bergmann , Masahiro Yamada , Catalin Marinas , x86@kernel.org, Will Deacon , Russell King , NeilBrown , linux-kernel@vger.kernel.org, David Howells , Olof Johansson , Ingo Molnar , zijun_hu , Guoqing Jiang , "H . Peter Anvin" , Srinivas Pandruvada , Thomas Gleixner , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Commit 2fc016c5bd8a ("linux/const.h: Add _BITUL() and _BITULL()") introduced _BITUL() and _BITULL(). Its git-log says the difference from the already existing BIT() are: 1. The namespace is such that they can be used in uapi definitions. 2. The type is set with the _AC() macro to allow it to be used in assembly. 3. The type is explicitly specified to be UL or ULL. However, I found _BITUL() is often used for "2. use in assembly", while "1. use in uapi" is unneeded. If we address only "2.", we can improve the existing BIT() for that. It will allow us to replace many _BITUL() instances with BIT(), i.e. avoid needless use of underscore-prefixed macros, in the end, for better de-couple of userspace/kernel headers. Signed-off-by: Masahiro Yamada --- include/linux/bitops.h | 3 +-- include/linux/const.h | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/include/linux/bitops.h b/include/linux/bitops.h index a83c822..5f45fa5 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -1,10 +1,9 @@ #ifndef _LINUX_BITOPS_H #define _LINUX_BITOPS_H +#include #include #ifdef __KERNEL__ -#define BIT(nr) (1UL << (nr)) -#define BIT_ULL(nr) (1ULL << (nr)) #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) #define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) diff --git a/include/linux/const.h b/include/linux/const.h index 7b55a55..200892d 100644 --- a/include/linux/const.h +++ b/include/linux/const.h @@ -6,4 +6,7 @@ #define UL(x) (_UL(x)) #define ULL(x) (_ULL(x)) +#define BIT(x) (_BITUL(x)) +#define BIT_ULL(x) (_BITULL(x)) + #endif /* _LINUX_CONST_H */