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: 129227 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp1937451edc; Thu, 22 Feb 2018 04:18:36 -0800 (PST) X-Google-Smtp-Source: AH8x225wMfTkW8OhgLNGie65+iLnWNi7L/ED0awjuH4oByavbQPaZTco9q8SYKRgs3QxTd7rcfRz X-Received: by 10.99.125.92 with SMTP id m28mr5597048pgn.257.1519301916601; Thu, 22 Feb 2018 04:18:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519301916; cv=none; d=google.com; s=arc-20160816; b=UywlQy+Yf9SKn6VdgJ6MdWTKRhmm3oJKm7esJb/Xmo8a+ZwB4VjihpC20IfOf8Tg9w xcDed7a0rlqaNyTp4YFWa3YDQHnSAg5Is1pGSCN9kE60EsnYMHRKQYAQJXLsscwVaAu+ 5htfyp9IsqI7HxOC5CHUoGXDfzhL12Fc5WLcBvcQZD3MK5zAowF2qTKrDh8bSdKqunbj ChUhkENN4Ss6TBpRFT8+RGoGjS1XYDfp1TJYRtwjMqEJyXKAwNFVJK4i3mlmCJknqJNd PnlK5Od9heR9VkBs0UFpk3pGgjLkxFm5UwWx8iAHqBQyOr+YHxhot2EIMJblRG2d+J6P ULQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=OODoCNzKccripyzjGugdv2zqywwlJRBm39YrW6b3xS0=; b=h/j7d4mKOHuxBpnb25gJUUSaNb8oixQHtx81+jpFzYrhexVGpRY7s4IKF5brGdWd+f wU3JGbEUAZy5wVhFCQzk9Ul8srMaVllDFEblVN/wtNR+3vkt9uK9uVDi3FyIuM5bkbhS eSSlvkYFHyOCrdvAssT0OjXPU/DZmCrgjyrzzgG358VKlqTiA1TU86RtF303p4IXTr9+ MyqwMXDuYH/IZHiME9UuFnapb/RTcIUS6Za2KlVZ0aChP8GRR0FnPWkJl8rvwgELaJUe TVzOmRj1V+gsrw0PslSOQvHeY47tYmRAr9UoEBMvI1fh5IBgvpfqKCs4ETXD9q3dG+ee 5q2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HZCUg7uZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r13-v6si1505434plj.141.2018.02.22.04.18.36; Thu, 22 Feb 2018 04:18:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HZCUg7uZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932377AbeBVMQj (ORCPT + 28 others); Thu, 22 Feb 2018 07:16:39 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:61711 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932316AbeBVMQf (ORCPT ); Thu, 22 Feb 2018 07:16:35 -0500 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 Cc: David Howells , linux-arm-kernel@lists.infradead.org, Masahiro Yamada , linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 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(-) -- 2.7.4 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 */