Skip to content

Commit 7df2f81

Browse files
committed
x86/boot/e820: Simplify & clarify __e820__range_add() a bit
Use 'entry_new' to make clear we are allocating a new entry. Change the table-full message to say that the table is full. 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-24-mingo@kernel.org
1 parent 95060e4 commit 7df2f81

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

arch/x86/kernel/e820.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,19 @@ int e820__get_entry_type(u64 start, u64 end)
165165
static void __init __e820__range_add(struct e820_table *table, u64 start, u64 size, enum e820_type type)
166166
{
167167
u32 idx = table->nr_entries;
168+
struct e820_entry *entry_new;
168169

169170
if (idx >= ARRAY_SIZE(table->entries)) {
170-
pr_err("too many E820 table entries; ignoring [mem %#010llx-%#010llx]\n",
171+
pr_err("E820 table full; ignoring [mem %#010llx-%#010llx]\n",
171172
start, start + size-1);
172173
return;
173174
}
174175

175-
table->entries[idx].addr = start;
176-
table->entries[idx].size = size;
177-
table->entries[idx].type = type;
176+
entry_new = table->entries + idx;
177+
178+
entry_new->addr = start;
179+
entry_new->size = size;
180+
entry_new->type = type;
178181

179182
table->nr_entries++;
180183
}

0 commit comments

Comments
 (0)