summaryrefslogtreecommitdiff
path: root/mm/early_ioremap.c
diff options
context:
space:
mode:
authorLiam Ni <zhiguangni01@gmail.com>2023-06-03 10:31:16 +0800
committerAndrew Morton <akpm@linux-foundation.org>2023-06-09 16:25:56 -0700
commit5e07472583840308949ce807b11274de15cb79a0 (patch)
treebf9206849d770492e64d4214542f5fc61ae6a013 /mm/early_ioremap.c
parent396faf88981917f975773d8589ce4f6e6c679e13 (diff)
mm/early_ioremap.c: improve the execution efficiency of early_ioremap_setup()
Reduce the number of invalid loops of the function early_ioremap_setup() to improve the efficiency of function execution Link: https://lkml.kernel.org/r/CACZJ9cU6t5sLoDwE6_XOg+UJLpZt4+qHfjYN2bA0s+3y9y6pQQ@mail.gmail.com Signed-off-by: LiamNi <zhiguangni01@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/early_ioremap.c')
-rw-r--r--mm/early_ioremap.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c
index 9bc12e526ed0..ce06b2884789 100644
--- a/mm/early_ioremap.c
+++ b/mm/early_ioremap.c
@@ -72,12 +72,10 @@ void __init early_ioremap_setup(void)
{
int i;
- for (i = 0; i < FIX_BTMAPS_SLOTS; i++)
- if (WARN_ON(prev_map[i]))
- break;
-
- for (i = 0; i < FIX_BTMAPS_SLOTS; i++)
+ for (i = 0; i < FIX_BTMAPS_SLOTS; i++) {
+ WARN_ON_ONCE(prev_map[i]);
slot_virt[i] = __fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i);
+ }
}
static int __init check_early_ioremap_leak(void)