Use _AC and UL macros from linux/const.h
authorBaruch Siach <baruch@tkos.co.il>
Sun, 11 Nov 2018 10:31:01 +0000 (12:31 +0200)
committerStefan Roese <sr@denx.de>
Tue, 20 Nov 2018 12:08:15 +0000 (13:08 +0100)
Drop the _AC and UL macros from common.h. Linux headers is the original
source of this macro, so keep its definition in the same header.

Update existing users of these macros to include const.h directly.

Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Rick Chen <rick@andestech.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
arch/arm/include/asm/armv8/mmu.h
arch/mips/include/asm/mach-generic/spaces.h
arch/riscv/include/asm/csr.h
include/common.h

index 62d00d1..4a57320 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _ASM_ARMV8_MMU_H_
 #define _ASM_ARMV8_MMU_H_
 
+#include <linux/const.h>
+
 /*
  * block/section address mask and size definitions.
  */
index b7eac32..539d0a5 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef _ASM_MACH_GENERIC_SPACES_H
 #define _ASM_MACH_GENERIC_SPACES_H
 
-#include <asm/const.h>
+#include <linux/const.h>
 
 /*
  * This gives the physical RAM offset.
index 50fccea..29624fd 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef _ASM_RISCV_CSR_H
 #define _ASM_RISCV_CSR_H
 
+#include <linux/const.h>
+
 /* Status register flags */
 #define SR_SIE         _AC(0x00000002, UL) /* Supervisor Interrupt Enable */
 #define SR_SPIE                _AC(0x00000020, UL) /* Previous Supervisor IE */
index 8b9f859..3f69943 100644 (file)
@@ -14,9 +14,6 @@ typedef volatile unsigned long        vu_long;
 typedef volatile unsigned short vu_short;
 typedef volatile unsigned char vu_char;
 
-/* Allow sharing constants with type modifiers between C and assembly. */
-#define _AC(X, Y)       (X##Y)
-
 #include <config.h>
 #include <errno.h>
 #include <time.h>
@@ -541,16 +538,10 @@ int cpu_release(u32 nr, int argc, char * const argv[]);
 
 #else  /* __ASSEMBLY__ */
 
-/* Drop a C type modifier (like in 3UL) for constants used in assembly. */
-#define _AC(X, Y)       X
-
 #endif /* __ASSEMBLY__ */
 
 /* Put only stuff here that the assembler can digest */
 
-/* Declare an unsigned long constant digestable both by C and an assembler. */
-#define UL(x)           _AC(x, UL)
-
 #ifdef CONFIG_POST
 #define CONFIG_HAS_POST
 #ifndef CONFIG_POST_ALT_LIST