From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: rppt@kernel.org, Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-mm@kvack.org, Sang-Heon Jeon <ekffu200098@gmail.com>,
Alexander Potapenko <glider@google.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Charlie Jenkins <thecharlesjenkins@gmail.com>
Subject: [PATCH v3 4/8] riscv: remove unreachable invalid range check in kasan_init()
Date: Wed, 1 Jul 2026 00:04:09 +0900 [thread overview]
Message-ID: <20260630150413.1718632-5-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260630150413.1718632-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>
Reviewed-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Tested-by: Charlie Jenkins <thecharlesjenkins@gmail.com>
Reviewed-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
---
arch/riscv/mm/kasan_init.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c
index c4a2a9e5586e..1f3aa9611187 100644
--- a/arch/riscv/mm/kasan_init.c
+++ b/arch/riscv/mm/kasan_init.c
@@ -512,9 +512,6 @@ void __init kasan_init(void)
void *start = (void *)__va(p_start);
void *end = (void *)__va(p_end);
- if (start >= end)
- break;
-
kasan_populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end));
}
--
2.43.0
next prev parent reply other threads:[~2026-06-30 15:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 15:04 [PATCH v3 0/8] treewide: remove unnecessary invalid range checks in memblock iteration loops Sang-Heon Jeon
2026-06-30 15:04 ` [PATCH v3 1/8] arm64: mm: remove unreachable invalid range check in kasan_init_shadow() Sang-Heon Jeon
2026-06-30 15:04 ` [PATCH v3 2/8] LoongArch: remove unreachable invalid range check in kasan_init() Sang-Heon Jeon
2026-06-30 15:04 ` [PATCH v3 3/8] riscv: remove unreachable invalid range check in create_linear_mapping_page_table() Sang-Heon Jeon
2026-06-30 15:04 ` Sang-Heon Jeon [this message]
2026-06-30 15:04 ` [PATCH v3 5/8] ARM: remove unreachable invalid range check in kasan_init() Sang-Heon Jeon
2026-06-30 15:04 ` [PATCH v3 6/8] powerpc64/kasan: Remove unreachable invalid range check in kasan_init_phys_region() Sang-Heon Jeon
2026-06-30 15:04 ` [PATCH v3 7/8] mm: remove unnecessary empty range check in early_calculate_totalpages() Sang-Heon Jeon
2026-06-30 15:04 ` [PATCH v3 8/8] mm/hugetlb: remove unnecessary empty range check in hugetlb_bootmem_set_nodes() 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=20260630150413.1718632-5-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=alex@ghiti.fr \
--cc=andreyknvl@gmail.com \
--cc=aou@eecs.berkeley.edu \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rppt@kernel.org \
--cc=ryabinin.a.a@gmail.com \
--cc=thecharlesjenkins@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