Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114849
b: refs/heads/master
c: 7528f54
h: refs/heads/master
i:
  114847: 988b9ea
v: v3
  • Loading branch information
Krzysztof Helt authored and Linus Torvalds committed Oct 16, 2008
1 parent db00d56 commit 6bc7a2b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 786e463e7fcd4ad26fede828f22033584563584a
refs/heads/master: 7528f543889fd460964b42881296b2e84457684e
40 changes: 19 additions & 21 deletions trunk/drivers/video/cirrusfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3075,38 +3075,36 @@ static void bestclock(long freq, long *best, long *nom,
f = freq * 10;

for (n = 32; n < 128; n++) {
int s = 0;

d = (143181 * n) / f;
if ((d >= 7) && (d <= 63)) {
if (d > 31)
d = (d / 2) * 2;
h = (14318 * n) / d;
int temp = d;

if (temp > 31) {
s = 1;
temp >>= 1;
}
h = ((14318 * n) / temp) >> s;
if (abs(h - freq) < abs(*best - freq)) {
*best = h;
*nom = n;
if (d < 32) {
*den = d;
*div = 0;
} else {
*den = d / 2;
*div = 1;
}
*den = temp;
*div = s;
}
}
d = DIV_ROUND_UP(143181 * n, f);
d++;
if ((d >= 7) && (d <= 63)) {
if (d > 31)
d = (d / 2) * 2;
h = (14318 * n) / d;
if (d > 31) {
s = 1;
d >>= 1;
}
h = ((14318 * n) / d) >> s;
if (abs(h - freq) < abs(*best - freq)) {
*best = h;
*nom = n;
if (d < 32) {
*den = d;
*div = 0;
} else {
*den = d / 2;
*div = 1;
}
*den = d;
*div = s;
}
}
}
Expand Down

0 comments on commit 6bc7a2b

Please sign in to comment.