]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.165/arm64-disable-asm-operand-width-warning-for-clang.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.4.165 / arm64-disable-asm-operand-width-warning-for-clang.patch
CommitLineData
22b74881
GKH
1From foo@baz Wed Nov 21 18:50:39 CET 2018
2From: Matthias Kaehlcke <mka@chromium.org>
3Date: Fri, 21 Apr 2017 16:00:56 -0700
4Subject: arm64: Disable asm-operand-width warning for clang
5
6From: Matthias Kaehlcke <mka@chromium.org>
7
8clang raises 'asm-operand-widths' warnings in inline assembly code when
9the size of an operand is < 64 bits and the operand width is unspecified.
10Most warnings are raised in macros, i.e. the datatype of the operand may
11vary.
12
13Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
14
15nc: I trimmed the original commit message since I'm not a part of CrOS
16 and can't speak on their behalf.
17
18 To fix these warnings, it requires a fairly intrusive backport of
19 the sysreg conversion that Mark Rutland did in 4.9. I think
20 disabling the warning is smarter, similar to commit d41d0fe374d4
21 ("turn off -Wattribute-alias") in this tree.
22
23Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 arch/arm64/Makefile | 4 ++++
27 1 file changed, 4 insertions(+)
28
29--- a/arch/arm64/Makefile
30+++ b/arch/arm64/Makefile
31@@ -56,6 +56,10 @@ else
32 TEXT_OFFSET := 0x00080000
33 endif
34
35+ifeq ($(cc-name),clang)
36+KBUILD_CFLAGS += $(call cc-disable-warning, asm-operand-widths)
37+endif
38+
39 # KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)
40 # in 32-bit arithmetic
41 KASAN_SHADOW_OFFSET := $(shell printf "0x%08x00000000\n" $$(( \