summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2025-05-15 15:05:17 +0300
committerIngo Molnar <mingo@kernel.org>2025-12-14 11:19:36 +0300
commitdb0d69c5700ba4749217b83b475606d864d46226 (patch)
tree75075d99b528d8b23df6d09c2fef32e1fb436dba
parentadbf61cc47cb72b102682e690ad323e1eda652c2 (diff)
downloadlinux-db0d69c5700ba4749217b83b475606d864d46226.tar.xz
x86/boot/e820: Remove inverted boolean logic from the e820_nomerge() function name, rename it to e820_type_mergeable()
It's a bad practice to put inverted logic into function names, flip it back and rename it to e820_type_mergeable(). Add/update a few comments about this function while at it. Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Nikolay Borisov <nik.borisov@suse.com> Link: https://patch.msgid.link/20250515120549.2820541-2-mingo@kernel.org
-rw-r--r--arch/x86/kernel/e820.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index b15b97d3cb52..4c3159d07252 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -305,18 +305,22 @@ static int __init cpcompare(const void *a, const void *b)
return (ap->addr != ap->entry->addr) - (bp->addr != bp->entry->addr);
}
-static bool e820_nomerge(enum e820_type type)
+/*
+ * Can two consecutive E820 entries of this same E820 type be merged?
+ */
+static bool e820_type_mergeable(enum e820_type type)
{
/*
* These types may indicate distinct platform ranges aligned to
- * numa node, protection domain, performance domain, or other
+ * NUMA node, protection domain, performance domain, or other
* boundaries. Do not merge them.
*/
if (type == E820_TYPE_PRAM)
- return true;
+ return false;
if (type == E820_TYPE_SOFT_RESERVED)
- return true;
- return false;
+ return false;
+
+ return true;
}
int __init e820__update_table(struct e820_table *table)
@@ -394,7 +398,7 @@ int __init e820__update_table(struct e820_table *table)
}
/* Continue building up new map based on this information: */
- if (current_type != last_type || e820_nomerge(current_type)) {
+ if (current_type != last_type || !e820_type_mergeable(current_type)) {
if (last_type) {
new_entries[new_nr_entries].size = change_point[chg_idx]->addr - last_addr;
/* Move forward only if the new size was non-zero: */