public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Danny Baumann <dannybaumann@web.de>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zhang Rui <rui.zhang@intel.com>, Len Brown <lenb@kernel.org>
Subject: Re: [PATCH 2/3] ACPI video: Make logic a little easier to understand.
Date: Fri, 15 Mar 2013 16:39:02 +0800	[thread overview]
Message-ID: <5142DE26.7020404@intel.com> (raw)
In-Reply-To: <1363257264-15984-3-git-send-email-dannybaumann@web.de>

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)
> 


  reply	other threads:[~2013-03-15  8:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 10:34 [PATCH 0/3] ACPI video: Fix brightness control initialization sequence Danny Baumann
2013-03-14 10:34 ` [PATCH 1/3] ACPI video: Fix brightness control initialization for some laptops Danny Baumann
2013-03-15  8:38   ` Aaron Lu
2013-03-14 10:34 ` [PATCH 2/3] ACPI video: Make logic a little easier to understand Danny Baumann
2013-03-15  8:39   ` Aaron Lu [this message]
2013-03-14 10:34 ` [PATCH 3/3] ACPI video: Fix applying indexed initial brightness value Danny Baumann
2013-03-15  8:48   ` Aaron Lu
2013-03-15  8:55     ` Danny Baumann
2013-03-15  9:01       ` Aaron Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5142DE26.7020404@intel.com \
    --to=aaron.lu@intel.com \
    --cc=dannybaumann@web.de \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox