[alsa-devel] [PATCH 2/5] cplay: remove dead code codec_name_from_id()

Vinod Koul vinod.koul at intel.com
Thu Apr 19 08:36:17 CEST 2018


The codec_name_from_id() was added but never used so remove it and
eliminate unused function warning

cplay.c:103:20: warning: ‘codec_name_from_id’ defined but not used [-Wunused-function]

We can take from git if user appears

Signed-off-by: Vinod Koul <vinod.koul at intel.com>
---
CC: Katsuhiro Suzuki <suzuki.katsuhiro at socionext.com>

 src/utils/cplay.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/src/utils/cplay.c b/src/utils/cplay.c
index 98d71a2199da..b02644a3f2ea 100644
--- a/src/utils/cplay.c
+++ b/src/utils/cplay.c
@@ -100,20 +100,6 @@ static const struct {
 };
 #define CPLAY_NUM_CODEC_IDS (sizeof(codec_ids) / sizeof(codec_ids[0]))
 
-static const char *codec_name_from_id(unsigned int id)
-{
-	static char hexname[12];
-	int i;
-
-	for (i = 0; i < CPLAY_NUM_CODEC_IDS; ++i) {
-		if (codec_ids[i].id == id)
-			return codec_ids[i].name;
-	}
-
-	snprintf(hexname, sizeof(hexname), "0x%x", id);
-	return hexname; /* a static is safe because we're single-threaded */
-}
-
 static void usage(void)
 {
 	int i;
-- 
2.7.4



More information about the Alsa-devel mailing list