From patchwork Thu Feb 22 12:15:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10235473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D3668602DC for ; Thu, 22 Feb 2018 12:19:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB7B928C03 for ; Thu, 22 Feb 2018 12:19:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD34428C05; Thu, 22 Feb 2018 12:19:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C04A28C03 for ; Thu, 22 Feb 2018 12:19:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=roJb8Q6lU/CRzfJ7xqTUooyCq9LtY2dzZnNvqBnnsfc=; b=XPxZ4LVeUD4KWn5L5w1GQA93U8 8eIu+dI1TSHHvEMdIKCswdUkOSa+iLrZyJrRGS0Mh917SDFGcE/tHbwPDcHiwJazSS0ZUPDtj8xP+ dzpkH4XV/oOXlIniAft7l7xshM37wJYiwUcshxLRElxhsA5Z0JaR+Bv5Me0mS20Ldb8DyhBTSptpJ BwHp6154VZ21I4+ufgACaTxq5znrmpYLa2mT4gBNz9lG1v2DJfhBHe4KPDCvX2tMcTGA2v2hB7wh/ 8xqYJ6Le83GWAvt+pDLV7108ZcvLJRUMxWqpKnvmkwevzohfrGgIIuwwVNFmErT7CqI6jdeyQuQuO tn/qhL1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eopqE-00042n-2e; Thu, 22 Feb 2018 12:19:14 +0000 Received: from conuserg-10.nifty.com ([210.131.2.77]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eopnW-0002U1-Ca for linux-arm-kernel@lists.infradead.org; Thu, 22 Feb 2018 12:16:31 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w1MCFdUI020774; Thu, 22 Feb 2018 21:15:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w1MCFdUI020774 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1519301751; bh=OODoCNzKccripyzjGugdv2zqywwlJRBm39YrW6b3xS0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HZCUg7uZjIntjiJ0UCB79Llomk+whEGKU4Y5HhN+FxaiInggpDKytl0yVyW1tQ2jX ci7UVrGmvWL+WOBK8iVZ0gWCNTFFVB4oTdJqDiSuXw+YskAoeSViqdC7CJDtQG05pz 8FU+O9SX0+yCr9R9kNgTMcteDglil50XjpQSsw+87MbxR8oysi1Y3Jr8Dusqajscnk 3kv7AeC+WWItfCgK/tiwP7y4OaSbHOULRy/uDWoEHrZxKAwU+fhSABAT9IQ9ypgK/m Dl5TV4DjGVzDG6pBHARzGaFfYA3aKAMdhG2EUg82JZKFTvIi+6xWMWPIwuxUIxNelK g7vR4HchWPVHQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Subject: [PATCH v3 5/5] linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly Date: Thu, 22 Feb 2018 21:15:15 +0900 Message-Id: <1519301715-31798-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519301715-31798-1-git-send-email-yamada.masahiro@socionext.com> References: <1519301715-31798-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180222_041626_851484_98F98984 X-CRM114-Status: GOOD ( 11.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Howells , Masahiro Yamada , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 mostly used in kernel-space since it is handy to share headers between C and assembly. If we only need '2.', we can improve the existing BIT() for use in assembly, allowing us to avoid unnecessary underscore prefixes. Signed-off-by: Masahiro Yamada --- V2: https://patchwork.kernel.org/patch/9498271/ Changes in v3: None Changes in v2: None include/linux/bitops.h | 3 +-- include/linux/const.h | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 4cac4e1..8a856be 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -1,11 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0 */ #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 */