lkml.org 
[lkml]   [2013]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] ACPI video: Make logic a little easier to understand.
On 03/14/2013 06:34 PM, Danny Baumann wrote:
> Make code paths a little easier to follow, and don't needlessly continue
> list iteration.

Same here, please add Signed-off-by tag.
Reviewed-by: Aaron Lu <aaron.lu@intel.com>

Thanks,
Aaron

> ---
> drivers/acpi/video.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
> index ef85574..d0fade7 100644
> --- a/drivers/acpi/video.c
> +++ b/drivers/acpi/video.c
> @@ -736,16 +736,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)
>



\
 
 \ /
  Last update: 2013-03-15 10:22    [W:0.063 / U:0.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site