Fixing checkpatch.pl warnings.
Most warnings are "Missing a blank line after declarations". I'm also
adding blank lines between multi-line comments and statements.
Ran with --ignore BRACES,SPDX_LICENSE_TAG,VOLATILE,SPLIT_STRING,
AVOID_EXTERNS,USE_SPINLOCK_T,NEW_TYPEDEFS,INITIALISED_STATIC,
FILE_PATH_CHANGES to reduce noise. Now there is only one type of
warning, with two instances:
WARNING: Prefer using '"%s...", __func__' to using 'dmb', this function's name, in a string
+ __asm__ volatile("dmb sy");
WARNING: Prefer using '"%s...", __func__' to using 'dsb', this function's name, in a string
+ __asm__ volatile("dsb sy");
Change-Id: Id837feef86dc81ba84de1809e76653ddce814422
diff --git a/src/mm.c b/src/mm.c
index 830fb289..55340a1 100644
--- a/src/mm.c
+++ b/src/mm.c
@@ -115,6 +115,7 @@
static ptable_addr_t mm_level_end(ptable_addr_t addr, uint8_t level)
{
size_t offset = PAGE_BITS + (level + 1) * PAGE_LEVEL_BITS;
+
return ((addr >> offset) + 1) << offset;
}
@@ -125,6 +126,7 @@
static size_t mm_index(ptable_addr_t addr, uint8_t level)
{
ptable_addr_t v = addr >> (PAGE_BITS + level * PAGE_LEVEL_BITS);
+
return v & ((UINT64_C(1) << PAGE_LEVEL_BITS) - 1);
}
@@ -483,6 +485,7 @@
int max_level)
{
uint64_t i;
+
for (i = 0; i < MM_PTE_PER_PAGE; i++) {
if (!arch_mm_pte_is_present(table->entries[i], level)) {
continue;
@@ -509,6 +512,7 @@
int max_level = arch_mm_max_level(mode);
uint8_t root_table_count = arch_mm_root_table_count(mode);
uint8_t i;
+
for (i = 0; i < root_table_count; ++i) {
mm_dump_table_recursive(&tables[i], max_level, max_level);
}
@@ -695,8 +699,10 @@
}
}
- /* TODO: halloc could return a virtual or physical address if mm not
- * enabled? */
+ /*
+ * TODO: halloc could return a virtual or physical address if mm not
+ * enabled?
+ */
t->root = pa_init((uintpaddr_t)tables);
return true;