[PATCH] nouveau/nvkm/subdev/clk/gk20a.c: fix wrong do_div() usage
Nicolas Pitre
nicolas.pitre at linaro.org
Tue Nov 3 14:01:46 PST 2015
do_div() must only be used with a u64 dividend.
Signed-off-by: Nicolas Pitre <nico at 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
More information about the dri-devel
mailing list