Skip to content

Commit

Permalink
ACPI / video: Make logic a little easier to understand.
Browse files Browse the repository at this point in the history
Make code paths a little easier to follow, and don't needlessly continue
list iteration.

Signed-off-by: Danny Baumann <dannybaumann@web.de>
Reviewed-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Danny Baumann authored and Rafael J. Wysocki committed Mar 24, 2013
1 parent a89803d commit 2d4128a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,16 +745,17 @@ acpi_video_init_brightness(struct acpi_video_device *device)
*/
if (use_bios_initial_backlight) {
for (i = 2; i < br->count; i++)
if (level_old == br->levels[i])
if (level_old == br->levels[i]) {
level = level_old;
break;
}
}
goto set_level;
} else {
if (br->flags._BCL_reversed)
level_old = (br->count - 1) - level_old;
level = br->levels[level_old];
}

if (br->flags._BCL_reversed)
level_old = (br->count - 1) - level_old;
level = br->levels[level_old];

set_level:
result = acpi_video_device_lcd_set_level(device, level);
if (result)
Expand Down

0 comments on commit 2d4128a

Please sign in to comment.