All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nouveau/nvkm/subdev/clk/gk20a.c: fix wrong do_div() usage
@ 2015-11-03 22:01 Nicolas Pitre
  2015-12-04 17:38 ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Pitre @ 2015-11-03 22:01 UTC (permalink / raw)
  To: David Airlie; +Cc: Ben Skeggs, dri-devel

do_div() must only be used with a u64 dividend.

Signed-off-by: Nicolas Pitre <nico@linaro.org>

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c
index 254094ab7f..5da2aa8cc3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c
@@ -141,9 +141,8 @@ gk20a_pllg_calc_rate(struct gk20a_clk *clk)
 
 	rate = clk->parent_rate * clk->n;
 	divider = clk->m * pl_to_div[clk->pl];
-	do_div(rate, divider);
 
-	return rate / 2;
+	return rate / divider / 2;
 }
 
 static int
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2015-12-04 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-03 22:01 [PATCH] nouveau/nvkm/subdev/clk/gk20a.c: fix wrong do_div() usage Nicolas Pitre
2015-12-04 17:38 ` Thierry Reding
2015-12-04 19:58   ` Nicolas Pitre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.