[PATCH 1/2] kexec-tools: powerpc: Fix function signature of comparefunc()
John Paul Adrian Glaubitz
glaubitz at physik.fu-berlin.de
Sat Nov 22 03:11:47 PST 2025
On Wed, 2025-10-22 at 13:44 +0200, John Paul Adrian Glaubitz wrote:
> Fixes the following build error on 32-bit PowerPC:
>
> kexec/arch/ppc/fs2dt.c: In function 'putnode':
> kexec/arch/ppc/fs2dt.c:338:51: error: passing argument 4 of 'scandir' from incompatible pointer type [-Wincompatible-pointer-types]
> 338 | numlist = scandir(pathname, &namelist, 0, comparefunc);
> | ^~~~~~~~~~~
> | |
> | int (*)(const void *, const void *)
>
> Signed-off-by: John Paul Adrian Glaubitz <glaubitz at physik.fu-berlin.de>
> ---
> kexec/arch/ppc/fs2dt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c
> index fed499b..d03b995 100644
> --- a/kexec/arch/ppc/fs2dt.c
> +++ b/kexec/arch/ppc/fs2dt.c
> @@ -292,7 +292,8 @@ static void putprops(char *fn, struct dirent **nlist, int numlist)
> * Compare function used to sort the device-tree directories
> * This function will be passed to scandir.
> */
> -static int comparefunc(const void *dentry1, const void *dentry2)
> +static int comparefunc(const struct dirent **dentry1,
> + const struct dirent **dentry2)
> {
> char *str1 = (*(struct dirent **)dentry1)->d_name;
> char *str2 = (*(struct dirent **)dentry2)->d_name;
Ping for both patches.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
More information about the kexec
mailing list