From patchwork Thu Apr 19 06:36:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10349157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 20FA36023A for ; Thu, 19 Apr 2018 06:32:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 126E526223 for ; Thu, 19 Apr 2018 06:32:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06DF927F94; Thu, 19 Apr 2018 06:32:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3993F26223 for ; Thu, 19 Apr 2018 06:31:59 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EAFB526732A; Thu, 19 Apr 2018 08:31:57 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A7E1D267265; Thu, 19 Apr 2018 08:31:55 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by alsa0.perex.cz (Postfix) with ESMTP id 03E2C267265 for ; Thu, 19 Apr 2018 08:31:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2018 23:31:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,467,1517904000"; d="scan'208";a="49074182" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by orsmga001.jf.intel.com with ESMTP; 18 Apr 2018 23:31:48 -0700 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Thu, 19 Apr 2018 12:06:16 +0530 Message-Id: <1524119780-21206-1-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Cc: Vinod Koul Subject: [alsa-devel] [PATCH 1/5] compress: remove dead code _is_codec_supported() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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, ¶ms);