summaryrefslogtreecommitdiff
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2013-03-19 16:22:51 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-03-25 00:26:55 +0100
commit2d4128a25206685aaccaf14220c8436b11c6dc01 (patch)
treeeae830a429a2602423592245fad57db097249c44 /drivers/acpi/video.c
parenta89803df9c9b2d023227c48503066a728f1fed36 (diff)
ACPI / video: Make logic a little easier to understand.
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>
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 387b3705279a..8522d14972cf 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -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)