[Sound-open-firmware] [PATCH] sof: check for missing prototypes

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Mon Sep 25 21:55:09 CEST 2017


gcc -Wall is not enough, add -Wmissing-prototypes to align with
kernel warnings.

Add relevant includes and move functions without prototype as static

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
---
 configure.ac                     | 2 +-
 src/arch/xtensa/task.c           | 1 +
 src/audio/src_core.c             | 6 +++---
 src/include/reef/init.h          | 2 ++
 src/include/reef/interrupt.h     | 2 +-
 src/ipc/pmc-ipc.c                | 1 +
 src/lib/schedule.c               | 8 +++++---
 src/platform/baytrail/platform.c | 1 +
 src/platform/baytrail/timer.c    | 2 +-
 9 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1c6fd0a..e8c8edf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@ AC_DEFINE_UNQUOTED([REEF_MINOR], reef_minor, [Reef minor version])
 AC_CANONICAL_HOST
 
 # General compiler flags
-CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -fno-inline-functions -nostdlib"
+CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -fno-inline-functions -nostdlib -Wmissing-prototypes"
 
 # Cross compiler tool libgcc and headers
 AC_ARG_WITH([root-dir],
diff --git a/src/arch/xtensa/task.c b/src/arch/xtensa/task.c
index 7e74c07..349f8ab 100644
--- a/src/arch/xtensa/task.c
+++ b/src/arch/xtensa/task.c
@@ -33,6 +33,7 @@
 #include <reef/interrupt.h>
 #include <platform/platform.h>
 #include <reef/debug.h>
+#include <arch/task.h>
 #include <stdint.h>
 #include <errno.h>
 
diff --git a/src/audio/src_core.c b/src/audio/src_core.c
index bce3586..5b804d6 100644
--- a/src/audio/src_core.c
+++ b/src/audio/src_core.c
@@ -52,21 +52,21 @@ int sof_rates[SOF_RATES_LENGTH] = {8000, 11025, 12000, 16000, 18900,
 	192000};
 
 /* Calculates the needed FIR delay line length */
-int src_fir_delay_length(struct src_stage *s)
+static int src_fir_delay_length(struct src_stage *s)
 {
 	return s->subfilter_length + (s->num_of_subfilters - 1) * s->idm
 		+ s->blk_in;
 }
 
 /* Calculates the FIR output delay line length */
-int src_out_delay_length(struct src_stage *s)
+static int src_out_delay_length(struct src_stage *s)
 {
 
 	return (s->num_of_subfilters - 1) * s->odm + 1;
 }
 
 /* Returns index of a matching sample rate */
-int src_find_fs(int fs_list[], int list_length, int fs)
+static int src_find_fs(int fs_list[], int list_length, int fs)
 {
 	int i;
 
diff --git a/src/include/reef/init.h b/src/include/reef/init.h
index c2eaf87..9d97b48 100644
--- a/src/include/reef/init.h
+++ b/src/include/reef/init.h
@@ -38,4 +38,6 @@ int main(int argc, char *argv[]);
 
 int arch_init(struct reef *reef);
 
+void __memmap_init(void);
+
 #endif
diff --git a/src/include/reef/interrupt.h b/src/include/reef/interrupt.h
index 3c78e77..ea7d057 100644
--- a/src/include/reef/interrupt.h
+++ b/src/include/reef/interrupt.h
@@ -79,7 +79,7 @@ static inline void interrupt_global_enable(uint32_t flags)
 	arch_interrupt_global_enable(flags);
 }
 
-uint32_t platform_interrupt_get_enabled();
+uint32_t platform_interrupt_get_enabled(void);
 void platform_interrupt_clear(uint32_t irq, uint32_t mask);
 void platform_interrupt_mask(uint32_t irq, uint32_t mask);
 void platform_interrupt_unmask(uint32_t irq, uint32_t mask);
diff --git a/src/ipc/pmc-ipc.c b/src/ipc/pmc-ipc.c
index b8183c0..fdb8d4b 100644
--- a/src/ipc/pmc-ipc.c
+++ b/src/ipc/pmc-ipc.c
@@ -37,6 +37,7 @@
 #include <reef/wait.h>
 #include <reef/trace.h>
 #include <platform/interrupt.h>
+#include <platform/pmc.h>
 #include <platform/shim.h>
 
 
diff --git a/src/lib/schedule.c b/src/lib/schedule.c
index 142a2fb..427ca2e 100644
--- a/src/lib/schedule.c
+++ b/src/lib/schedule.c
@@ -159,7 +159,7 @@ static uint32_t sch_work(void *data, uint32_t delay)
  * Schedule task with the earliest deadline from task list.
  * Can run in IRQ context.
  */
-struct task *schedule_edf(void)
+static struct task *schedule_edf(void)
 {
 	struct task *task;
 	struct task *next_plus1_task = NULL;
@@ -201,8 +201,9 @@ struct task *schedule_edf(void)
 	return next_plus1_task;
 }
 
+#if 0 /* FIXME: is this needed ? */
 /* delete task from scheduler */
-int schedule_task_del(struct task *task)
+static int schedule_task_del(struct task *task)
 {
 	uint32_t flags;
 	int ret = 0;
@@ -225,6 +226,7 @@ out:
 	spin_unlock_irq(&sch->lock, flags);
 	return ret;
 }
+#endif
 
 /*
  * Add a new task to the scheduler to be run and define a scheduling
@@ -285,7 +287,7 @@ void schedule_task_complete(struct task *task)
 	spin_unlock_irq(&sch->lock, flags);
 }
 
-void scheduler_run(void *unused)
+static void scheduler_run(void *unused)
 {
 	struct task *next_task;
 
diff --git a/src/platform/baytrail/platform.c b/src/platform/baytrail/platform.c
index e3daf48..b701196 100644
--- a/src/platform/baytrail/platform.c
+++ b/src/platform/baytrail/platform.c
@@ -40,6 +40,7 @@
 #include <reef/mailbox.h>
 #include <reef/dai.h>
 #include <reef/dma.h>
+#include <reef/interrupt.h>
 #include <reef/reef.h>
 #include <reef/work.h>
 #include <reef/clock.h>
diff --git a/src/platform/baytrail/timer.c b/src/platform/baytrail/timer.c
index 513ede1..9256dd9 100644
--- a/src/platform/baytrail/timer.c
+++ b/src/platform/baytrail/timer.c
@@ -44,7 +44,7 @@ struct timer_data {
 
 static struct timer_data xtimer[1] = {};
 
-void platform_timer_64_handler(void *arg)
+static void platform_timer_64_handler(void *arg)
 {
 	struct timer *timer = arg;
 	struct timer_data *tdata = timer->timer_data;
-- 
2.11.0



More information about the Sound-open-firmware mailing list