lmb: Improve coding style

Fix checkpatch warnings. No functional change.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Sam Protsenko
2024-12-10 20:25:49 -06:00
committed by Tom Rini
parent 8ab61628b8
commit 85ebda86fa

View File

@@ -57,7 +57,6 @@ static long lmb_regions_overlap(struct alist *lmb_rgn_lst, unsigned long r1,
unsigned long r2)
{
struct lmb_region *rgn = lmb_rgn_lst->data;
phys_addr_t base1 = rgn[r1].base;
phys_size_t size1 = rgn[r1].size;
phys_addr_t base2 = rgn[r2].base;
@@ -70,11 +69,11 @@ static long lmb_regions_adjacent(struct alist *lmb_rgn_lst, unsigned long r1,
unsigned long r2)
{
struct lmb_region *rgn = lmb_rgn_lst->data;
phys_addr_t base1 = rgn[r1].base;
phys_size_t size1 = rgn[r1].size;
phys_addr_t base2 = rgn[r2].base;
phys_size_t size2 = rgn[r2].size;
return lmb_addrs_adjacent(base1, size1, base2, size2);
}
@@ -228,6 +227,8 @@ static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base,
coalesced++;
break;
return -1;
}
}
@@ -278,14 +279,17 @@ static long _lmb_free(struct alist *lmb_rgn_lst, phys_addr_t base,
phys_addr_t end = base + size - 1;
int i;
rgnbegin = rgnend = 0; /* supress gcc warnings */
/* Suppress GCC warnings */
rgnbegin = 0;
rgnend = 0;
rgn = lmb_rgn_lst->data;
/* Find the region where (base, size) belongs to */
for (i = 0; i < lmb_rgn_lst->count; i++) {
rgnbegin = rgn[i].base;
rgnend = rgnbegin + rgn[i].size - 1;
if ((rgnbegin <= base) && (end <= rgnend))
if (rgnbegin <= base && end <= rgnend)
break;
}
@@ -294,7 +298,7 @@ static long _lmb_free(struct alist *lmb_rgn_lst, phys_addr_t base,
return -1;
/* Check to see if we are removing entire region */
if ((rgnbegin == base) && (rgnend == end)) {
if (rgnbegin == base && rgnend == end) {
lmb_remove_region(lmb_rgn_lst, i);
return 0;
}
@@ -330,6 +334,7 @@ static long lmb_overlaps_region(struct alist *lmb_rgn_lst, phys_addr_t base,
for (i = 0; i < lmb_rgn_lst->count; i++) {
phys_addr_t rgnbase = rgn[i].base;
phys_size_t rgnsize = rgn[i].size;
if (lmb_addrs_overlap(base, size, rgnbase, rgnsize))
break;
}
@@ -720,16 +725,18 @@ static phys_addr_t _lmb_alloc_base(phys_size_t size, ulong align,
if (lmbsize < size)
continue;
if (max_addr == LMB_ALLOC_ANYWHERE)
if (max_addr == LMB_ALLOC_ANYWHERE) {
base = lmb_align_down(lmbbase + lmbsize - size, align);
else if (lmbbase < max_addr) {
} else if (lmbbase < max_addr) {
base = lmbbase + lmbsize;
if (base < lmbbase)
base = -1;
base = min(base, max_addr);
base = lmb_align_down(base - size, align);
} else
} else {
continue;
}
while (base && lmbbase <= base) {
rgn = lmb_overlaps_region(&lmb.used_mem, base, size);