From patchwork Thu Mar 31 11:21:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 8711081 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03EE8C0553 for ; Thu, 31 Mar 2016 11:22:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E08BA2025B for ; Thu, 31 Mar 2016 11:22:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6970B20166 for ; Thu, 31 Mar 2016 11:22:40 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F30F5266021; Thu, 31 Mar 2016 13:22:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0DF4F261ACD; Thu, 31 Mar 2016 13:22:09 +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 1AFD326580E; Thu, 31 Mar 2016 13:22:07 +0200 (CEST) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by alsa0.perex.cz (Postfix) with ESMTP id 0FA5A2612CC for ; Thu, 31 Mar 2016 13:21:55 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id 20so109438649wmh.1 for ; Thu, 31 Mar 2016 04:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=dmD806voWZzf6wgqsNuv6oJ17Kln0YUCCR7BGQKgrWg=; b=VFNQyKNieneFdKVICMyUIzN+Yd1EeISrg1VoDGJ96zlPeBnQSutiUJjMQ0RLaY5dV8 Yev3azgRMO8MqYHGU+do5wE9Cd+OnjI9kX8NXiExfp0kBWfcW8ZVRZ8mMZpl+vKQOeAI HB2lb9u7LHFIT4XcTWJUH3E1pz9w+Yu1jxl3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dmD806voWZzf6wgqsNuv6oJ17Kln0YUCCR7BGQKgrWg=; b=gro3IhhqeCQ5N045PQbIkCu5r9d5PRM5tRBRP6+DlzSvRANN/93dHjYQ1JPGMLW9/q TBhjG22rznMGl5Rrhghy3Sa3rP354dWpvuqV/pykaV+4V914xhhqz++5Tq7ZI+BlhmZb a+WU54ztVTgx4Nko+tCP7eRd8ChT/GMBp8NMwHWI+Qk3iJgDrPnTkIzBijvGjygMPCca nr7OTLqstTB6PvprVGuTwfn10gUG0pF0WhyI0rXBUUjBAMJpff4LaxG4e7n51WBnFFjG H/PvV4XnNARHEeZV098wZt+gE1IPMJzlFRpGpulGm2H+aJ3cLSWJzfHMRGOdnMINzER+ p1Vw== X-Gm-Message-State: AD7BkJIxIGTJ9uDR2Lgpdy2wLic+UMSa7YQoVwUEQ6WME6z5aVd8FIRvFEM+ODm9yq8ycWR4 X-Received: by 10.28.60.136 with SMTP id j130mr2133858wma.24.1459423315418; Thu, 31 Mar 2016 04:21:55 -0700 (PDT) Received: from localhost.localdomain (host-92-17-247-99.as13285.net. [92.17.247.99]) by smtp.gmail.com with ESMTPSA id ks5sm8582150wjb.13.2016.03.31.04.21.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 04:21:54 -0700 (PDT) From: Srinivas Kandagatla To: Mark Brown , alsa-devel@alsa-project.org, kwestfie@codeaurora.org Date: Thu, 31 Mar 2016 12:21:52 +0100 Message-Id: <1459423312-6334-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.5.0 Cc: plai@codeaurora.org, Srinivas Kandagatla , tiwai@suse.com Subject: [alsa-devel] [PATCH] ASoC: qcom: Fix some static checker warnings 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes below static checker warning plus suggestions from Dan. sound/soc/qcom/lpass-platform.c:555 lpass_platform_pcm_new() error: uninitialized symbol 'ret'. sound/soc/qcom/lpass-platform.c 515 csubstream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; 516 if (csubstream) { 517 if (v->alloc_dma_channel) 518 data->wrdma_ch = v->alloc_dma_channel(drvdata, 519 SNDRV_PCM_STREAM_CAPTURE); 520 521 if (IS_ERR_VALUE(data->wrdma_ch)) 522 goto capture_alloc_err; wrdma_ch is an int so this should just be: if (data->wrdma_ch < 0) { ret = data->wrdma_ch; goto capture_alloc_err; } Reported-by: Dan Carpenter Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/lpass-platform.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 6e86654..db000c6 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -474,7 +474,7 @@ static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime) struct lpass_data *drvdata = snd_soc_platform_get_drvdata(soc_runtime->platform); struct lpass_variant *v = drvdata->variant; - int ret; + int ret = -EINVAL; struct lpass_pcm_data *data; size_t size = lpass_platform_pcm_hardware.buffer_bytes_max; @@ -491,7 +491,7 @@ static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime) data->rdma_ch = v->alloc_dma_channel(drvdata, SNDRV_PCM_STREAM_PLAYBACK); - if (IS_ERR_VALUE(data->rdma_ch)) + if (data->rdma_ch < 0) return data->rdma_ch; drvdata->substream[data->rdma_ch] = psubstream; @@ -518,8 +518,10 @@ static int lpass_platform_pcm_new(struct snd_soc_pcm_runtime *soc_runtime) data->wrdma_ch = v->alloc_dma_channel(drvdata, SNDRV_PCM_STREAM_CAPTURE); - if (IS_ERR_VALUE(data->wrdma_ch)) + if (data->wrdma_ch < 0) { + ret = data->wrdma_ch; goto capture_alloc_err; + } drvdata->substream[data->wrdma_ch] = csubstream;