Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71624
b: refs/heads/master
c: 63f0edf
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Starikovskiy authored and Len Brown committed Sep 5, 2007
1 parent 6af7aac commit 18d9953
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 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: 4500ca8e221e72cc38e7c239b9b1a041031ee450
refs/heads/master: 63f0edfc0b7f8058f9d3f9b572615ec97ae011ba
13 changes: 12 additions & 1 deletion trunk/drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1636,9 +1636,20 @@ static int
acpi_video_get_next_level(struct acpi_video_device *device,
u32 level_current, u32 event)
{
int min, max, min_above, max_below, i, l;
int min, max, min_above, max_below, i, l, delta = 255;
max = max_below = 0;
min = min_above = 255;
/* Find closest level to level_current */
for (i = 0; i < device->brightness->count; i++) {
l = device->brightness->levels[i];
if (abs(l - level_current) < abs(delta)) {
delta = l - level_current;
if (!delta)
break;
}
}
/* Ajust level_current to closest available level */
level_current += delta;
for (i = 0; i < device->brightness->count; i++) {
l = device->brightness->levels[i];
if (l < min)
Expand Down

0 comments on commit 18d9953

Please sign in to comment.