Skip to content

Commit

Permalink
aty128fb: test below 0 on unsigned pll->post_divider
Browse files Browse the repository at this point in the history
pll->post_divider is unsigned, so the test fails

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Jul 24, 2008
1 parent fcea803 commit 816664f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/video/aty/aty128fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,18 +1339,16 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
if (vclk * 12 < c.ppll_min)
vclk = c.ppll_min/12;

pll->post_divider = -1;

/* now, find an acceptable divider */
for (i = 0; i < sizeof(post_dividers); i++) {
for (i = 0; i < ARRAY_SIZE(post_dividers); i++) {
output_freq = post_dividers[i] * vclk;
if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) {
pll->post_divider = post_dividers[i];
break;
}
}

if (pll->post_divider < 0)
if (i == ARRAY_SIZE(post_dividers))
return -EINVAL;

/* calculate feedback divider */
Expand Down

0 comments on commit 816664f

Please sign in to comment.