From patchwork Thu Feb 22 12:15:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 129224 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp1936304edc; Thu, 22 Feb 2018 04:17:21 -0800 (PST) X-Google-Smtp-Source: AH8x2263o1o7Krpd2Ss6YTf9NvXKjnu2hPc5JLk2C9OcfFS4bBRjJWtdQXrkbvP2IWhwK9nZrzzh X-Received: by 10.98.138.66 with SMTP id y63mr6757025pfd.12.1519301841521; Thu, 22 Feb 2018 04:17:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519301841; cv=none; d=google.com; s=arc-20160816; b=FDMy93J+HF4+ukFaMaCDjwiOUC7X/4Y5L9ifMSJW7bY4eb8hEOZM9r/bQDWF49VuvG /gppC6f0KGJT2PUIqN0Zy8X5vTaLNEtlPdgRHirw2Wd3M9JCj5ewoWud5LjD2mvz2p3u oh4wm7CDbl13MvrCk/ijTijLZaFcEivHtyFjDnxMKmEeEm4dSg41MRt1MNPjNe62XFWI fldrUE6SaksAJc24uBsFhrbiLwykjr/TBXJjlwLIKMdR+pf7tSMzhC2ajisBHYarJHkX Ey+c2bn8waOQpg9fdWxZvjOwRINnG35ELhuIWxFYbUpBVchMxBy/Fx9suB0i2iNMOIJa D77A== 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=E9EX6i0PEyHhg4sg+u434t4COh6n5wv4gTCzms5BId0=; b=YFvM1uv3YXIsVVlgGDcSf8i0J5zTHxYMEtvvNSsuYyzf7CLgqoCMeHBwnal2csyOoI uPS9ldoguHMdR6Q6+t6r40bAHsXOGek1v4SUnjKfTCf0a9xwMD5Bja1A8PKFyyq7SFWZ O2PjBF1XCp7XmqmnK6qZdCiAI4WrMxwuwJidbjN7lpWZGHTsDrqaR7MOodUVeN2HL3ln 0f6NwTrsfl+LFMd5PAGUx8t4gC3OOXo5GmJIkkn6LCZeC1Wo+piIMRrId+/JJsCL29Nl 6jfNQ/MfoVwk8zb3GhFk884OqxRrkxEGddI8kcYgDxMJ30yYvtBMeTswOHxl/EEXTLwG ZHBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=1TtD0ymU; 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 l18si2829403pgn.339.2018.02.22.04.17.21; Thu, 22 Feb 2018 04:17:21 -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=1TtD0ymU; 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 S932451AbeBVMRR (ORCPT + 28 others); Thu, 22 Feb 2018 07:17:17 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:62858 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753806AbeBVMRQ (ORCPT ); Thu, 22 Feb 2018 07:17:16 -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 w1MCFdUG020774; Thu, 22 Feb 2018 21:15:46 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w1MCFdUG020774 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1519301748; bh=E9EX6i0PEyHhg4sg+u434t4COh6n5wv4gTCzms5BId0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1TtD0ymUV8EJv+9iLXJDUQpb87KhBo2/zP+78LFs9n0ALLWrMuI06sCJAobJ4+xP1 1kCZplE22Y8O2sIFVH8lpwxMUNgg56YQJTSai8AZg8UABuDLeS+s4iT2V66GTnSjAF rzgQbSQUW3AqlJcKRBFiAE4y8Arz+t4Rgf7jY2H9SvT84n5nwvElaukOD6O0Tm+fc0 4FELsuddalTXA5i8IrHQdV1IyH4b+dwVbzihB18/j1ErJsHdS7SDdz6mql0qp0Nz/O E/J3uFPNeSebKqSh7clTssmtrgNyRWa3FmEGy+8IBRbIJtVaJhPdGi0ukoEiN5jD2M DD+8tO3N4MUWg== 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, Guan Xuetao , Will Deacon , Catalin Marinas , Russell King Subject: [PATCH v3 3/5] linux/const.h: move UL() macro to include/linux/const.h Date: Thu, 22 Feb 2018 21:15:13 +0900 Message-Id: <1519301715-31798-4-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 ARM, ARM64 and UniCore32 duplicate the definition of UL(): #define UL(x) _AC(x, UL) This is not actually arch-specific, so it will be useful to move it to a common header. Currently, we only have the uapi variant for linux/const.h, so I am creating include/linux/const.h. I also added _UL(), _ULL() and ULL() because _AC() is mostly used in the form either _AC(..., UL) or _AC(..., ULL). I expect they will be replaced in follow-up cleanups. The underscore-prefixed ones should be used for exported headers. Signed-off-by: Masahiro Yamada Acked-by: Guan Xuetao Acked-by: Catalin Marinas Acked-by: Russell King --- V2: https://patchwork.kernel.org/patch/9498275/ Changes in v3: None Changes in v2: None arch/arm/include/asm/memory.h | 6 ------ arch/arm64/include/asm/memory.h | 6 ------ arch/unicore32/include/asm/memory.h | 6 ------ include/linux/const.h | 9 +++++++++ include/uapi/linux/const.h | 3 +++ 5 files changed, 12 insertions(+), 18 deletions(-) create mode 100644 include/linux/const.h -- 2.7.4 diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 4966677..ed8fd0d 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -22,12 +22,6 @@ #include #endif -/* - * Allow for constants defined here to be used from assembly code - * by prepending the UL suffix only with actual C code compilation. - */ -#define UL(x) _AC(x, UL) - /* PAGE_OFFSET - the virtual address of the start of the kernel image */ #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 50fa96a..49d9921 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -29,12 +29,6 @@ #include /* - * Allow for constants defined here to be used from assembly code - * by prepending the UL suffix only with actual C code compilation. - */ -#define UL(x) _AC(x, UL) - -/* * Size of the PCI I/O space. This must remain a power of two so that * IO_SPACE_LIMIT acts as a mask for the low bits of I/O addresses. */ diff --git a/arch/unicore32/include/asm/memory.h b/arch/unicore32/include/asm/memory.h index 3bb0a29..66bb9f6 100644 --- a/arch/unicore32/include/asm/memory.h +++ b/arch/unicore32/include/asm/memory.h @@ -20,12 +20,6 @@ #include /* - * Allow for constants defined here to be used from assembly code - * by prepending the UL suffix only with actual C code compilation. - */ -#define UL(x) _AC(x, UL) - -/* * PAGE_OFFSET - the virtual address of the start of the kernel image * TASK_SIZE - the maximum size of a user space task. * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area diff --git a/include/linux/const.h b/include/linux/const.h new file mode 100644 index 0000000..7b55a55 --- /dev/null +++ b/include/linux/const.h @@ -0,0 +1,9 @@ +#ifndef _LINUX_CONST_H +#define _LINUX_CONST_H + +#include + +#define UL(x) (_UL(x)) +#define ULL(x) (_ULL(x)) + +#endif /* _LINUX_CONST_H */ diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h index c5a60eb..09bc0e0 100644 --- a/include/uapi/linux/const.h +++ b/include/uapi/linux/const.h @@ -22,6 +22,9 @@ #define _AT(T,X) ((T)(X)) #endif +#define _UL(x) (_AC(x, UL)) +#define _ULL(x) (_AC(x, ULL)) + #define _BITUL(x) (_AC(1,UL) << (x)) #define _BITULL(x) (_AC(1,ULL) << (x))