Skip to content

Commit

Permalink
libsel4allocman: inline loop variable
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Heider <axelheider@gmx.de>
  • Loading branch information
axel-h committed Nov 24, 2023
1 parent 65e18e3 commit 9f7c425
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions libsel4allocman/src/bootstrap.c
Original file line number Diff line number Diff line change
@@ -227,13 +227,12 @@ int bootstrap_add_untypeds_from_bootinfo(bootstrap_info_t *bs, seL4_BootInfo *bi

static int bootstrap_add_untypeds_from_simple(bootstrap_info_t *bs, simple_t *simple) {
int error;
int i;
/* if we do not have a boot cspace, or we have added some uts that aren't in the
* current space then just bail */
if (!bs->have_boot_cspace || (bs->uts && !bs->uts_in_current_cspace)) {
return 1;
}
for (i = 0; i < simple_get_untyped_count(simple); i++) {
for (int i = 0; i < simple_get_untyped_count(simple); i++) {
size_t size_bits;
uintptr_t paddr;
bool device;
@@ -1111,10 +1110,9 @@ int allocman_add_simple_untypeds_with_regions(allocman_t *alloc, simple_t *simpl
int error = prepare_handle_device_untyped_cap(alloc, simple, &state, num_regions, region_list);
ZF_LOGF_IF(error, "bootstrap_prepare_handle_device_untyped_cap Failed");

int i;
int total_untyped = simple_get_untyped_count(simple);

for(i = 0; i < total_untyped; i++) {
for(int i = 0; i < total_untyped; i++) {
size_t size_bits;
uintptr_t paddr;
bool device;
4 changes: 1 addition & 3 deletions libsel4simple/src/simple.c
Original file line number Diff line number Diff line change
@@ -8,9 +8,7 @@

bool simple_is_untyped_cap(simple_t *simple, seL4_CPtr pos)
{
int i;

for (i = 0; i < simple_get_untyped_count(simple); i++) {
for (int i = 0; i < simple_get_untyped_count(simple); i++) {
seL4_CPtr ut_pos = simple_get_nth_untyped(simple, i, NULL, NULL, NULL);
if (ut_pos == pos) {
return true;

0 comments on commit 9f7c425

Please sign in to comment.