[PATCH 2/2] kexec-tools: powerpc: Fix pointer declarations in read_memory_region_limits()
John Paul Adrian Glaubitz
glaubitz at physik.fu-berlin.de
Wed Oct 22 04:44:13 PDT 2025
Fixes the following two build errors on 32-bit PowerPC:
kexec/arch/ppc/kexec-ppc.c: In function 'read_memory_region_limits':
kexec/arch/ppc/kexec-ppc.c:106:11: error: assignment to 'long long unsigned int *' from incompatible pointer type 'long unsigned int *' [-Wincompatible-pointer-types]
106 | p = (unsigned long*)buf;
| ^
kexec/arch/ppc/kexec-ppc.c: In function 'read_memory_region_limits':
kexec/arch/ppc/kexec-ppc.c:112:19: error: assignment to 'long unsigned int *' from incompatible pointer type 'long long unsigned int *' [-Wincompatible-pointer-types]
112 | p = (unsigned long long *)p + 1;
| ^
Signed-off-by: John Paul Adrian Glaubitz <glaubitz at physik.fu-berlin.de>
---
kexec/arch/ppc/kexec-ppc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kexec/arch/ppc/kexec-ppc.c b/kexec/arch/ppc/kexec-ppc.c
index d3dad0f..e173433 100644
--- a/kexec/arch/ppc/kexec-ppc.c
+++ b/kexec/arch/ppc/kexec-ppc.c
@@ -91,7 +91,7 @@ int read_memory_region_limits(int fd, unsigned long long *start,
unsigned long long *end)
{
char buf[MAXBYTES];
- unsigned long *p;
+ unsigned long long *p;
unsigned long nbytes = dt_address_cells + dt_size_cells;
if (lseek(fd, 0, SEEK_SET) == -1) {
@@ -103,7 +103,7 @@ int read_memory_region_limits(int fd, unsigned long long *start,
return -1;
}
- p = (unsigned long*)buf;
+ p = (unsigned long long*)buf;
if (dt_address_cells == sizeof(unsigned long)) {
*start = p[0];
p++;
--
2.47.3
More information about the kexec
mailing list