File: kexec-tools-powerpc-Fix-function-signature-of-compar.patch

package info (click to toggle)
kexec-tools 1%3A2.0.32-3
  • links: PTS
  • area: main
  • in suites: sid
  • size: 3,204 kB
  • sloc: ansic: 31,386; sh: 3,613; asm: 2,625; cpp: 1,754; makefile: 995
file content (33 lines) | stat: -rw-r--r-- 1,494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From b89799f7f20d4b2476e99e95e6795450f2f1c111 Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Wed, 22 Oct 2025 13:44:12 +0200
Subject: [PATCH] kexec-tools: powerpc: Fix function signature of comparefunc()

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@physik.fu-berlin.de>
Reviewed-by: Khalid Aziz <khalid@gonehiking.org>
Signed-off-by: Simon Horman <horms@kernel.org>
---
 kexec/arch/ppc/fs2dt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/kexec/arch/ppc/fs2dt.c
+++ b/kexec/arch/ppc/fs2dt.c
@@ -292,7 +292,8 @@
  * 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;