From b989c94cb2be93c7e3b19475f184baa7c14800aa Mon Sep 17 00:00:00 2001 From: Vincenzo Frascino Date: Fri, 12 Feb 2021 17:14:51 +1100 Subject: [PATCH] FROMGIT: arm64: fix warning in mte_get_random_tag() The simplification of mte_get_random_tag() caused the introduction of the warning below: In file included from arch/arm64/include/asm/kasan.h:9, from include/linux/kasan.h:16, from mm/kasan/common.c:14: mm/kasan/common.c: In function `mte_get_random_tag': arch/arm64/include/asm/mte-kasan.h:45:9: warning: `addr' is used uninitialized [-Wuninitialized] 45 | asm(__MTE_PREAMBLE "irg %0, %0" | Fix the warning using "=r" for the address in the asm inline. Link: https://lkml.kernel.org/r/20210211152208.23811-1-vincenzo.frascino@arm.com Fixes: c8f8de4c0887 ("arm64: kasan: simplify and inline MTE functions") Signed-off-by: Vincenzo Frascino Acked-by: Andrey Konovalov Tested-by: Andrey Konovalov Cc: Catalin Marinas Cc: Will Deacon Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell (cherry picked from commit 37a7f3b88e3dde2479e1aa93847093b5e97a9c01 https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm) Bug: 172318110 Change-Id: I7c52f84b9d746373c341a7cd36b12309ab993141 --- arch/arm64/include/asm/mte-kasan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/mte-kasan.h b/arch/arm64/include/asm/mte-kasan.h index 3d58489228c0..7ab500e2ad17 100644 --- a/arch/arm64/include/asm/mte-kasan.h +++ b/arch/arm64/include/asm/mte-kasan.h @@ -43,7 +43,7 @@ static inline u8 mte_get_random_tag(void) void *addr; asm(__MTE_PREAMBLE "irg %0, %0" - : "+r" (addr)); + : "=r" (addr)); return mte_get_ptr_tag(addr); }