summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2025-05-15 14:05:42 +0200
committerIngo Molnar <mingo@kernel.org>2025-12-14 09:19:42 +0100
commit8b886d8a4db9a75c22cf7d0939f63ca811486efd (patch)
tree6ca73908186d52b50c016d1fc7c6e1a40ee5c8e7 /arch
parent157266edcc56715323de1bd60e49194b3b66a174 (diff)
x86/boot/e820: Remove e820__range_remove()'s unused return parameter
None of the usage sites make use of the 'real_removed_size' return parameter of e820__range_remove(), and it's hard to contemplate much constructive use: E820 maps can have holes, and removing a fixed range may result in removal of any number of bytes from 0 to the requested size. So remove this pointless calculation. This simplifies the function a bit: text data bss dec hex filename 7645 44072 0 51717 ca05 e820.o.before 7597 44072 0 51669 c9d5 e820.o.after Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: H . Peter Anvin <hpa@zytor.com> Cc: Andy Shevchenko <andy@kernel.org> Cc: Arnd Bergmann <arnd@kernel.org> Cc: David Woodhouse <dwmw@amazon.co.uk> Cc: Juergen Gross <jgross@suse.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Rapoport <rppt@kernel.org> Cc: Paul Menzel <pmenzel@molgen.mpg.de> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://patch.msgid.link/20250515120549.2820541-27-mingo@kernel.org
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/e820/api.h2
-rw-r--r--arch/x86/kernel/e820.c8
2 files changed, 2 insertions, 8 deletions
diff --git a/arch/x86/include/asm/e820/api.h b/arch/x86/include/asm/e820/api.h
index 54427b77bc19..9cf416f7a84f 100644
--- a/arch/x86/include/asm/e820/api.h
+++ b/arch/x86/include/asm/e820/api.h
@@ -16,7 +16,7 @@ extern bool e820__mapped_all(u64 start, u64 end, enum e820_type type);
extern void e820__range_add (u64 start, u64 size, enum e820_type type);
extern u64 e820__range_update(u64 start, u64 size, enum e820_type old_type, enum e820_type new_type);
-extern u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool check_type);
+extern void e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool check_type);
extern u64 e820__range_update_table(struct e820_table *t, u64 start, u64 size, enum e820_type old_type, enum e820_type new_type);
extern int e820__update_table(struct e820_table *table);
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 806fd92c226a..dfbc6e1f3290 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -548,11 +548,10 @@ __init u64 e820__range_update_table(struct e820_table *t, u64 start, u64 size,
}
/* Remove a range of memory from the E820 table: */
-__init u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool check_type)
+__init void e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool check_type)
{
u32 idx;
u64 end;
- u64 real_removed_size = 0;
if (size > (ULLONG_MAX - start))
size = ULLONG_MAX - start;
@@ -575,7 +574,6 @@ __init u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool
/* Completely covered? */
if (entry->addr >= start && entry_end <= end) {
- real_removed_size += entry->size;
memset(entry, 0, sizeof(*entry));
continue;
}
@@ -584,7 +582,6 @@ __init u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool
if (entry->addr < start && entry_end > end) {
e820__range_add(end, entry_end - end, entry->type);
entry->size = start - entry->addr;
- real_removed_size += size;
continue;
}
@@ -594,8 +591,6 @@ __init u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool
if (final_start >= final_end)
continue;
- real_removed_size += final_end - final_start;
-
/*
* Left range could be head or tail, so need to update
* the size first:
@@ -606,7 +601,6 @@ __init u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool
entry->addr = final_end;
}
- return real_removed_size;
}
__init void e820__update_table_print(void)