1 From 10d82df8d920ceec4be9028a4939f96d6f407e81 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 26 Aug 2015 09:20:13 +0200
4 Subject: [PATCH] tinypcminfo: make function pcm_get_format_name() static
6 When building tinyalsa with gcc 5.x, the following warnings appear:
8 tinypcminfo.c:97:52: warning: 'format_lookup' is static but used in inline function 'pcm_get_format_name' which is not static
9 return bit_index < ARRAY_SIZE(format_lookup) ? format_lookup[bit_index] : NULL;
11 tinypcminfo.c:97:35: warning: 'format_lookup' is static but used in inline function 'pcm_get_format_name' which is not static
12 return bit_index < ARRAY_SIZE(format_lookup) ? format_lookup[bit_index] : NULL;
14 And the build fails with:
16 tinypcminfo.o: In function `main':
17 tinypcminfo.c:(.text+0x2f0): undefined reference to `pcm_get_format_name'
18 collect2: error: ld returned 1 exit status
20 To fix this, this patch marks the pcm_get_format_name() as static,
21 since it's anyway only used in tinypcminfo.c.
23 Submitted upstream: https://github.com/tinyalsa/tinyalsa/pull/61
25 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
28 1 file changed, 1 insertion(+), 1 deletion(-)
30 diff --git a/tinypcminfo.c b/tinypcminfo.c
31 index b2d11bc..99eec34 100644
34 @@ -92,7 +92,7 @@ static const char *format_lookup[] = {
35 /* Returns a human readable name for the format associated with bit_index,
36 * NULL if bit_index is not known.
38 -inline const char *pcm_get_format_name(unsigned bit_index)
39 +static inline const char *pcm_get_format_name(unsigned bit_index)
41 return bit_index < ARRAY_SIZE(format_lookup) ? format_lookup[bit_index] : NULL;