Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] compress: remove dead code _is_codec_supported()
@ 2018-04-19  6:36 Vinod Koul
  2018-04-19  6:36 ` [PATCH 2/5] cplay: remove dead code codec_name_from_id() Vinod Koul
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Vinod Koul @ 2018-04-19  6:36 UTC (permalink / raw)
  To: alsa-devel; +Cc: Vinod Koul

The _is_codec_supported() was dead and none using it, so remove this and
eliminate unused function warning

compress.c:145:13: warning: ‘_is_codec_supported’ defined but not used [-Wunused-function]

We can take from git if user appears

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 src/lib/compress.c | 53 -----------------------------------------------------
 1 file changed, 53 deletions(-)

diff --git a/src/lib/compress.c b/src/lib/compress.c
index 8ae6bbda7a89..934690e39ed0 100644
--- a/src/lib/compress.c
+++ b/src/lib/compress.c
@@ -142,49 +142,6 @@ static int get_compress_version(struct compress *compress)
 	return version;
 }
 
-static bool _is_codec_supported(struct compress *compress, struct compr_config *config,
-				const struct snd_compr_caps *caps)
-{
-	bool codec = false;
-	unsigned int i;
-
-	for (i = 0; i < caps->num_codecs; i++) {
-		if (caps->codecs[i] == config->codec->id) {
-			/* found the codec */
-			codec = true;
-			break;
-		}
-	}
-	if (codec == false) {
-		oops(compress, ENXIO, "this codec is not supported");
-		return false;
-	}
-
-	if (config->fragment_size < caps->min_fragment_size) {
-		oops(compress, EINVAL, "requested fragment size %d is below min supported %d",
-			config->fragment_size, caps->min_fragment_size);
-		return false;
-	}
-	if (config->fragment_size > caps->max_fragment_size) {
-		oops(compress, EINVAL, "requested fragment size %d is above max supported %d",
-			config->fragment_size, caps->max_fragment_size);
-		return false;
-	}
-	if (config->fragments < caps->min_fragments) {
-		oops(compress, EINVAL, "requested fragments %d are below min supported %d",
-			config->fragments, caps->min_fragments);
-		return false;
-	}
-	if (config->fragments > caps->max_fragments) {
-		oops(compress, EINVAL, "requested fragments %d are above max supported %d",
-			config->fragments, caps->max_fragments);
-		return false;
-	}
-
-	/* TODO: match the codec properties */
-	return true;
-}
-
 static bool _is_codec_type_supported(int fd, struct snd_codec *codec)
 {
 	struct snd_compr_caps caps;
@@ -271,16 +228,6 @@ struct compress *compress_open(unsigned int card, unsigned int device,
 		config->fragments = caps.max_fragments;
 	}
 
-#if 0
-	/* FIXME need to turn this On when DSP supports
-	 * and treat in no support case
-	 */
-	if (_is_codec_supported(compress, config, &caps) == false) {
-		oops(compress, errno, "codec not supported\n");
-		goto codec_fail;
-	}
-#endif
-
 	memcpy(compress->config, config, sizeof(*compress->config));
 	fill_compress_params(config, &params);
 
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-20 22:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-19  6:36 [PATCH 1/5] compress: remove dead code _is_codec_supported() Vinod Koul
2018-04-19  6:36 ` [PATCH 2/5] cplay: remove dead code codec_name_from_id() Vinod Koul
2018-04-19  6:36 ` [PATCH 3/5] cplay: remove dead code check_codec_format_supported() Vinod Koul
2018-04-19  6:36 ` [PATCH 4/5] cplay: fix incorrect print specifier warning Vinod Koul
2018-04-19  6:36 ` [PATCH 5/5] crecord: " Vinod Koul
2018-04-19  7:19 ` [PATCH 1/5] compress: remove dead code _is_codec_supported() Pierre-Louis Bossart
2018-04-19  8:08   ` Vinod Koul
2018-04-20 22:20     ` Pierre-Louis Bossart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox