linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] mfd/mcp-sa11x0: use DIV_ROUND_UP to calculate rw_timeout
@ 2020-12-22 13:33 Zheng Yongjun
  2020-12-23 15:42 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-22 13:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Zheng Yongjun

Don't open-code DIV_ROUND_UP() kernel macro.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/mfd/mcp-sa11x0.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c
index 98fa0af0e56e..4629dff187cd 100644
--- a/drivers/mfd/mcp-sa11x0.c
+++ b/drivers/mfd/mcp-sa11x0.c
@@ -214,8 +214,7 @@ static int mcp_sa11x0_probe(struct platform_device *dev)
 	 * rate.  This is the period for 3 64-bit frames.  Always
 	 * round this time up.
 	 */
-	mcp->rw_timeout = (64 * 3 * 1000000 + mcp->sclk_rate - 1) /
-			  mcp->sclk_rate;
+	mcp->rw_timeout = DIV_ROUND_UP(64 * 3 * 1000000, mcp->sclk_rate);
 
 	ret = mcp_host_add(mcp, data->codec_pdata);
 	if (ret == 0)
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] mfd/mcp-sa11x0: use DIV_ROUND_UP to calculate rw_timeout
  2020-12-22 13:33 [PATCH -next] mfd/mcp-sa11x0: use DIV_ROUND_UP to calculate rw_timeout Zheng Yongjun
@ 2020-12-23 15:42 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2020-12-23 15:42 UTC (permalink / raw)
  To: Zheng Yongjun; +Cc: linux-kernel

On Tue, 22 Dec 2020, Zheng Yongjun wrote:

> Don't open-code DIV_ROUND_UP() kernel macro.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>  drivers/mfd/mcp-sa11x0.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

I've fixed the subject line and applied the patch, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-23 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 13:33 [PATCH -next] mfd/mcp-sa11x0: use DIV_ROUND_UP to calculate rw_timeout Zheng Yongjun
2020-12-23 15:42 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).