diff mbox series

[01/10] Silence sparse warning for version.c

Message ID 20190718065117.16923-2-stewart@linux.ibm.com
State Accepted
Headers show
Series Misc sparse fixes | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (3a6fdede6ce117facec0108afe716cf5d0472c3f)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Stewart Smith July 18, 2019, 6:51 a.m. UTC
version.c:1:12: warning: symbol 'version' was not declared. Should it be static?

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 Makefile.main | 1 +
 core/init.c   | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/Makefile.main b/Makefile.main
index fac6e4487460..56fa2bae9e14 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -303,6 +303,7 @@  version.c: $(SRC)/make_version.sh $(OBJS_NO_VER) .version
 	@(if [ "a$(VERSION)" = "a" ]; then \
 		echo "#error You need to set SKIBOOT_VERSION environment variable" > $@ ;\
         else \
+		echo "extern const char version[];"; \
                 echo "const char version[] = \"$(VERSION)\";" ;\
         fi) > $@
 
diff --git a/core/init.c b/core/init.c
index 271736be8325..c99302c86500 100644
--- a/core/init.c
+++ b/core/init.c
@@ -57,6 +57,7 @@ 
 enum proc_gen proc_gen;
 unsigned int pcie_max_link_speed;
 bool verbose_eeh;
+extern const char version[];
 
 static uint64_t kernel_entry;
 static size_t kernel_size;