[U-Boot,v2,1/2] linux/sizes.h: sync from kernel

Message ID 89a26fec0d2017c23a598cedb40e31aa1b849724.1541576440.git.baruch@tkos.co.il
State Superseded
Delegated to: Stefan Roese
Headers show
Series
  • [U-Boot,v2,1/2] linux/sizes.h: sync from kernel
Related show

Commit Message

Baruch Siach Nov. 7, 2018, 7:40 a.m.
The kernel added SZ_4G macro in commit f2b9ba871b (arm64/kernel: kaslr:
reduce module randomization range to 4 GB).

Include common.h for _AC() instead of the kernel linux/const.h header.

Drop a local SZ_4G definition in tegra code.

Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
v2: No change
---
 arch/arm/mach-tegra/tegra186/nvtboot_mem.c | 3 +--
 include/linux/sizes.h                      | 4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Tom Rini Nov. 7, 2018, 8:34 p.m. | #1
On Wed, Nov 07, 2018 at 09:40:39AM +0200, Baruch Siach wrote:

> The kernel added SZ_4G macro in commit f2b9ba871b (arm64/kernel: kaslr:
> reduce module randomization range to 4 GB).
> 
> Include common.h for _AC() instead of the kernel linux/const.h header.
> 
> Drop a local SZ_4G definition in tegra code.
> 
> Cc: Tom Warren <twarren@nvidia.com>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> v2: No change
> ---
>  arch/arm/mach-tegra/tegra186/nvtboot_mem.c | 3 +--
>  include/linux/sizes.h                      | 4 ++++
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c b/arch/arm/mach-tegra/tegra186/nvtboot_mem.c
> index 5c9467bfe8be..62142821a595 100644
> --- a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c
> +++ b/arch/arm/mach-tegra/tegra186/nvtboot_mem.c
> @@ -6,11 +6,10 @@
>  #include <common.h>
>  #include <fdt_support.h>
>  #include <fdtdec.h>
> +#include <linux/sizes.h>
>  #include <asm/arch/tegra.h>
>  #include <asm/armv8/mmu.h>
>  
> -#define SZ_4G 0x100000000ULL
> -
>  /*
>   * Size of a region that's large enough to hold the relocated U-Boot and all
>   * other allocations made around it (stack, heap, page tables, etc.)
> diff --git a/include/linux/sizes.h b/include/linux/sizes.h
> index ce3e8150c174..9f3c13ee459b 100644
> --- a/include/linux/sizes.h
> +++ b/include/linux/sizes.h
> @@ -8,6 +8,8 @@
>  #ifndef __LINUX_SIZES_H__
>  #define __LINUX_SIZES_H__
>  
> +#include <common.h>
> +
>  #define SZ_1				0x00000001
>  #define SZ_2				0x00000002
>  #define SZ_4				0x00000004
> @@ -44,4 +46,6 @@
>  #define SZ_1G				0x40000000
>  #define SZ_2G				0x80000000
>  
> +#define SZ_4G				_AC(0x100000000, ULL)
> +
>  #endif /* __LINUX_SIZES_H__ */

I think this is moving things in the wrong direction.  In fact,
2a6713b09b8da58572338abac276aa764bb6eadd took things in the wrong
direction.  We need to import linux/const.h (and just combine
uapi/linux/const.h with linux/const.h) with the _AC macro and then add
in SZ_4G.

Patch

diff --git a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c b/arch/arm/mach-tegra/tegra186/nvtboot_mem.c
index 5c9467bfe8be..62142821a595 100644
--- a/arch/arm/mach-tegra/tegra186/nvtboot_mem.c
+++ b/arch/arm/mach-tegra/tegra186/nvtboot_mem.c
@@ -6,11 +6,10 @@ 
 #include <common.h>
 #include <fdt_support.h>
 #include <fdtdec.h>
+#include <linux/sizes.h>
 #include <asm/arch/tegra.h>
 #include <asm/armv8/mmu.h>
 
-#define SZ_4G 0x100000000ULL
-
 /*
  * Size of a region that's large enough to hold the relocated U-Boot and all
  * other allocations made around it (stack, heap, page tables, etc.)
diff --git a/include/linux/sizes.h b/include/linux/sizes.h
index ce3e8150c174..9f3c13ee459b 100644
--- a/include/linux/sizes.h
+++ b/include/linux/sizes.h
@@ -8,6 +8,8 @@ 
 #ifndef __LINUX_SIZES_H__
 #define __LINUX_SIZES_H__
 
+#include <common.h>
+
 #define SZ_1				0x00000001
 #define SZ_2				0x00000002
 #define SZ_4				0x00000004
@@ -44,4 +46,6 @@ 
 #define SZ_1G				0x40000000
 #define SZ_2G				0x80000000
 
+#define SZ_4G				_AC(0x100000000, ULL)
+
 #endif /* __LINUX_SIZES_H__ */