Commit fb3825cb authored by Vincenzo Frascino's avatar Vincenzo Frascino
Browse files

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.

Fixes: c8f8de4c

 ("arm64: kasan: simplify and inline MTE functions")
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Vincenzo Frascino's avatarVincenzo Frascino <vincenzo.frascino@arm.com>
parent ee5acacc
......@@ -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);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment