diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2015-11-04 05:49:15 +0300 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2015-11-16 20:37:55 +0300 |
commit | 3ed9c824375b07a2acd6919d0fe7aa71650c7f69 (patch) | |
tree | 126c8d832a8cd036f65772d432d29be3b15453f6 /drivers/clk/tegra | |
parent | 4471f9a4db2d8dfdc79618502fafb1172ab40f05 (diff) | |
download | linux-3ed9c824375b07a2acd6919d0fe7aa71650c7f69.tar.xz |
tegra/clk-divider: fix wrong do_div() usage
do_div() is meant to be used with an unsigned dividend.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Diffstat (limited to 'drivers/clk/tegra')
-rw-r--r-- | drivers/clk/tegra/clk-divider.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/tegra/clk-divider.c b/drivers/clk/tegra/clk-divider.c index 48c83efda4cf..16e0aee14773 100644 --- a/drivers/clk/tegra/clk-divider.c +++ b/drivers/clk/tegra/clk-divider.c @@ -32,7 +32,7 @@ static int get_div(struct tegra_clk_frac_div *divider, unsigned long rate, unsigned long parent_rate) { - s64 divider_ux1 = parent_rate; + u64 divider_ux1 = parent_rate; u8 flags = divider->flags; int mul; @@ -54,7 +54,7 @@ static int get_div(struct tegra_clk_frac_div *divider, unsigned long rate, divider_ux1 -= mul; - if (divider_ux1 < 0) + if ((s64)divider_ux1 < 0) return 0; if (divider_ux1 > get_max_div(divider)) |