Skip to content

Commit

Permalink
contrib/elf2dmp: Change pa_space_create() signature
Browse files Browse the repository at this point in the history
pa_space_create() used to return an integer to propagate error, but
it never fails so let it return void.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20240307-elf2dmp-v4-4-4f324ad4d99d@daynix.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
akihikodaki authored and pm215 committed Mar 11, 2024
1 parent 87157ef commit 262a0ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 1 addition & 3 deletions contrib/elf2dmp/addrspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void pa_block_align(struct pa_block *b)
b->paddr += low_align;
}

int pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf)
void pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf)
{
Elf64_Half phdr_nr = elf_getphdrnum(qemu_elf->map);
Elf64_Phdr *phdr = elf64_getphdr(qemu_elf->map);
Expand Down Expand Up @@ -87,8 +87,6 @@ int pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf)
}

ps->block_nr = block_i;

return 0;
}

void pa_space_destroy(struct pa_space *ps)
Expand Down
2 changes: 1 addition & 1 deletion contrib/elf2dmp/addrspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct va_space {
struct pa_space *ps;
};

int pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf);
void pa_space_create(struct pa_space *ps, QEMU_Elf *qemu_elf);
void pa_space_destroy(struct pa_space *ps);

void va_space_create(struct va_space *vs, struct pa_space *ps, uint64_t dtb);
Expand Down
5 changes: 1 addition & 4 deletions contrib/elf2dmp/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,7 @@ int main(int argc, char *argv[])
return 1;
}

if (pa_space_create(&ps, &qemu_elf)) {
eprintf("Failed to initialize physical address space\n");
goto out_elf;
}
pa_space_create(&ps, &qemu_elf);

state = qemu_elf.state[0];
printf("CPU #0 CR3 is 0x%016"PRIx64"\n", state->cr[3]);
Expand Down

0 comments on commit 262a0ff

Please sign in to comment.