From patchwork Mon Aug 16 04:55:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46D0AC4338F for ; Mon, 16 Aug 2021 05:20:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BB3FD619E5 for ; Mon, 16 Aug 2021 05:20:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BB3FD619E5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8959516D7; Mon, 16 Aug 2021 06:56:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8959516D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629089833; bh=3L6RNVVdYgLc3LPu4Pjz9RCx8JcYZQQKanswYab91sM=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CRfMdSRyGcE1QXEjzBXDtP5zqXiX+mVP9Y6FuqyZlrp1nRDyxIMRNZIGE16ZhWfan kuKyEdPQOhxqlV+TQa7Grxi21bhTsXa1GW33UqQhYdi+6vas0Ht+o/dhm80xVNWcFv zEc7nyzjR/n+s0Z01kBb8lk2fmBPEwU8t86b/wCg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3E327F802BE; Mon, 16 Aug 2021 06:55:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 39FA0F802C8; Mon, 16 Aug 2021 06:55:58 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 23DA3F80259 for ; Mon, 16 Aug 2021 06:55:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 23DA3F80259 Date: 16 Aug 2021 13:55:44 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90751717" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Aug 2021 13:55:44 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 7971D4001948; Mon, 16 Aug 2021 13:55:44 +0900 (JST) Message-ID: <8735ra0yzz.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/9] ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:82:6: style: The scope of the variable 'ret' can be reduced. [variableScope] int ret; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-generic-dmaengine-pcm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 9ef80a48707e..9949db4649f4 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -79,7 +79,6 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component, struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); struct dma_slave_config slave_config; - int ret; memset(&slave_config, 0, sizeof(slave_config)); @@ -89,7 +88,7 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component, prepare_slave_config = pcm->config->prepare_slave_config; if (prepare_slave_config) { - ret = prepare_slave_config(substream, params, &slave_config); + int ret = prepare_slave_config(substream, params, &slave_config); if (ret) return ret; From patchwork Mon Aug 16 04:55:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3EE8C4338F for ; Mon, 16 Aug 2021 04:58:02 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E0941619E0 for ; Mon, 16 Aug 2021 04:58:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E0941619E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 727A216E4; Mon, 16 Aug 2021 06:57:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 727A216E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629089872; bh=nuJAsdhRU6GW/E8ThlqpZMJ7gA0fYB0WJcQtMOfvXEM=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=L0wFsRbpXlC3ZTM7is9XsrI+Ft8om5NNeAVXHf8iLeqNK+Y/98Z5lWBH/onA0CSdx GghrStm0khmlq7ViuJhaHF8FMjzeI/Cum/6Jcp8x2WyYPpWi8bDle67Zhltns5P5wH A2+Aq7IcB5+Yb7xwiY5fyFFFWBdBgkQkdXHlScqs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 82609F802C8; Mon, 16 Aug 2021 06:56:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1D937F804E1; Mon, 16 Aug 2021 06:56:02 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 48A33F80134 for ; Mon, 16 Aug 2021 06:55:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 48A33F80134 Date: 16 Aug 2021 13:55:51 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90740471" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Aug 2021 13:55:51 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 742914001948; Mon, 16 Aug 2021 13:55:51 +0900 (JST) Message-ID: <871r6u0yzs.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/9] ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:233:28: style: The scope of the variable 'substream' can be reduced. [variableScope] struct snd_pcm_substream *substream; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-generic-dmaengine-pcm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 9949db4649f4..24b240783cf1 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -229,7 +229,6 @@ static int dmaengine_pcm_new(struct snd_soc_component *component, struct dmaengine_pcm *pcm = soc_component_to_pcm(component); const struct snd_dmaengine_pcm_config *config = pcm->config; struct device *dev = component->dev; - struct snd_pcm_substream *substream; size_t prealloc_buffer_size; size_t max_buffer_size; unsigned int i; @@ -243,7 +242,7 @@ static int dmaengine_pcm_new(struct snd_soc_component *component, } for_each_pcm_streams(i) { - substream = rtd->pcm->streams[i].substream; + struct snd_pcm_substream *substream = rtd->pcm->streams[i].substream; if (!substream) continue; From patchwork Mon Aug 16 04:55:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBB2CC4338F for ; Mon, 16 Aug 2021 04:58:51 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 39553619E2 for ; Mon, 16 Aug 2021 04:58:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 39553619E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8450816EA; Mon, 16 Aug 2021 06:57:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8450816EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629089892; bh=sEAqrevb1X4UW7gM3UVfJE/SRcUbsBfOWT89noNyQd4=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qH6mZc71icmen/gkgebqK1pTywH01lZHwLGhyFJXYqD2MWeYmSMxUCZYnCDDBIwcq wZwW2FZVlKf/Pz4Sfqd87e2VCpaRtyp5kaElHkQJOVKqNF3mIqeU/C7iMlEV0STiHw i1oHoUG3oI3m19p0JFAaXMgHt12Uby6Orm4sSZM8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A1D11F804E4; Mon, 16 Aug 2021 06:56:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60615F804E3; Mon, 16 Aug 2021 06:56:04 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 51B68F80259 for ; Mon, 16 Aug 2021 06:55:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 51B68F80259 Date: 16 Aug 2021 13:55:56 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90751743" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Aug 2021 13:55:56 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 910164001948; Mon, 16 Aug 2021 13:55:56 +0900 (JST) Message-ID: <87zgtiyomb.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/9] ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:310:6: style: The scope of the variable 'ret' can be reduced. [variableScope] int ret; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-generic-dmaengine-pcm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 24b240783cf1..4aa48c74f21a 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -305,14 +305,13 @@ static int dmaengine_copy_user(struct snd_soc_component *component, bool is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; void *dma_ptr = runtime->dma_area + hwoff + channel * (runtime->dma_bytes / runtime->channels); - int ret; if (is_playback) if (copy_from_user(dma_ptr, buf, bytes)) return -EFAULT; if (process) { - ret = process(substream, channel, hwoff, (__force void *)buf, bytes); + int ret = process(substream, channel, hwoff, (__force void *)buf, bytes); if (ret < 0) return ret; } From patchwork Mon Aug 16 04:56:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C3C4C4338F for ; Mon, 16 Aug 2021 05:54:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EB68F617E3 for ; Mon, 16 Aug 2021 05:54:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EB68F617E3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 91C5674C; Mon, 16 Aug 2021 07:53:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 91C5674C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629093282; bh=wdzfLyo8a/18dOZx9nnJ7uFouvOcwJD28rY/kgDgmRU=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XxiwgEHq6bKcljYP3C0+2cvsude/obe7G4uIuyQ3AwqUn68eK/HcLrdxibYVTYw1O AeUtxhwLBdpzP3M+Xr+z/jzwuf27yw0Asnh2IdDpFsK/ue0wsM8tP+73gbksIg0nsh YT3b049s+rGltpa0890cPXOLtQwSvJS6lk+d6QuA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42F29F804FA; Mon, 16 Aug 2021 06:56:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 40A69F804EB; Mon, 16 Aug 2021 06:56:09 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 45B2BF80134 for ; Mon, 16 Aug 2021 06:56:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 45B2BF80134 Date: 16 Aug 2021 13:56:01 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90751748" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 16 Aug 2021 13:56:01 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 82A2F40041AC; Mon, 16 Aug 2021 13:56:01 +0900 (JST) Message-ID: <87y292yom6.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 4/9] ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-dai.c:454:7: style: The scope of the variable 'supported_cpu' can be reduced. [variableScope] bool supported_cpu; ^ sound/soc/soc-dai.c:455:7: style: The scope of the variable 'supported_codec' can be reduced. [variableScope] bool supported_codec; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-dai.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index a56dcc8d6fb7..a4e1c27a4ed2 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -492,18 +492,16 @@ bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir) */ void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link) { - struct snd_soc_dai_link_component *cpu; - struct snd_soc_dai_link_component *codec; - struct snd_soc_dai *dai; bool supported[SNDRV_PCM_STREAM_LAST + 1]; - bool supported_cpu; - bool supported_codec; int direction; - int i; for_each_pcm_streams(direction) { - supported_cpu = false; - supported_codec = false; + struct snd_soc_dai_link_component *cpu; + struct snd_soc_dai_link_component *codec; + struct snd_soc_dai *dai; + bool supported_cpu = false; + bool supported_codec = false; + int i; for_each_link_cpus(dai_link, i, cpu) { dai = snd_soc_find_dai_with_mutex(cpu); From patchwork Mon Aug 16 04:56:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437741 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E49F2C4338F for ; Mon, 16 Aug 2021 05:10:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4BA93615E2 for ; Mon, 16 Aug 2021 05:10:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4BA93615E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 91E891712; Mon, 16 Aug 2021 06:58:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 91E891712 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629089966; bh=hyrEaLuWOUJWQ98kn31b8n+jcB6+Mou3uma5nE0bAYQ=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BbU8FU9Rr5U3H/q/HdAxkxpwrXIAq10mAZyav/B2Tzr4gRcb0JMSZZa/XyrLJRJet H5vMyOgR2ahdjvz1L9U7qK88D78MEi2QxdhApCZU4nbDmTHuKZGiRFlQNPji6vQIOo uNnrYECIp9s1FL5xbvRidhntdwXsfV/EK9RyUbww= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 731B7F80508; Mon, 16 Aug 2021 06:56:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 84802F804FF; Mon, 16 Aug 2021 06:56:19 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 5EB76F804E5 for ; Mon, 16 Aug 2021 06:56:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5EB76F804E5 Date: 16 Aug 2021 13:56:06 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90740492" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 16 Aug 2021 13:56:06 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 158384001948; Mon, 16 Aug 2021 13:56:06 +0900 (JST) Message-ID: <87wnomyom1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 5/9] ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-dai.c:553:13: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int i, ret = 0; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-dai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index a4e1c27a4ed2..3db0fcf24385 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -595,11 +595,11 @@ int snd_soc_pcm_dai_remove(struct snd_soc_pcm_runtime *rtd, int order) int snd_soc_pcm_dai_new(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_dai *dai; - int i, ret = 0; + int i; for_each_rtd_dais(rtd, i, dai) { if (dai->driver->pcm_new) { - ret = dai->driver->pcm_new(rtd, dai); + int ret = dai->driver->pcm_new(rtd, dai); if (ret < 0) return soc_dai_ret(dai, ret); } From patchwork Mon Aug 16 04:56:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00ED7C432BE for ; Mon, 16 Aug 2021 05:54:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5E0F3619F6 for ; Mon, 16 Aug 2021 05:54:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5E0F3619F6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0A0D316A3; Mon, 16 Aug 2021 07:53:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0A0D316A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629093251; bh=Bgo2d07SdWbKLR4HiUVkIPOJfdikpO7o6q+kWWJfxMk=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PSnuX7L/F9WP1oev33RliU5UreVaCRwh06CVeeiCu+UBfCfGfBP0uEWCFFy+YoBpK 5K8738EfjTqtTSI2iYExJsURYwH0KdBUEIE9syFS+AocqYmoosmi16dyu3V275GMe+ qI1W2JTdwhQqwRcsCB4+yE8N14Tca/n1kV1ibRUw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 755DCF804E5; Mon, 16 Aug 2021 06:56:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 65333F80506; Mon, 16 Aug 2021 06:56:19 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 8A715F804FC for ; Mon, 16 Aug 2021 06:56:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8A715F804FC Date: 16 Aug 2021 13:56:10 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90751764" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 16 Aug 2021 13:56:10 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 8F13541B5C0B; Mon, 16 Aug 2021 13:56:10 +0900 (JST) Message-ID: <87v946yolx.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 6/9] ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-jack.c:45:6: style: The scope of the variable 'enable' can be reduced. [variableScope] int enable; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-jack.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 0f1820f36b4d..11961e35ad02 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -42,7 +42,6 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask) struct snd_soc_dapm_context *dapm; struct snd_soc_jack_pin *pin; unsigned int sync = 0; - int enable; if (!jack) return; @@ -58,7 +57,7 @@ void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask) trace_snd_soc_jack_notify(jack, status); list_for_each_entry(pin, &jack->pins, list) { - enable = pin->mask & jack->status; + int enable = pin->mask & jack->status; if (pin->invert) enable = !enable; From patchwork Mon Aug 16 04:56:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E8F2C4338F for ; Mon, 16 Aug 2021 05:35:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7E61B619EA for ; Mon, 16 Aug 2021 05:35:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7E61B619EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E00CD1733; Mon, 16 Aug 2021 07:09:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E00CD1733 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629090599; bh=XCAA0+TFl29DV3XXBzOU2SxiMN7yMe9vLyBZR2Z1CGY=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GcwJr4jkrsTLk0kg99XZAdwSYnTMYuH/FOIoEJTknAYRz7/a+3LfTHSucLsCz2Kol 2B8ldyK6m/hrFa9lFGWS1x0thcUi+gf3BlXTnyidj4W7+vVBH/1yTjy5ym7ivpReat tDTnY+fdKV3E9uG5d0IcW/MmcAiRQnZ2k7kmXqaQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6EE17F80507; Mon, 16 Aug 2021 06:56:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 26F57F80516; Mon, 16 Aug 2021 06:56:26 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 867D7F804FD for ; Mon, 16 Aug 2021 06:56:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 867D7F804FD Date: 16 Aug 2021 13:56:15 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90751769" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 16 Aug 2021 13:56:15 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 15B3041B5990; Mon, 16 Aug 2021 13:56:15 +0900 (JST) Message-ID: <87tujqyols.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 7/9] ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-jack.c:21:6: style: struct member 'jack_gpio_tbl::count' is never used. [unusedStructMember] int count; ^ sound/soc/soc-jack.c:23:28: style: struct member 'jack_gpio_tbl::gpios' is never used. [unusedStructMember] struct snd_soc_jack_gpio *gpios; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-jack.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 11961e35ad02..d798765d168c 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -17,12 +17,6 @@ #include #include -struct jack_gpio_tbl { - int count; - struct snd_soc_jack *jack; - struct snd_soc_jack_gpio *gpios; -}; - /** * snd_soc_jack_report - Report the current status for a jack * @@ -207,6 +201,12 @@ void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack, EXPORT_SYMBOL_GPL(snd_soc_jack_notifier_unregister); #ifdef CONFIG_GPIOLIB +struct jack_gpio_tbl { + int count; + struct snd_soc_jack *jack; + struct snd_soc_jack_gpio *gpios; +}; + /* gpio detect */ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio) { From patchwork Mon Aug 16 04:56:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00EA8C4338F for ; Mon, 16 Aug 2021 05:54:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5EB84600CC for ; Mon, 16 Aug 2021 05:54:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5EB84600CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0F03916A5; Mon, 16 Aug 2021 07:53:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0F03916A5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629093251; bh=Ih38F/duR40nrm14B8UlMbSvOfXv6e++HJDGYIfZPio=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=J2nPXEkgI9hv4QW5wDvhbBDyjE23YsVp4xyVsMZfgC6kjBnRECyaywXwEMGkitaN5 V5ZuE7bqpmObpDwCAkbJurEgxGFJ+qXNRFGtv47qhXM8opxLoh7jiqw0GrkAkJYT9K DlQV2kV148fCYFB5PxwCEcu9yBLVaG2T9k3aR/Sk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46064F80516; Mon, 16 Aug 2021 06:56:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0A5C7F80515; Mon, 16 Aug 2021 06:56:28 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id E0AB0F80246 for ; Mon, 16 Aug 2021 06:56:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E0AB0F80246 Date: 16 Aug 2021 13:56:19 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90751776" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 16 Aug 2021 13:56:19 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6CA8841B5BE7; Mon, 16 Aug 2021 13:56:19 +0900 (JST) Message-ID: <87sfzayolo.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 8/9] ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-component.c:1183:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-component.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index c8dfd0de30e4..8e8d917d22f8 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -1171,10 +1171,10 @@ int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd, void *stream) { struct snd_soc_component *component; - int i, ret; + int i; for_each_rtd_components(rtd, i, component) { - ret = pm_runtime_get_sync(component->dev); + int ret = pm_runtime_get_sync(component->dev); if (ret < 0 && ret != -EACCES) { pm_runtime_put_noidle(component->dev); return soc_component_ret(component, ret); From patchwork Mon Aug 16 04:56:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12437737 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6262CC4338F for ; Mon, 16 Aug 2021 05:01:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7E5C860FD8 for ; Mon, 16 Aug 2021 05:01:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7E5C860FD8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E3D211736; Mon, 16 Aug 2021 06:59:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E3D211736 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1629090028; bh=apEs6HibL5RXzFybGOqF/ACZHVaDDA0E530dXp1wFPY=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=jGdDEWLE0Ea0vl7TVo9XI4vZ0yEtrxdj9MAGNh81EDywpGVmK4u+JJt0Lx+6C5MI3 4tZQ4kVOP7Bp+ZIzHksEFXX/ND4S5SoBsRDuhQEAq1ycQ+LUo/ZdHRyzKN1k7ffHqe Q5D24Q2AuS0C6lszCKr7TXvIEy42MATm7mSLFvKc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 684B2F8051B; Mon, 16 Aug 2021 06:56:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D32EAF8051C; Mon, 16 Aug 2021 06:56:32 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 573DDF80511 for ; Mon, 16 Aug 2021 06:56:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 573DDF80511 Date: 16 Aug 2021 13:56:23 +0900 X-IronPort-AV: E=Sophos;i="5.84,324,1620658800"; d="scan'208";a="90751784" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 16 Aug 2021 13:56:23 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id D902241B5BE7; Mon, 16 Aug 2021 13:56:23 +0900 (JST) Message-ID: <87r1euyolk.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 9/9] ASoC: soc-ac97: cleanup cppcheck warning User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> References: <874kbq0z0p.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto This patch cleanups below cppcheck warning. sound/soc/soc-ac97.c:41:15: style: struct member 'snd_ac97_gpio_priv::gpios_set' is never used. [unusedStructMember] unsigned int gpios_set; ^ sound/soc/soc-ac97.c:42:28: style: struct member 'snd_ac97_gpio_priv::component' is never used. [unusedStructMember] struct snd_soc_component *component; ^ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-ac97.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sound/soc/soc-ac97.c b/sound/soc/soc-ac97.c index 65db083e242b..5f49e3dec3fc 100644 --- a/sound/soc/soc-ac97.c +++ b/sound/soc/soc-ac97.c @@ -34,14 +34,6 @@ struct snd_ac97_reset_cfg { int gpio_reset; }; -struct snd_ac97_gpio_priv { -#ifdef CONFIG_GPIOLIB - struct gpio_chip gpio_chip; -#endif - unsigned int gpios_set; - struct snd_soc_component *component; -}; - static struct snd_ac97_bus soc_ac97_bus = { .ops = NULL, /* Gets initialized in snd_soc_set_ac97_ops() */ }; @@ -52,6 +44,12 @@ static void soc_ac97_device_release(struct device *dev) } #ifdef CONFIG_GPIOLIB +struct snd_ac97_gpio_priv { + struct gpio_chip gpio_chip; + unsigned int gpios_set; + struct snd_soc_component *component; +}; + static inline struct snd_soc_component *gpio_to_component(struct gpio_chip *chip) { struct snd_ac97_gpio_priv *gpio_priv = gpiochip_get_data(chip);