Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c620677d authored by Qian Cai's avatar Qian Cai Committed by Alistair Delva
Browse files

UPSTREAM: arm64/mm: fix variable 'tag' set but not used



(Upstream commit 7732d20a160c76006c7fe7bca5178aea6af1d2e8).

When CONFIG_KASAN_SW_TAGS=n, set_tag() is compiled away. GCC throws a
warning,

mm/kasan/common.c: In function '__kasan_kmalloc':
mm/kasan/common.c:464:5: warning: variable 'tag' set but not used
[-Wunused-but-set-variable]
  u8 tag = 0xff;
     ^~~

Fix it by making __tag_set() a static inline function the same as
arch_kasan_set_tag() in mm/kasan/kasan.h for consistency because there
is a macro in arch/arm64/include/asm/kasan.h,

 #define arch_kasan_set_tag(addr, tag) __tag_set(addr, tag)

However, when CONFIG_DEBUG_VIRTUAL=n and CONFIG_SPARSEMEM_VMEMMAP=y,
page_to_virt() will call __tag_set() with incorrect type of a
parameter, so fix that as well. Also, still let page_to_virt() return
"void *" instead of "const void *", so will not need to add a similar
cast in lowmem_page_address().

Signed-off-by: default avatarQian Cai <cai@lca.pw>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Bug: 135692346
Change-Id: Iec54d8b8f0c986d7767b700c31be44066243c68f
parent 74e86642
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment