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: 10235477 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 AF5A4602DC for ; Thu, 22 Feb 2018 12:20:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA01128BC2 for ; Thu, 22 Feb 2018 12:20:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D8CE28C05; Thu, 22 Feb 2018 12:20:30 +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=unavailable 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 7335728BC2 for ; Thu, 22 Feb 2018 12:20:15 +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=fPMuFPd357Y/Fz0705dnzBX0MWYl5IfVMOCXSpoXeR8=; b=hsgSfgiD6JvzHh31/oiJSHHJAo AyRSVmQeIQ2p1Ylf2e28RwYdshPOTI03PttStzeGEQaUbJGIBR2cwKp+SgFkZGg0tQzhH0fuLCmwP 6kYAjCkyH7L5a7V/82p3G/Wg4Np5WkaP8uf/vAVU1FbNM3ETStwqE/t6MbIITcrL7KgHdoCoF+a6c YNzYhFKmMhay1ybyQtN+7F82rsV6nDIpRt3KJ12kb0AGq7MBFdqZluwD3XrmoObb7+yvJ2XyOczI3 WKC+SflRItgv6GOnEmzhP28IqTD/2D2wG98yqNb+QjtC5cI2lnj2Rqs2DA/UHkSxBb+iQn26i0ji/ oZ3+z88A==; 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 1eopqr-0004Oa-Q3; Thu, 22 Feb 2018 12:19:53 +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-0002Up-Gh 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 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180222_041626_846806_46292672 X-CRM114-Status: GOOD ( 14.73 ) 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: Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, Russell King , David Howells , Masahiro Yamada , Guan Xuetao , 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 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 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))