linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] gpu/drm/radeon: use DIV_ROUND_UP macro to do calculation
@ 2020-12-22 13:31 Zheng Yongjun
  2021-01-04 17:02 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-22 13:31 UTC (permalink / raw)
  To: airlied, daniel, amd-gfx, dri-devel, linux-kernel; +Cc: Zheng Yongjun

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

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/gpu/drm/radeon/r600_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 390a9621604a..a3aea5329712 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -219,7 +219,7 @@ int r600_fmt_get_nblocksx(u32 format, u32 w)
 	if (bw == 0)
 		return 0;
 
-	return (w + bw - 1) / bw;
+	return DIV_ROUND_UP(w, bw);
 }
 
 int r600_fmt_get_nblocksy(u32 format, u32 h)
@@ -233,7 +233,7 @@ int r600_fmt_get_nblocksy(u32 format, u32 h)
 	if (bh == 0)
 		return 0;
 
-	return (h + bh - 1) / bh;
+	return DIV_ROUND_UP(h, bh);
 }
 
 struct array_mode_checker {
-- 
2.22.0


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

* Re: [PATCH -next] gpu/drm/radeon: use DIV_ROUND_UP macro to do calculation
  2020-12-22 13:31 [PATCH -next] gpu/drm/radeon: use DIV_ROUND_UP macro to do calculation Zheng Yongjun
@ 2021-01-04 17:02 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2021-01-04 17:02 UTC (permalink / raw)
  To: Zheng Yongjun
  Cc: Dave Airlie, Daniel Vetter, amd-gfx list,
	Maling list - DRI developers, LKML

On Wed, Dec 23, 2020 at 2:06 AM Zheng Yongjun <zhengyongjun3@huawei.com> wrote:
>
> Don't open-code DIV_ROUND_UP() kernel macro.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

Applied.  Thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/r600_cs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
> index 390a9621604a..a3aea5329712 100644
> --- a/drivers/gpu/drm/radeon/r600_cs.c
> +++ b/drivers/gpu/drm/radeon/r600_cs.c
> @@ -219,7 +219,7 @@ int r600_fmt_get_nblocksx(u32 format, u32 w)
>         if (bw == 0)
>                 return 0;
>
> -       return (w + bw - 1) / bw;
> +       return DIV_ROUND_UP(w, bw);
>  }
>
>  int r600_fmt_get_nblocksy(u32 format, u32 h)
> @@ -233,7 +233,7 @@ int r600_fmt_get_nblocksy(u32 format, u32 h)
>         if (bh == 0)
>                 return 0;
>
> -       return (h + bh - 1) / bh;
> +       return DIV_ROUND_UP(h, bh);
>  }
>
>  struct array_mode_checker {
> --
> 2.22.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2021-01-04 17:03 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:31 [PATCH -next] gpu/drm/radeon: use DIV_ROUND_UP macro to do calculation Zheng Yongjun
2021-01-04 17:02 ` Alex Deucher

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).