[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+yBrWeXTXoR=_jrH55YORf6YPfcXYZOZNuEzRsuwq_CQQ@mail.gmail.com>
Date: Thu, 11 Feb 2021 18:42:25 +0100
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Vincenzo Frascino <vincenzo.frascino@....com>
Cc: Linux ARM <linux-arm-kernel@...ts.infradead.org>,
LKML <linux-kernel@...r.kernel.org>,
kasan-dev <kasan-dev@...glegroups.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2] arm64: Fix warning in mte_get_random_tag()
On Thu, Feb 11, 2021 at 4:22 PM Vincenzo Frascino
<vincenzo.frascino@....com> wrote:
>
> 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: c8f8de4c0887 ("arm64: kasan: simplify and inline MTE functions")
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Will Deacon <will@...nel.org>
> Cc: Andrey Konovalov <andreyknvl@...gle.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@....com>
> ---
>
> This patch is based on linux-next/akpm
>
> 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);
> }
> --
> 2.30.0
>
Acked-by: Andrey Konovalov <andreyknvl@...gle.com>
Tested-by: Andrey Konovalov <andreyknvl@...gle.com>
Powered by blists - more mailing lists