From patchwork Fri Aug 25 15:36:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandra Diupina X-Patchwork-Id: 13367323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B56BEC83F01 for ; Sun, 27 Aug 2023 17:06:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E26DD9F6; Sun, 27 Aug 2023 19:05:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E26DD9F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693155983; bh=xyshS61kGazW0xYKaF9opMK/Xa2fYOjK5ZH9KHpV3mY=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=kbu7wZ4G1qURyuhVZEDBnB2TxLZFsJpExwC+IRFkuZ5bdP+RtTYm5Q80ALYsDGBDO P70hynsRhiz2GO9wevh4FKpIGEAW6Q0bm37iZd/Nj8xNtyICObEnQSlM+5BpJOLdpN iMGLoVt2Vi4XbeqCmmDkllF6gQfQGB/YnkCDOGgI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7B3FDF805F5; Sun, 27 Aug 2023 19:02:26 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id BA370F805FB; Sun, 27 Aug 2023 19:02:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 17F75F800F5; Fri, 25 Aug 2023 17:37:17 +0200 (CEST) Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 98548F800AE for ; Fri, 25 Aug 2023 17:37:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 98548F800AE Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 202671868942; Fri, 25 Aug 2023 18:37:07 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id v73nNLLpUn7Y; Fri, 25 Aug 2023 18:37:06 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 87BBD1867579; Fri, 25 Aug 2023 18:37:06 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id I_6nBa4-AHub; Fri, 25 Aug 2023 18:37:06 +0300 (MSK) Received: from rbta-msk-lt-302690.astralinux.ru (unknown [10.177.233.189]) by mail.astralinux.ru (Postfix) with ESMTPSA id 72BA51868950; Fri, 25 Aug 2023 18:37:04 +0300 (MSK) From: Alexandra Diupina To: Liam Girdwood Cc: Alexandra Diupina , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , Eason Yen , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] asoc: mediatek: common: Remove check of return value of mtk_memif_set_addr() and mtk_memif_set_format() Date: Fri, 25 Aug 2023 18:36:50 +0300 Message-Id: <20230825153650.20923-1-adiupina@astralinux.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-MailFrom: adiupina@astralinux.ru X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: 64F7PGD3WYJ2OLQQYZ6T7SAHRHJDT33A X-Message-ID-Hash: 64F7PGD3WYJ2OLQQYZ6T7SAHRHJDT33A X-Mailman-Approved-At: Sun, 27 Aug 2023 17:02:16 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The mtk_memif_set_addr() and mtk_memif_set_format() functions always returns 0, so it is necessary to remove the check of its return value (which was probably specified by analogy with the check of return values for other functions) to make the code more readable Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: df799b9502ed ("ASoC: mediatek: common: refine hw_params and hw_prepare") Signed-off-by: Alexandra Diupina --- sound/soc/mediatek/common/mtk-afe-fe-dai.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sound/soc/mediatek/common/mtk-afe-fe-dai.c b/sound/soc/mediatek/common/mtk-afe-fe-dai.c index 882cdf86c8bf..3c8a11c5958d 100644 --- a/sound/soc/mediatek/common/mtk-afe-fe-dai.c +++ b/sound/soc/mediatek/common/mtk-afe-fe-dai.c @@ -143,15 +143,10 @@ int mtk_afe_fe_hw_params(struct snd_pcm_substream *substream, substream->runtime->dma_bytes); /* set addr */ - ret = mtk_memif_set_addr(afe, id, + mtk_memif_set_addr(afe, id, substream->runtime->dma_area, substream->runtime->dma_addr, substream->runtime->dma_bytes); - if (ret) { - dev_err(afe->dev, "%s(), error, id %d, set addr, ret %d\n", - __func__, id, ret); - return ret; - } /* set channel */ ret = mtk_memif_set_channel(afe, id, channels); @@ -170,12 +165,7 @@ int mtk_afe_fe_hw_params(struct snd_pcm_substream *substream, } /* set format */ - ret = mtk_memif_set_format(afe, id, format); - if (ret) { - dev_err(afe->dev, "%s(), error, id %d, set format %d, ret %d\n", - __func__, id, format, ret); - return ret; - } + mtk_memif_set_format(afe, id, format); return 0; }