From patchwork Mon Feb 18 14:50:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yue Haibing X-Patchwork-Id: 10818237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1033D6C2 for ; Mon, 18 Feb 2019 14:37:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF0AC29F2C for ; Mon, 18 Feb 2019 14:36:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2A9F29F86; Mon, 18 Feb 2019 14:36:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B0E29F2C for ; Mon, 18 Feb 2019 14:36:58 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BB587265525; Mon, 18 Feb 2019 15:36:56 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1C9D0265527; Mon, 18 Feb 2019 15:36:54 +0100 (CET) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by alsa0.perex.cz (Postfix) with ESMTP id 05721265523 for ; Mon, 18 Feb 2019 15:36:50 +0100 (CET) Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id EBB41BB4D30A6FB9883D; Mon, 18 Feb 2019 22:36:47 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.408.0; Mon, 18 Feb 2019 22:36:39 +0800 From: YueHaibing To: Olivier Moysan , Arnaud Pouliquen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Maxime Coquelin Date: Mon, 18 Feb 2019 14:50:26 +0000 Message-ID: <20190218145026.142805-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218134836.107220-1-yuehaibing@huawei.com> References: <20190218134836.107220-1-yuehaibing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Cc: alsa-devel@alsa-project.org, YueHaibing , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH v2 -next] ASoC: stm32: sai: remove set but not used variables 'mask, cr1' X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes gcc '-Wunused-but-set-variable' warning: sound/soc/stm/stm32_sai_sub.c: In function 'stm32_sai_configure_clock': sound/soc/stm/stm32_sai_sub.c:902:11: warning: variable 'mask' set but not used [-Wunused-but-set-variable] sound/soc/stm/stm32_sai_sub.c:902:6: warning: variable 'cr1' set but not used [-Wunused-but-set-variable] It's not used any more after 8307b2afd386 ("ASoC: stm32: sai: set sai as mclk clock provider") Signed-off-by: YueHaibing --- v2: remove unnessesary if branch. --- sound/soc/stm/stm32_sai_sub.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index d4825700b63f..f9297228c41c 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -898,7 +898,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai, struct snd_pcm_hw_params *params) { struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai); - int cr1, mask, div = 0; + int div = 0; int sai_clk_rate, mclk_ratio, den; unsigned int rate = params_rate(params); @@ -943,10 +943,8 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai, } else { if (sai->mclk_rate) { mclk_ratio = sai->mclk_rate / rate; - if (mclk_ratio == 512) { - mask = SAI_XCR1_OSR; - cr1 = SAI_XCR1_OSR; - } else if (mclk_ratio != 256) { + if ((mclk_ratio != 512) && + (mclk_ratio != 256)) { dev_err(cpu_dai->dev, "Wrong mclk ratio %d\n", mclk_ratio);