[Sound-open-firmware] [PATCH] Fix compilation errors triggered by -Werror=missing-prototypes

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Wed Sep 27 18:59:52 CEST 2017


On 9/27/17 9:31 AM, Seppo Ingalsuo wrote:
> This patch adds include statements for modules to introduce the
> function prototypes for trig.c, numbers.c, and lib.c. In addition
> three unused functions are disabled with #if 0.

The Tensilica HALs file needs a lot of love, it's quite ugly and 
generates tons of warnings. missing prototypes is just one of the 
symptoms. We should work on this as a separate topic, possibly with 
Cadence since it came from them in the first place.

I screwed up and forgot to send my revised version for prototypes, I'll 
send it now. Sorry to have you work on something I fixed already...


> Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo at linux.intel.com>
> ---
>   src/arch/xtensa/hal/set_region_translate.c   | 2 ++
>   src/arch/xtensa/xtos/exc-syscall-c-handler.c | 3 +++
>   src/lib/lib.c                                | 1 +
>   src/math/numbers.c                           | 2 ++
>   src/math/trig.c                              | 1 +
>   5 files changed, 9 insertions(+)
> 
> diff --git a/src/arch/xtensa/hal/set_region_translate.c b/src/arch/xtensa/hal/set_region_translate.c
> index 7e885f6..5d5b21d 100644
> --- a/src/arch/xtensa/hal/set_region_translate.c
> +++ b/src/arch/xtensa/hal/set_region_translate.c
> @@ -69,6 +69,7 @@ static inline unsigned probe_itlb(unsigned addr) {
>   	return tmp;
>   }
>   
> +#if 0
>   void invalidate_dtlb_entry(unsigned addr) {
>   	__asm__ __volatile__("idtlb  %0; dsync \n\t"
>   			: : "a" (addr));
> @@ -78,6 +79,7 @@ void invalidate_itlb_entry(unsigned addr) {
>   	__asm__ __volatile__("iitlb  %0 ; isync\n\t"
>   			: : "a" (addr));
>   }
> +#endif
>   
>   static inline unsigned read_dtlbcfg() {
>   	unsigned long tmp;
> diff --git a/src/arch/xtensa/xtos/exc-syscall-c-handler.c b/src/arch/xtensa/xtos/exc-syscall-c-handler.c
> index 405f7b6..aa43d27 100644
> --- a/src/arch/xtensa/xtos/exc-syscall-c-handler.c
> +++ b/src/arch/xtensa/xtos/exc-syscall-c-handler.c
> @@ -42,6 +42,8 @@
>    *	_xtos_set_exception_handler( EXCCAUSE_SYSCALL,
>    *			(_xtos_handler)_xtos_p_syscall_handler );
>    */
> +
> +#if 0
>   UserFrame* _xtos_p_syscall_handler( UserFrame *uf /*, int cause */ )
>   {
>       uf->pc += 3;	/* skip SYSCALL instruction */
> @@ -98,4 +100,5 @@ UserFrame* _xtos_p_syscall_handler( UserFrame *uf /*, int cause */ )
>   
>       return( uf );
>   }
> +#endif
>   
> diff --git a/src/lib/lib.c b/src/lib/lib.c
> index e1b1d9a..a1c9933 100644
> --- a/src/lib/lib.c
> +++ b/src/lib/lib.c
> @@ -31,6 +31,7 @@
>   #include <stdint.h>
>   #include <stdlib.h>
>   #include <reef/reef.h>
> +#include <reef/alloc.h>
>   
>   #if 0 // TODO: only compile if no arch memcpy is available.
>   
> diff --git a/src/math/numbers.c b/src/math/numbers.c
> index 579de5d..67492a0 100644
> --- a/src/math/numbers.c
> +++ b/src/math/numbers.c
> @@ -35,6 +35,8 @@
>    * https://en.wikipedia.org/wiki/Euclidean_algorithm#Implementations
>    */
>   
> +#include <reef/math/numbers.h>
> +
>   int gcd(int a, int b)
>   {
>   	int t;
> diff --git a/src/math/trig.c b/src/math/trig.c
> index 8101980..79eb480 100644
> --- a/src/math/trig.c
> +++ b/src/math/trig.c
> @@ -32,6 +32,7 @@
>   
>   #include <stdint.h>
>   #include <reef/audio/format.h>
> +#include <reef/math/trig.h>
>   
>   
>   #define SINE_C_Q20 341782638 /* 2*SINE_NQUART/pi in Q12.20 */
> 



More information about the Sound-open-firmware mailing list