diff mbox series

[U-Boot,v3,3/5] Use _AC and UL macros from linux/const.h

Message ID f9f70a31169f5f860ca649ffcda53ade411b3ee8.1541679854.git.baruch@tkos.co.il
State Changes Requested
Delegated to: Tom Rini
Headers show
Series [U-Boot,v3,1/5] MIPS: drop asm/const.h | expand

Commit Message

Baruch Siach Nov. 8, 2018, 12:24 p.m. UTC
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>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
v3: New patch in this series
---
 arch/arm/include/asm/armv8/mmu.h            | 2 ++
 arch/mips/include/asm/mach-generic/spaces.h | 2 ++
 arch/riscv/include/asm/csr.h                | 2 ++
 include/common.h                            | 9 ---------
 4 files changed, 6 insertions(+), 9 deletions(-)

Comments

Tom Rini Nov. 8, 2018, 12:55 p.m. UTC | #1
On Thu, Nov 08, 2018 at 02:24:12PM +0200, Baruch Siach wrote:


> 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>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

I know you'll need to now drop the MIPS part but otherwise:

Reviewed-by: Tom Rini <trini@konsulko.com>
Rick Chen Nov. 9, 2018, 6:18 a.m. UTC | #2
> > > 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>
> > > Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> >
> > I know you'll need to now drop the MIPS part but otherwise:
> >
> > Reviewed-by: Tom Rini <trini@konsulko.com>
> >

Reviewed-by: Rick Chen <rick@andestech.com>

> > --
> > Tom
diff mbox series

Patch

diff --git a/arch/arm/include/asm/armv8/mmu.h b/arch/arm/include/asm/armv8/mmu.h
index 62d00d15c26d..4a573208dfd0 100644
--- a/arch/arm/include/asm/armv8/mmu.h
+++ b/arch/arm/include/asm/armv8/mmu.h
@@ -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.
  */
diff --git a/arch/mips/include/asm/mach-generic/spaces.h b/arch/mips/include/asm/mach-generic/spaces.h
index 85f5849abfbe..539d0a566d52 100644
--- a/arch/mips/include/asm/mach-generic/spaces.h
+++ b/arch/mips/include/asm/mach-generic/spaces.h
@@ -7,6 +7,8 @@ 
 #ifndef _ASM_MACH_GENERIC_SPACES_H
 #define _ASM_MACH_GENERIC_SPACES_H
 
+#include <linux/const.h>
+
 /*
  * This gives the physical RAM offset.
  */
diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h
index 50fccea5c8f9..29624fdbb555 100644
--- a/arch/riscv/include/asm/csr.h
+++ b/arch/riscv/include/asm/csr.h
@@ -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 */
diff --git a/include/common.h b/include/common.h
index 83b3bdc58dfa..f3c1de9f1fa2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -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>
@@ -542,16 +539,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