From patchwork Mon Feb 13 18:13:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 56424 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2499786wrn; Mon, 13 Feb 2023 10:23:47 -0800 (PST) X-Google-Smtp-Source: AK7set88H3kwr7zzpMa+birkN2FUlDF7nM1SL17DbTXui5mmlONWHX/MfSH3lytqNGYYlun4hRpt X-Received: by 2002:a17:902:f142:b0:19a:7b73:8da9 with SMTP id d2-20020a170902f14200b0019a7b738da9mr7840739plb.32.1676312627420; Mon, 13 Feb 2023 10:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676312627; cv=none; d=google.com; s=arc-20160816; b=xbOczSy06bH1WszQWo0K9qGujHx48MRlcv8GXUZZL4PBhtIdYtfuuGkpPcmSNW2Vjf CYC8e+WMUEGGQNhtMUHzpwlTvrohZtB2QL3l2ROn4oraqpioXCNIxY+vpi5Z290vNvHm 7obBY4TLRVKztmFCq1L0QGhV4VEDeShwkc+bQNfr7iZb1B8b/5FZoP9EG4KwRXoYQeMZ /resWnX5JpxcifUP2OfAOVfEygbHy7UwhfaZyilIO/ehLWv4teVek4eQpW4k1iZboTCo w6s8GuH4psTXXCzp30/MCF53bKXMb4IQlJu/mhoetC8pwPMKxGBe9uytOO1oWIbj9VqR fFlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=QQxzzYRPxVE1aK6pZAbkCBvsRDQh2nCLiA9U8B0Lto8=; b=px2abmp/oAIuogOl5ZLbI4v6Pxm6GtRct+LPVMy0j+b/8lehlE09GUdWcfTFxXM1W3 BsH1xLL/W2/c378LdNpXSiw41wpZoEWwgVKa9xy6lW70uKtEaEwgiWl/5zjyDdoYsu97 tfPtQGdqLDrFmgOo9XhwasHUQl3X2dA9v+wCBAxt/HXz9MWJNjoXs4jWDdoNIlic+W7S ysE9dFmV7ayoeAg8U4iT6d8od+pgM7FdsiJYc9glrFPQS5phnpO8Bke4PAijRZf0EsYS H5e/syrWnLZwg1Ra/w0mGEEgkXIyoovvdIjcpixfvwG3Ze3SpLFNbQCQqlBq11TMaLc6 Z66Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=WOxJY9do; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y191-20020a638ac8000000b004fb96a0201csi5589736pgd.386.2023.02.13.10.23.33; Mon, 13 Feb 2023 10:23:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=WOxJY9do; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231254AbjBMSNz (ORCPT + 99 others); Mon, 13 Feb 2023 13:13:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbjBMSNy (ORCPT ); Mon, 13 Feb 2023 13:13:54 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 026E111D for ; Mon, 13 Feb 2023 10:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1676311991; bh=SAwHxQ/gSzx3tIPkoaBgffqQPABlaFMW+rxGRpZZdtU=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=WOxJY9doUQun7DHJGdNqL2N6NZJXqvNK6kLIo0oOCOiHGxZImLdYGtpTh9c8XIrrr n3yBFPgJ/Qu1a2FXUAAlYspClGxVF0c1w9KaTzj0AicJo2B74IVPEw1cSN17aydPR/ 8bTTt6oxQD/oTe6R/4QJoArYmV18fuCN6aCDPnX4= Received: by b-1.in.mailobj.net [192.168.90.11] with ESMTP via ip-206.mailobj.net [213.182.55.206] Mon, 13 Feb 2023 19:13:10 +0100 (CET) X-EA-Auth: mVOtM26hiXOBErT5zUvL2AUpwMZen8W1yzH2o2fU8H6i/YJLJZUYw/Hgyue7COmu2GQyHjdRlMk9Tu+oYwHqJ9yq0UfBQuWD Date: Mon, 13 Feb 2023 23:43:03 +0530 From: Deepak R Varma To: Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , NXP Linux Team , alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar , Deepak R Varma Subject: [PATCH] ASoC: imx-pcm-rpmsg: Remove unused variable Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757741189873414179?= X-GMAIL-MSGID: =?utf-8?q?1757741189873414179?= Variable ret is initialed but is never modified or used except for returning the initial value 0. The value can be directly returned instead and the variable definition can be dropped. Issue identified using returnvar.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma --- sound/soc/fsl/imx-pcm-rpmsg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index 2f310994f7ee..6614b3447649 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -140,7 +140,6 @@ static int imx_rpmsg_pcm_hw_params(struct snd_soc_component *component, { struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - int ret = 0; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { msg = &info->msg[TX_HW_PARAM]; @@ -184,7 +183,7 @@ static int imx_rpmsg_pcm_hw_params(struct snd_soc_component *component, info->send_message(msg, info); - return ret; + return 0; } static snd_pcm_uframes_t imx_rpmsg_pcm_pointer(struct snd_soc_component *component, @@ -282,7 +281,6 @@ static int imx_rpmsg_pcm_close(struct snd_soc_component *component, struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - int ret = 0; /* Flush work in workqueue to make TX_CLOSE is the last message */ flush_workqueue(info->rpmsg_wq); @@ -305,7 +303,7 @@ static int imx_rpmsg_pcm_close(struct snd_soc_component *component, dev_warn(rtd->dev, "Msg is dropped!, number is %d\n", info->msg_drop_count[substream->stream]); - return ret; + return 0; } static int imx_rpmsg_pcm_prepare(struct snd_soc_component *component,