linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL for 3.18 040/101] arm64: pass machine size to sparse
       [not found] <20180409003505.164715-1-alexander.levin@microsoft.com>
@ 2018-04-09  0:35 ` Sasha Levin
  2018-04-09  0:35 ` [PATCH AUTOSEL for 3.18 047/101] arm64: pass endianness info " Sasha Levin
  1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2018-04-09  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

[ Upstream commit f5d284900c0f960e318a063f4c40826b6e3aa6a8 ]

When using sparse on the arm64 tree we get many thousands of
warnings like 'constant ... is so big it is unsigned long long'
or 'shift too big (32) for type unsigned long'. This happens
because by default sparse considers the machine as 32bit and
defines the size of the types accordingly.

Fix this by passing the '-m64' flag to sparse so that
sparse can correctly define longs as being 64bit.

CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: linux-arm-kernel at lists.infradead.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 37c4fd6aeb7a..3e2f6590666a 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -32,7 +32,7 @@ AS		+= -EL
 LD		+= -EL
 endif
 
-CHECKFLAGS	+= -D__aarch64__
+CHECKFLAGS	+= -D__aarch64__ -m64
 
 ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
 KBUILD_CFLAGS_MODULE	+= -mcmodel=large
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH AUTOSEL for 3.18 047/101] arm64: pass endianness info to sparse
       [not found] <20180409003505.164715-1-alexander.levin@microsoft.com>
  2018-04-09  0:35 ` [PATCH AUTOSEL for 3.18 040/101] arm64: pass machine size to sparse Sasha Levin
@ 2018-04-09  0:35 ` Sasha Levin
  1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2018-04-09  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

[ Upstream commit bcde519e8c325f3cc1fcf443eb6466e6bb3a3aca ]

ARM64 depends on the macro __AARCH64EB__ being defined or not
to correctly select or define endian-specific macros, structures
or pieces of code.

This macro is predefined by the compiler but sparse knows nothing
about it and thus may pre-process files differently from what
gcc would.

Fix this by passing '-D__AARCH64EL__' or '-D__AARCH64EB__' to
sparse depending of the endianness of the kernel, like defined
by GCC.

Note: In most case it won't change anything since most arm64 use
      little-endian (but an allyesconfig would use big-endian!).

CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: linux-arm-kernel at lists.infradead.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 arch/arm64/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 3e2f6590666a..203d87177172 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -24,10 +24,12 @@ KBUILD_CFLAGS	+= $(call cc-option, -mpc-relative-literal-loads)
 
 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS	+= -mbig-endian
+CHECKFLAGS	+= -D__AARCH64EB__
 AS		+= -EB
 LD		+= -EB
 else
 KBUILD_CPPFLAGS	+= -mlittle-endian
+CHECKFLAGS	+= -D__AARCH64EL__
 AS		+= -EL
 LD		+= -EL
 endif
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-09  0:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180409003505.164715-1-alexander.levin@microsoft.com>
2018-04-09  0:35 ` [PATCH AUTOSEL for 3.18 040/101] arm64: pass machine size to sparse Sasha Levin
2018-04-09  0:35 ` [PATCH AUTOSEL for 3.18 047/101] arm64: pass endianness info " Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).