[Skiboot] [PATCH 1/6] pflash: build with skiboot HOSTCFLAGS warnings

Stewart Smith stewart at linux.vnet.ibm.com
Mon Jul 17 19:13:55 AEST 2017


mostly missing prototypes and unused parameters.

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 external/common/arch_flash_common.c | 12 +++++++++---
 external/common/arch_flash_x86.c    |  1 +
 external/pflash/pflash.c            |  2 +-
 external/pflash/progress.c          |  1 +
 libflash/file.c                     |  1 +
 5 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/external/common/arch_flash_common.c b/external/common/arch_flash_common.c
index 5b7f9ea0ec1f..6bce7e1ba4d8 100644
--- a/external/common/arch_flash_common.c
+++ b/external/common/arch_flash_common.c
@@ -40,17 +40,23 @@ int __attribute__((weak)) arch_flash_erase_chip(struct blocklevel_device *bl)
 	return blocklevel_erase(bl, 0, total_size);
 }
 
-int __attribute__((weak)) arch_flash_4b_mode(struct blocklevel_device *bl, int set_4b)
+int __attribute__((weak,const)) arch_flash_4b_mode(struct blocklevel_device *bl, int set_4b)
 {
+	(void)bl;
+	(void)set_4b;
 	return -1;
 }
 
-enum flash_access __attribute__((weak)) arch_flash_access(struct blocklevel_device *bl, enum flash_access access)
+enum flash_access __attribute__((weak,const)) arch_flash_access(struct blocklevel_device *bl, enum flash_access access)
 {
+	(void)bl;
+	(void)access;
 	return ACCESS_INVAL;
 }
 
-int __attribute__((weak)) arch_flash_set_wrprotect(struct blocklevel_device *bl, int set)
+int __attribute__((weak,const)) arch_flash_set_wrprotect(struct blocklevel_device *bl, int set)
 {
+	(void)bl;
+	(void)set;
 	return -1;
 }
diff --git a/external/common/arch_flash_x86.c b/external/common/arch_flash_x86.c
index 0146243d541e..3638d73645f7 100644
--- a/external/common/arch_flash_x86.c
+++ b/external/common/arch_flash_x86.c
@@ -49,5 +49,6 @@ int arch_flash_init(struct blocklevel_device **r_bl, const char *file, bool keep
 
 void arch_flash_close(struct blocklevel_device *bl, const char *file)
 {
+	(void)file;
 	file_exit_close(bl);
 }
diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c
index 3d172d71db8d..7e1d47f40ac7 100644
--- a/external/pflash/pflash.c
+++ b/external/pflash/pflash.c
@@ -595,7 +595,7 @@ static void print_help(const char *pname)
 	printf("\t\tThis message.\n\n");
 }
 
-void exiting(void)
+static void exiting(void)
 {
 	if (need_relock)
 		arch_flash_set_wrprotect(bl, 1);
diff --git a/external/pflash/progress.c b/external/pflash/progress.c
index 4012020a1f2f..f4406a785b74 100644
--- a/external/pflash/progress.c
+++ b/external/pflash/progress.c
@@ -3,6 +3,7 @@
 #include <string.h>
 #include <limits.h>
 #include <time.h>
+#include "progress.h"
 
 static unsigned long progress_max;
 static unsigned int progress_pcent;
diff --git a/libflash/file.c b/libflash/file.c
index 8d1ed02a57c7..2d3f27db4324 100644
--- a/libflash/file.c
+++ b/libflash/file.c
@@ -31,6 +31,7 @@
 #include <mtd/mtd-abi.h>
 
 #include "libflash.h"
+#include "libflash/file.h"
 #include "blocklevel.h"
 
 struct file_data {
-- 
2.13.0



More information about the Skiboot mailing list