[patch 3/5] kexec add strict-prototypes

Geoff Levand geoffrey.levand at am.sony.com
Mon May 7 20:02:56 EDT 2007


Add -Wstrict-prototypes to EXTRA_CFLAGS and fix the powerpc compiler warnings.

Signed-off-by: Geoff Levand <geoffrey.levand at am.sony.com>
---
 configure.ac                   |    2 -
 kexec/arch/ppc64/kexec-ppc64.c |   61 +++++++++++++++++++----------------------
 2 files changed, 30 insertions(+), 33 deletions(-)

--- kexec-tools-hacked.orig/configure.ac
+++ kexec-tools-hacked/configure.ac
@@ -59,7 +59,7 @@ if test "${host_alias}" ; then
 	OBJDIR="$OBJDIR-${host_alias}"
 fi 
 
-EXTRA_CFLAGS='-Wall -g -fno-strict-aliasing $(CPPFLAGS) $(EXTRA_CPPFLAGS)'
+EXTRA_CFLAGS='-Wall -g -fno-strict-aliasing -Wstrict-prototypes $(CPPFLAGS) $(EXTRA_CPPFLAGS)'
 BUILD_CFLAGS='-O2 -Wall $(CPPFLAGS)'
 
 # Check whether ppc64. Add -m64 for building 64-bit binary
--- kexec-tools-hacked.orig/kexec/arch/ppc64/kexec-ppc64.c
+++ kexec-tools-hacked/kexec/arch/ppc64/kexec-ppc64.c
@@ -45,10 +45,7 @@ unsigned long long crash_base, crash_siz
 unsigned int rtas_base, rtas_size;
 int max_memory_ranges;
 
-static int sort_base_ranges();
-
-
-static void cleanup_memory_ranges()
+static void cleanup_memory_ranges(void)
 {
 	if (memory_range)
 		free(memory_range);
@@ -64,7 +61,7 @@ static void cleanup_memory_ranges()
  * Allocate memory for various data structures used to hold
  * values of different memory ranges
  */
-static int alloc_memory_ranges()
+static int alloc_memory_ranges(void)
 {
 	int memory_range_len;
 
@@ -105,7 +102,7 @@ err1:
  * max_memory_ranges variable. This variable replaces MAX_MEMORY_RANGES
  * macro used earlier.
  */
-static int count_memory_ranges()
+static int count_memory_ranges(void)
 {
 	char device_tree[256] = "/proc/device-tree/";
 	struct dirent *dentry;
@@ -132,8 +129,32 @@ static int count_memory_ranges()
 	return 0;
 }
 
+/* Sort the base ranges in memory - this is useful for ensuring that our
+ * ranges are in ascending order, even if device-tree read of memory nodes
+ * is done differently. Also, could be used for other range coalescing later
+ */
+static int sort_base_ranges(void)
+{
+	int i, j;
+	unsigned long long tstart, tend;
+
+	for (i = 0; i < nr_memory_ranges - 1; i++) {
+		for (j = 0; j < nr_memory_ranges - i - 1; j++) {
+			if (base_memory_range[j].start > base_memory_range[j+1].start) {
+				tstart = base_memory_range[j].start;
+				tend = base_memory_range[j].end;
+				base_memory_range[j].start = base_memory_range[j+1].start;
+				base_memory_range[j].end = base_memory_range[j+1].end;
+				base_memory_range[j+1].start = tstart;
+				base_memory_range[j+1].end = tend;
+			}
+		}
+	}
+	return 0;
+}
+
 /* Get base memory ranges */
-static int get_base_ranges()
+static int get_base_ranges(void)
 {
 	int local_memory_ranges = 0;
 	char device_tree[256] = "/proc/device-tree/";
@@ -204,32 +225,8 @@ static int get_base_ranges()
 	return 0;
 }
 
-/* Sort the base ranges in memory - this is useful for ensuring that our
- * ranges are in ascending order, even if device-tree read of memory nodes
- * is done differently. Also, could be used for other range coalescing later
- */
-static int sort_base_ranges()
-{
-	int i, j;
-	unsigned long long tstart, tend;
-
-	for (i = 0; i < nr_memory_ranges - 1; i++) {
-		for (j = 0; j < nr_memory_ranges - i - 1; j++) {
-			if (base_memory_range[j].start > base_memory_range[j+1].start) {
-				tstart = base_memory_range[j].start;
-				tend = base_memory_range[j].end;
-				base_memory_range[j].start = base_memory_range[j+1].start;
-				base_memory_range[j].end = base_memory_range[j+1].end;
-				base_memory_range[j+1].start = tstart;
-				base_memory_range[j+1].end = tend;
-			}
-		}
-	}
-	return 0;
-}
-
 /* Sort the exclude ranges in memory */
-static int sort_ranges()
+static int sort_ranges(void)
 {
 	int i, j;
 	unsigned long long tstart, tend;

-- 





More information about the kexec mailing list