From patchwork Mon Oct 25 18:59:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12582605 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5F33C433EF for ; Mon, 25 Oct 2021 19:01:45 +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 E776B60230 for ; Mon, 25 Oct 2021 19:01:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E776B60230 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 0EC4116CC; Mon, 25 Oct 2021 21:00:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0EC4116CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635188503; bh=iM++/G1nA5T7CWvz2D7LNb99QaD+h+iZL3HtLpRXEiw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Owu1484wwFDNzPdWgRHXpYL6LcS7GBNVbieHQWSBjWnH8Lusca+4OsIS+0bSjVotn 9j3hMtWJdkpxOM8+prvO7pQA2RSzmdD4E9zhSasKYcWkvTxkpHHK5PR+qYCcWdVGZ8 32yfmZ1tpylZYOV+CcvpO3t31KD+avGCg//J7lnc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 241CFF80153; Mon, 25 Oct 2021 21:00:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BD3A1F804E6; Mon, 25 Oct 2021 21:00:10 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3E4BDF8025A for ; Mon, 25 Oct 2021 21:00:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3E4BDF8025A X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216908144" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="216908144" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:54 -0700 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="554318453" Received: from ssubbar1-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.118.197]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:53 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 1/8] ASoC: topology: handle endianness warning Date: Mon, 25 Oct 2021 13:59:26 -0500 Message-Id: <20211025185933.144327-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> References: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart 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" Sparse reports the following warning: sound/soc/soc-topology.c:1488:26: error: restricted __le32 degrades to integer Signed-off-by: Pierre-Louis Bossart --- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 88f849b119da..7a4559ddf903 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1485,7 +1485,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, if (!kcontrol_type) goto err; - for (i = 0; i < w->num_kcontrols; i++) { + for (i = 0; i < le32_to_cpu(w->num_kcontrols); i++) { control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos; switch (le32_to_cpu(control_hdr->ops.info)) { case SND_SOC_TPLG_CTL_VOLSW: From patchwork Mon Oct 25 18:59:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12582607 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BD79C433EF for ; Mon, 25 Oct 2021 19:01:53 +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 C74C760FE8 for ; Mon, 25 Oct 2021 19:01:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C74C760FE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 C8F6316D8; Mon, 25 Oct 2021 21:01:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C8F6316D8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635188510; bh=IOmXWbPhhviwwagnxkw8CrRT8OyOmSWF1iELZAjZMx4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=idfrh3oSdOtUxspXITkIC7me0WLsZ3qu53mFEzZw3XmgNy6k7dzk1Clgi+ZK0SR4H 17renSoy59KL88y1a5X1a+nNsqTxWEkkP4/8XwqeQA5yHmK6ZTEvSpePYOkW3DFgy6 8ne3X8hdbX99wi1lXSJiIzQzEXWiHEIKOnEhr5h4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B6487F804E3; Mon, 25 Oct 2021 21:00:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 26D83F80271; Mon, 25 Oct 2021 21:00:11 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8E65CF80153 for ; Mon, 25 Oct 2021 21:00:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8E65CF80153 X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216908154" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="216908154" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:55 -0700 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="554318460" Received: from ssubbar1-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.118.197]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:54 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 2/8] ASoC: rt5682s: use 'static' qualifier Date: Mon, 25 Oct 2021 13:59:27 -0500 Message-Id: <20211025185933.144327-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> References: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart 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" Sparse reports the following warnings: sound/soc/codecs/rt5682s.c:44:12: error: symbol 'rt5682s_supply_names' was not declared. Should it be static? sound/soc/codecs/rt5682s.c:74:26: error: symbol 'rt5682s_reg' was not declared. Should it be static? sound/soc/codecs/rt5682s.c:2841:30: error: symbol 'rt5682s_aif1_dai_ops' was not declared. Should it be static? Signed-off-by: Pierre-Louis Bossart --- sound/soc/codecs/rt5682s.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c index f6435b233a51..470957fcad6b 100644 --- a/sound/soc/codecs/rt5682s.c +++ b/sound/soc/codecs/rt5682s.c @@ -41,7 +41,7 @@ static const struct rt5682s_platform_data i2s_default_platform_data = { .dai_clk_names[RT5682S_DAI_BCLK_IDX] = "rt5682-dai-bclk", }; -const char *rt5682s_supply_names[RT5682S_NUM_SUPPLIES] = { +static const char *rt5682s_supply_names[RT5682S_NUM_SUPPLIES] = { "AVDD", "MICVDD", }; @@ -71,7 +71,7 @@ static void rt5682s_apply_patch_list(struct rt5682s_priv *rt5682s, dev_warn(dev, "Failed to apply regmap patch: %d\n", ret); } -const struct reg_default rt5682s_reg[] = { +static const struct reg_default rt5682s_reg[] = { {0x0002, 0x8080}, {0x0003, 0x0001}, {0x0005, 0x0000}, @@ -2838,7 +2838,7 @@ static int rt5682s_resume(struct snd_soc_component *component) #define rt5682s_resume NULL #endif -const struct snd_soc_dai_ops rt5682s_aif1_dai_ops = { +static const struct snd_soc_dai_ops rt5682s_aif1_dai_ops = { .hw_params = rt5682s_hw_params, .set_fmt = rt5682s_set_dai_fmt, .set_tdm_slot = rt5682s_set_tdm_slot, From patchwork Mon Oct 25 18:59:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12582623 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2595C433EF for ; Mon, 25 Oct 2021 19:03:53 +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 513F960E74 for ; Mon, 25 Oct 2021 19:03:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 513F960E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 AAF7216D9; Mon, 25 Oct 2021 21:03:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AAF7216D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635188631; bh=Vl7md2wy+tZFAWLivDTZpnUuFA5m5I2ZJUYjjE2IPeU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ATquYhYK+HzpSVC+1ktNB/NbH4AfWXF2bv5wKWM3s/MXFv1md7l2FC2mt6K+x6mF+ lPSKIL7PPrHZgYE73/zCUOqjM4QaaqARmvTkX3jnHdi0jOBl9efM2gWWallnZfCSjv LwfbUo3Miqk91W93DPWGeoCfUoyWsKyP69j4gb3w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4CB3BF80516; Mon, 25 Oct 2021 21:00:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8C89DF804E7; Mon, 25 Oct 2021 21:00:19 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E2AD2F8032B for ; Mon, 25 Oct 2021 21:00:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E2AD2F8032B X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216908162" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="216908162" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:56 -0700 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="554318467" Received: from ssubbar1-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.118.197]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:55 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 3/8] ASoC: nau8821: fix kernel-doc Date: Mon, 25 Oct 2021 13:59:28 -0500 Message-Id: <20211025185933.144327-4-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> References: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart 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" make W=1 reports warnings: sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member 'component' not described in 'nau8821_set_fll' sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member 'pll_id' not described in 'nau8821_set_fll' sound/soc/codecs/nau8821.c:1192: warning: Function parameter or member 'source' not described in 'nau8821_set_fll' sound/soc/codecs/nau8821.c:1192: warning: Excess function parameter 'codec' description in 'nau8821_set_fll' Signed-off-by: Pierre-Louis Bossart --- sound/soc/codecs/nau8821.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c index 4ea56d2f9509..2757d2eeb48a 100644 --- a/sound/soc/codecs/nau8821.c +++ b/sound/soc/codecs/nau8821.c @@ -1178,7 +1178,9 @@ static void nau8821_fll_apply(struct nau8821 *nau8821, /** * nau8821_set_fll - FLL configuration of nau8821 - * @codec: codec component + * @component: codec component + * @pll_id: PLL requested + * @source: clock source * @freq_in: frequency of input clock source * @freq_out: must be 256*Fs in order to achieve the best performance * From patchwork Mon Oct 25 18:59:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12582609 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1FA5C433F5 for ; Mon, 25 Oct 2021 19:02:18 +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 7062D60E74 for ; Mon, 25 Oct 2021 19:02:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7062D60E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 BA47016DE; Mon, 25 Oct 2021 21:01:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BA47016DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635188536; bh=1wUQa6yPx3N2emGJCCE31CDaSszxxWCAFE44iD76Esw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vO1H7YaEusbvOKQ+MRn2cdvAxdleTB/xJTvJZ4cFU3W+rT2xjvoInhOSxARY7Lq+W 5IeTi+Z4v2bIrhTcJEAO36RoRd7hi0xxtNtoT27x6MT5l2WFR4BbnL+T9XZR721huk LQkHrcH/WZtgiStbnfbPMtdz1qNasOccVbLZOMf0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6B335F804E6; Mon, 25 Oct 2021 21:00:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C271AF804E5; Mon, 25 Oct 2021 21:00:13 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2DC80F80166 for ; Mon, 25 Oct 2021 21:00:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2DC80F80166 X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216908166" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="216908166" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:56 -0700 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="554318473" Received: from ssubbar1-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.118.197]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:56 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 4/8] ASoC: nau8821: clarify out-of-bounds check Date: Mon, 25 Oct 2021 13:59:29 -0500 Message-Id: <20211025185933.144327-5-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> References: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart 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" cppcheck reports a false positive sound/soc/codecs/nau8821.c:390:17: error: Array 'dmic_speed_sel[4]' accessed at index 4, which is out of bounds. [arrayIndexOutOfBounds] dmic_speed_sel[i].param, dmic_speed_sel[i].val); ^ sound/soc/codecs/nau8821.c:378:2: note: After for loop, i has value 4 for (i = 0 ; i < 4 ; i++) ^ sound/soc/codecs/nau8821.c:390:17: note: Array index out of bounds dmic_speed_sel[i].param, dmic_speed_sel[i].val); ^ While the code is not incorrect, we can deal with the out-of-bounds check in a clearer way that makes static analysis happy. Signed-off-by: Pierre-Louis Bossart --- sound/soc/codecs/nau8821.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c index 2757d2eeb48a..2de818377484 100644 --- a/sound/soc/codecs/nau8821.c +++ b/sound/soc/codecs/nau8821.c @@ -381,7 +381,7 @@ static int dmic_clock_control(struct snd_soc_dapm_widget *w, speed_selection = dmic_speed_sel[i].val; break; } - if (speed_selection < 0) + if (i == 4) return -EINVAL; dev_dbg(nau8821->dev, From patchwork Mon Oct 25 18:59:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12582615 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 742B4C433F5 for ; Mon, 25 Oct 2021 19:03:12 +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 EFEA960FE8 for ; Mon, 25 Oct 2021 19:03:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EFEA960FE8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 62E7616DB; Mon, 25 Oct 2021 21:02:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 62E7616DB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635188590; bh=afh7080lzXjZQrNRGWHoAs+cqaJxrsGd8uFBOXKXULQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UWZN2cIapfdpWSEvMPh5gpqkBjTI/OnGLgHWLmf8v6yuE6PRoEcHRKt7hl4U+gH6y nNQ6e5kZq1YN63rtunv5DGbfRBj1comCESIXclvlTT2jqOF3JJ1AcZEiDvx+dAbSdb zLINOpgCH/DGjYEC1K2vRxiRbdHXm3CgVYATC8Gs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8B8DFF804FC; Mon, 25 Oct 2021 21:00:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 13FF2F804E7; Mon, 25 Oct 2021 21:00:18 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 47197F8025E for ; Mon, 25 Oct 2021 21:00:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 47197F8025E X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216908169" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="216908169" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:57 -0700 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="554318479" Received: from ssubbar1-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.118.197]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:56 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 5/8] ASoC: mediatek: remove unnecessary initialization Date: Mon, 25 Oct 2021 13:59:30 -0500 Message-Id: <20211025185933.144327-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> References: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart 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" Cppcheck warning: sound/soc/mediatek/common/mtk-afe-fe-dai.c:353:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] int i = 0; ^ Signed-off-by: Pierre-Louis Bossart --- sound/soc/mediatek/common/mtk-afe-fe-dai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/mediatek/common/mtk-afe-fe-dai.c b/sound/soc/mediatek/common/mtk-afe-fe-dai.c index 4f2c2379531b..395be97f13ae 100644 --- a/sound/soc/mediatek/common/mtk-afe-fe-dai.c +++ b/sound/soc/mediatek/common/mtk-afe-fe-dai.c @@ -350,7 +350,7 @@ int mtk_afe_resume(struct snd_soc_component *component) struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); struct device *dev = afe->dev; struct regmap *regmap = afe->regmap; - int i = 0; + int i; if (pm_runtime_status_suspended(dev) || !afe->suspended) return 0; From patchwork Mon Oct 25 18:59:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12582621 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FC7EC433EF for ; Mon, 25 Oct 2021 19:03:34 +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 E1B8E6101C for ; Mon, 25 Oct 2021 19:03:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E1B8E6101C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 2A51116C7; Mon, 25 Oct 2021 21:02:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2A51116C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635188612; bh=b9+6wLK7bxQGnPiCRhk86UZ1yzShDGUPdgD888WlJTg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OgUOf9gtd29EkrMU14tVxb+8FHnY0PA4l9h0Azdtkx7fivXBv4U86OraVYwdH6bl8 LDRYxm0U3d5R6ZQvzJhEgBHgI6ts7Dm1C2XSEHok7fTHU28CVKvYid/T1TH5Q5t27n imvJrwvFt6lH5eV9V4htqFFTmgONW24K4F0Htd60= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3BD4AF8050F; Mon, 25 Oct 2021 21:00:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6FF35F804EC; Mon, 25 Oct 2021 21:00:18 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6188FF804AF for ; Mon, 25 Oct 2021 21:00:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6188FF804AF X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216908176" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="216908176" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:57 -0700 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="554318484" Received: from ssubbar1-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.118.197]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:57 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 6/8] ASoC: mediatek: mt8195: rename shadowed array Date: Mon, 25 Oct 2021 13:59:31 -0500 Message-Id: <20211025185933.144327-7-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> References: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart 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" cppcheck warning: Checking sound/soc/mediatek/mt8195/mt8195-afe-pcm.c ... sound/soc/mediatek/mt8195/mt8195-afe-pcm.c:2884:35: style: Local variable 'irq_data' shadows outer variable [shadowVariable] struct mtk_base_irq_data const *irq_data; ^ sound/soc/mediatek/mt8195/mt8195-afe-pcm.c:2235:39: note: Shadowed declaration static const struct mtk_base_irq_data irq_data[MT8195_AFE_IRQ_NUM] = { ^ sound/soc/mediatek/mt8195/mt8195-afe-pcm.c:2884:35: note: Shadow variable struct mtk_base_irq_data const *irq_data; ^ Signed-off-by: Pierre-Louis Bossart --- sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c index df8b90baf981..2bb05a828e8d 100644 --- a/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c +++ b/sound/soc/mediatek/mt8195/mt8195-afe-pcm.c @@ -2232,7 +2232,7 @@ static const struct mtk_base_memif_data memif_data[MT8195_AFE_MEMIF_NUM] = { }, }; -static const struct mtk_base_irq_data irq_data[MT8195_AFE_IRQ_NUM] = { +static const struct mtk_base_irq_data irq_data_array[MT8195_AFE_IRQ_NUM] = { [MT8195_AFE_IRQ_1] = { .id = MT8195_AFE_IRQ_1, .irq_cnt_reg = -1, @@ -3100,7 +3100,7 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev) return -ENOMEM; for (i = 0; i < afe->irqs_size; i++) - afe->irqs[i].irq_data = &irq_data[i]; + afe->irqs[i].irq_data = &irq_data_array[i]; /* init memif */ afe->memif_size = MT8195_AFE_MEMIF_NUM; From patchwork Mon Oct 25 18:59:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12582613 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C689C433FE for ; Mon, 25 Oct 2021 19:02:54 +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 BB80760E74 for ; Mon, 25 Oct 2021 19:02:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BB80760E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 265B016CF; Mon, 25 Oct 2021 21:02:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 265B016CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635188572; bh=WqgNvtnjSl5F53LkjNXI29zBMI16zVCJJwsOKs2CJHI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=j/R35UEbOsrOf+DmcIsKL1lA4DAlzQ08K5Hnvw0RQ27oKHsYyO+Psk1E43G8DaQMY 45/F5gaLYPYp+kxRl6rMZ8HxzI+0zxXJ8PQIEEAdLT5oC81wiRMcr7MJVZcR2JSA7J UVQzXwcPGbI1ytPWm0AyyDtd7Eomk6VSNPTn76qw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CC0F4F804FB; Mon, 25 Oct 2021 21:00:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4283BF80431; Mon, 25 Oct 2021 21:00:17 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3A0CEF80431 for ; Mon, 25 Oct 2021 21:00:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3A0CEF80431 X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216908178" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="216908178" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:58 -0700 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="554318488" Received: from ssubbar1-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.118.197]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:57 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 7/8] ASoC: mediatek: mt8195: fix return value Date: Mon, 25 Oct 2021 13:59:32 -0500 Message-Id: <20211025185933.144327-8-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> References: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart 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" cppcheck reports the following warning: sound/soc/mediatek/mt8195/mt8195-dai-etdm.c:1299:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ The suggested change aligns the implementation of mt8195_afe_disable_etdm() with mt8195_afe_enable_etdm() - same negative return value upon error. Signed-off-by: Pierre-Louis Bossart --- sound/soc/mediatek/mt8195/mt8195-dai-etdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c b/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c index ac591d453e1e..c02c10da3600 100644 --- a/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c +++ b/sound/soc/mediatek/mt8195/mt8195-dai-etdm.c @@ -1316,7 +1316,7 @@ static int mt8195_afe_disable_etdm(struct mtk_base_afe *afe, int dai_id) } out: spin_unlock_irqrestore(&afe_priv->afe_ctrl_lock, flags); - return 0; + return ret; } static int etdm_cowork_slv_sel(int id, int slave_mode) From patchwork Mon Oct 25 18:59:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12582611 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A698C433EF for ; Mon, 25 Oct 2021 19:02: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 F066160E74 for ; Mon, 25 Oct 2021 19:02:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F066160E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 5A9EA16D5; Mon, 25 Oct 2021 21:01:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5A9EA16D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1635188561; bh=1nU6F8H/o+rYHhw87QiHffOGV6FZGa25y2YQgunkhLI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pXoiCFGxbNtZycE4ZYZHTrFRHnTr4G/0k3q4G8IBNfS77Vm7yuOtP+ZyY1BxwHctI lkcca2F+h4Ghx7YyC6Hf/DVA5MD/Qvw491nwPcA9hYC5jV8y2tTDsQXIWlYLKtjZnF SKVYW9M5PBp3FxipbVZELu0dmWnoj+PnNUcEq3Fc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2C96AF804EC; Mon, 25 Oct 2021 21:00:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2E34AF804E7; Mon, 25 Oct 2021 21:00:17 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3913AF804E3 for ; Mon, 25 Oct 2021 21:00:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3913AF804E3 X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="216908186" X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="216908186" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:58 -0700 X-IronPort-AV: E=Sophos;i="5.87,181,1631602800"; d="scan'208";a="554318490" Received: from ssubbar1-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.118.197]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 11:59:58 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 8/8] ASoC: rockchip: i2s_tdm: improve return value handling Date: Mon, 25 Oct 2021 13:59:33 -0500 Message-Id: <20211025185933.144327-9-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> References: <20211025185933.144327-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart 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" cppcheck reports the following warning: sound/soc/rockchip/rockchip_i2s_tdm.c:599:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/rockchip/rockchip_i2s_tdm.c:594:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/rockchip/rockchip_i2s_tdm.c:599:9: note: Returning identical expression 'ret' return ret; ^ While the code is not wrong, it's clearer to return 0 directly. Signed-off-by: Pierre-Louis Bossart --- sound/soc/rockchip/rockchip_i2s_tdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index e8dee1f95d85..17b9b287853a 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -596,7 +596,7 @@ static int rockchip_i2s_tdm_clk_set_rate(struct rk_i2s_tdm_dev *i2s_tdm, i2s_tdm->clk_ppm = ppm; - return ret; + return 0; } static int rockchip_i2s_tdm_calibrate_mclk(struct rk_i2s_tdm_dev *i2s_tdm,