From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Huacai Chen <chenhuacai@kernel.org>
Cc: Sang-Heon Jeon <ekffu200098@gmail.com>,
Alexander Potapenko <glider@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
kasan-dev@googlegroups.com, loongarch@lists.linux.dev,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
WANG Xuerui <kernel@xen0n.name>
Subject: [PATCH 2/6] LoongArch: remove unreachable invalid range check in kasan_init()
Date: Sun, 21 Jun 2026 23:59:12 +0900 [thread overview]
Message-ID: <20260621145919.1453-3-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260621145919.1453-1-ekffu200098@gmail.com>
kasan_init() populates the linear mapping shadow with for_each_mem_range()
and breaks the loop when start >= end. for_each_mem_range() never returns
an invalid range, so start < end always.
Therefore the start >= end check is unreachable, so remove it.
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
arch/loongarch/mm/kasan_init.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/loongarch/mm/kasan_init.c b/arch/loongarch/mm/kasan_init.c
index 0fc02ca06457..92ca0ba86406 100644
--- a/arch/loongarch/mm/kasan_init.c
+++ b/arch/loongarch/mm/kasan_init.c
@@ -305,9 +305,6 @@ void __init kasan_init(void)
void *start = (void *)phys_to_virt(pa_start);
void *end = (void *)phys_to_virt(pa_end);
- if (start >= end)
- break;
-
kasan_map_populate((unsigned long)mem_to_shadow(start),
(unsigned long)mem_to_shadow(end), NUMA_NO_NODE);
}
--
2.43.0
next prev parent reply other threads:[~2026-06-21 14:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-21 14:59 [PATCH 0/6] treewide: remove unnecessary invalid range checks in memblock iteration loops Sang-Heon Jeon
2026-06-21 14:59 ` Sang-Heon Jeon [this message]
2026-06-22 16:52 ` [PATCH 2/6] LoongArch: remove unreachable invalid range check in kasan_init() Andrey Ryabinin
2026-06-25 8:46 ` [PATCH 0/6] treewide: remove unnecessary invalid range checks in memblock iteration loops Mike Rapoport
2026-06-26 8:23 ` Mike Rapoport
2026-06-26 10:59 ` Sang-Heon Jeon
2026-06-29 11:43 ` Mike Rapoport
2026-06-29 16:48 ` Sang-Heon Jeon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260621145919.1453-3-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=andreyknvl@gmail.com \
--cc=chenhuacai@kernel.org \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kernel@xen0n.name \
--cc=loongarch@lists.linux.dev \
--cc=ryabinin.a.a@gmail.com \
--cc=vincenzo.frascino@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox