0001-tinypcminfo-make-function-pcm_get_format_name-static.patch 1.8 KB

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