From patchwork Tue Sep 27 14:09:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shang XiaoJing X-Patchwork-Id: 12993533 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 76A12C04A95 for ; Thu, 29 Sep 2022 06:07:57 +0000 (UTC) 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 95304850; Thu, 29 Sep 2022 08:07:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 95304850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664431675; bh=hUDEj4ebDrV/SLvoEKu7aHR2jl4lFtNZo7LrS+4Dk0U=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CykTpm4II5SbbJmDDjLA4zPr4/mFfPODXGpexXC9Q1ojlgH+28iCE11UXKhx2KZzj BVq/TuPV6cQlZwgLEtVRDIvNNSIWn0JASovB36KVjDIK5mh2w7Fo2LK9Wl7ITHcuI1 RSuXm/sb5kMSWjFvGKF1buEDCIYEdCKhsoU2QVQU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7AD68F804CA; Thu, 29 Sep 2022 08:06:40 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6240FF804D9; Tue, 27 Sep 2022 15:35:51 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CF3E3F8024C for ; Tue, 27 Sep 2022 15:35:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CF3E3F8024C Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4McLDQ3Nt7zHprT; Tue, 27 Sep 2022 21:33:26 +0800 (CST) Received: from kwepemm600008.china.huawei.com (7.193.23.88) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 21:35:42 +0800 Received: from huawei.com (10.175.100.227) by kwepemm600008.china.huawei.com (7.193.23.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 21:35:41 +0800 From: Shang XiaoJing To: , , , , , , , , , , , Subject: [PATCH -next 1/4] ASoC: cs35l36: Use DIV_ROUND_UP() instead of open-coding it Date: Tue, 27 Sep 2022 22:09:45 +0800 Message-ID: <20220927140948.17696-2-shangxiaojing@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220927140948.17696-1-shangxiaojing@huawei.com> References: <20220927140948.17696-1-shangxiaojing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600008.china.huawei.com (7.193.23.88) X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 29 Sep 2022 08:06:37 +0200 Cc: shangxiaojing@huawei.com 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" Use DIV_ROUND_UP() instead of open-coding it, which intents and makes it more clear what is going on for the casual reviewer. The Coccinelle references Commit e4d8aef21403 ("ALSA: usb: Use DIV_ROUND_UP() instead of open-coding it"). Signed-off-by: Shang XiaoJing Acked-by: Charles Keepax --- sound/soc/codecs/cs35l36.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c index 31ae752e242f..a078dd422ea1 100644 --- a/sound/soc/codecs/cs35l36.c +++ b/sound/soc/codecs/cs35l36.c @@ -918,8 +918,8 @@ static int cs35l36_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, fs1 = CS35L36_FS1_DEFAULT_VAL; fs2 = CS35L36_FS2_DEFAULT_VAL; } else { - fs1 = 3 * ((CS35L36_FS_NOM_6MHZ * 4 + freq - 1) / freq) + 4; - fs2 = 5 * ((CS35L36_FS_NOM_6MHZ * 4 + freq - 1) / freq) + 4; + fs1 = 3 * DIV_ROUND_UP(CS35L36_FS_NOM_6MHZ * 4, freq) + 4; + fs2 = 5 * DIV_ROUND_UP(CS35L36_FS_NOM_6MHZ * 4, freq) + 4; } regmap_write(cs35l36->regmap, CS35L36_TESTKEY_CTRL, From patchwork Tue Sep 27 14:09:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shang XiaoJing X-Patchwork-Id: 12993532 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 DD596C04A95 for ; Thu, 29 Sep 2022 06:07:32 +0000 (UTC) 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 4436582B; Thu, 29 Sep 2022 08:06:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4436582B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664431650; bh=im3EeMAe+47Ir6AIJG/MGkNzpH2VJePcZKB94OjLLho=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MS5kfR7ZtvTIIA+L1ft9Iwkct+tzIQvozq27JDbHxr1cGy14e8EFOtBluPEveSYa1 OAYkFNJBx0wlIHxLM8asDDiTTaN6t+oF+4pp3+yWZkgXVeqIwLtXHBynPSMUyFtU8V 6jWyEIxZ6MPvVaIwLe4HrcbETGK9M9Ba1IUbPw+c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BBF0EF80109; Thu, 29 Sep 2022 08:06:39 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A0199F804D0; Tue, 27 Sep 2022 15:35:51 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CCB49F80166 for ; Tue, 27 Sep 2022 15:35:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CCB49F80166 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4McLB828b7zlVmD; Tue, 27 Sep 2022 21:31:28 +0800 (CST) Received: from kwepemm600008.china.huawei.com (7.193.23.88) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 21:35:43 +0800 Received: from huawei.com (10.175.100.227) by kwepemm600008.china.huawei.com (7.193.23.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 21:35:42 +0800 From: Shang XiaoJing To: , , , , , , , , , , , Subject: [PATCH -next 2/4] ASoC: wm8978: Use DIV_ROUND_UP() instead of open-coding it Date: Tue, 27 Sep 2022 22:09:46 +0800 Message-ID: <20220927140948.17696-3-shangxiaojing@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220927140948.17696-1-shangxiaojing@huawei.com> References: <20220927140948.17696-1-shangxiaojing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600008.china.huawei.com (7.193.23.88) X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 29 Sep 2022 08:06:37 +0200 Cc: shangxiaojing@huawei.com 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" Use DIV_ROUND_UP() instead of open-coding it, which intents and makes it more clear what is going on for the casual reviewer. The Coccinelle references Commit e4d8aef21403 ("ALSA: usb: Use DIV_ROUND_UP() instead of open-coding it"). Signed-off-by: Shang XiaoJing Acked-by: Charles Keepax --- sound/soc/codecs/wm8978.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index a682f8020eb6..aa2f55401a88 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c @@ -498,7 +498,7 @@ static int wm8978_configure_pll(struct snd_soc_component *component) if (4 * f_opclk < 3 * f_mclk) /* Have to use OPCLKDIV */ - opclk_div = (3 * f_mclk / 4 + f_opclk - 1) / f_opclk; + opclk_div = DIV_ROUND_UP(3 * f_mclk / 4, f_opclk); else opclk_div = 1; From patchwork Tue Sep 27 14:09:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shang XiaoJing X-Patchwork-Id: 12993536 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 82369C07E9D for ; Thu, 29 Sep 2022 06:08:42 +0000 (UTC) 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 A5AFF846; Thu, 29 Sep 2022 08:07:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A5AFF846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664431720; bh=UHhCuEPqRjCZ9IvZeBIISQ540oUNUMwH/kfKwxaaZ7A=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GaRaYVxGow3TS3BmYpEV8P0ei7iNBh8UHms+R7bC1brcZ7Qkzw1aDG/iNeMePku0U qaPneuYYFGPQ8ZK+Amiad9JcsZXlsjDCa3bCTLRsNV/RmU4NkfYBMKtdvG7xUqXbk7 97zG2A6VND/tODDuohd0ggk310Y9LKSL/e2voYbc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BC30BF80548; Thu, 29 Sep 2022 08:06:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D65D1F80508; Tue, 27 Sep 2022 15:35:56 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 30F1CF8025E for ; Tue, 27 Sep 2022 15:35:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 30F1CF8025E Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4McLCj29LyzpVCB; Tue, 27 Sep 2022 21:32:49 +0800 (CST) Received: from kwepemm600008.china.huawei.com (7.193.23.88) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 21:35:44 +0800 Received: from huawei.com (10.175.100.227) by kwepemm600008.china.huawei.com (7.193.23.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 21:35:43 +0800 From: Shang XiaoJing To: , , , , , , , , , , , Subject: [PATCH -next 3/4] ASoC: rsnd: Use DIV_ROUND_UP() instead of open-coding it Date: Tue, 27 Sep 2022 22:09:47 +0800 Message-ID: <20220927140948.17696-4-shangxiaojing@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220927140948.17696-1-shangxiaojing@huawei.com> References: <20220927140948.17696-1-shangxiaojing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600008.china.huawei.com (7.193.23.88) X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 29 Sep 2022 08:06:37 +0200 Cc: shangxiaojing@huawei.com 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" Use DIV_ROUND_UP() instead of open-coding it, which intents and makes it more clear what is going on for the casual reviewer. The Coccinelle references Commit e4d8aef21403 ("ALSA: usb: Use DIV_ROUND_UP() instead of open-coding it"). Signed-off-by: Shang XiaoJing --- sound/soc/sh/rcar/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 7e380d71b0f8..4e21ebce03c6 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1581,9 +1581,9 @@ static int rsnd_hw_params(struct snd_soc_component *component, hw_params->cmask |= SNDRV_PCM_HW_PARAM_RATE; } else if (params_rate(hw_params) * k_up < io->converted_rate) { hw_param_interval(hw_params, SNDRV_PCM_HW_PARAM_RATE)->min = - (io->converted_rate + k_up - 1) / k_up; + DIV_ROUND_UP(io->converted_rate, k_up); hw_param_interval(hw_params, SNDRV_PCM_HW_PARAM_RATE)->max = - (io->converted_rate + k_up - 1) / k_up; + DIV_ROUND_UP(io->converted_rate, k_up); hw_params->cmask |= SNDRV_PCM_HW_PARAM_RATE; } From patchwork Tue Sep 27 14:09:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shang XiaoJing X-Patchwork-Id: 12993535 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 47C31C07E9D for ; Thu, 29 Sep 2022 06:08:29 +0000 (UTC) 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 4F84AE11; Thu, 29 Sep 2022 08:07:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4F84AE11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1664431707; bh=GoDznqcTbZqflYOorF2AJmh7OjACaWByDTfPnm1F7dE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=EOtW2pwM/LUYhLfcVLbMAIoJxfWOL5qAyoGvyZglDvOnu1IQnY3iYyGFgkZTj+B0/ N5dxtfBHs2DeDhOV3imdT7uwHlZN4KgYE2CexOaqX/2JwQncL70pOnQ6sEGDFCeGQZ k1Wfre/ML24L/7hgie9tpSFGW/nM9K8VfDfdpZ4c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 14F77F8053B; Thu, 29 Sep 2022 08:06:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AEC9FF80496; Tue, 27 Sep 2022 15:35:56 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 92C13F80496 for ; Tue, 27 Sep 2022 15:35:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 92C13F80496 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4McLBB5Pxvz1P6lt; Tue, 27 Sep 2022 21:31:30 +0800 (CST) Received: from kwepemm600008.china.huawei.com (7.193.23.88) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 21:35:45 +0800 Received: from huawei.com (10.175.100.227) by kwepemm600008.china.huawei.com (7.193.23.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 21:35:44 +0800 From: Shang XiaoJing To: , , , , , , , , , , , Subject: [PATCH -next 4/4] ASoC: ti: davinci-mcasp: Use DIV_ROUND_UP() instead of open-coding it Date: Tue, 27 Sep 2022 22:09:48 +0800 Message-ID: <20220927140948.17696-5-shangxiaojing@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220927140948.17696-1-shangxiaojing@huawei.com> References: <20220927140948.17696-1-shangxiaojing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.100.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600008.china.huawei.com (7.193.23.88) X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 29 Sep 2022 08:06:37 +0200 Cc: shangxiaojing@huawei.com 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" Use DIV_ROUND_UP() instead of open-coding it, which intents and makes it more clear what is going on for the casual reviewer. The Coccinelle references Commit e4d8aef21403 ("ALSA: usb: Use DIV_ROUND_UP() instead of open-coding it"). Signed-off-by: Shang XiaoJing --- sound/soc/ti/davinci-mcasp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c index ca5d1bb6ac59..f5ac2ab77f5b 100644 --- a/sound/soc/ti/davinci-mcasp.c +++ b/sound/soc/ti/davinci-mcasp.c @@ -869,7 +869,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE) max_active_serializers = 1; else - max_active_serializers = (channels + slots - 1) / slots; + max_active_serializers = DIV_ROUND_UP(channels, slots); /* Default configuration */ if (mcasp->version < MCASP_VERSION_3) @@ -1002,8 +1002,7 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream, */ if (mcasp->tdm_mask[stream]) { active_slots = hweight32(mcasp->tdm_mask[stream]); - active_serializers = (channels + active_slots - 1) / - active_slots; + active_serializers = DIV_ROUND_UP(channels, active_slots); if (active_serializers == 1) active_slots = channels; for (i = 0; i < total_slots; i++) { @@ -1014,7 +1013,7 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream, } } } else { - active_serializers = (channels + total_slots - 1) / total_slots; + active_serializers = DIV_ROUND_UP(channels, total_slots); if (active_serializers == 1) active_slots = channels; else