ACK: [PATCH 03/46] acpi: brightness: reduce scope of variables
IvanHu
ivan.hu at canonical.com
Thu Jan 15 07:28:13 UTC 2015
On 01/14/2015 03:04 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> cppcheck is picking up some minor style issues which can
> be easily fixed:
>
> [src/acpi/brightness/autobrightness.c:161]:
> (style) The scope of the variable 'j' can be reduced.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpi/brightness/autobrightness.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/acpi/brightness/autobrightness.c b/src/acpi/brightness/autobrightness.c
> index 1d94b0e..2bd435a 100644
> --- a/src/acpi/brightness/autobrightness.c
> +++ b/src/acpi/brightness/autobrightness.c
> @@ -158,9 +158,11 @@ static int auto_brightness_test2(fwts_framework *fw)
>
> /* Find the ranges of the failed levels */
> for (i = 0; i <= max_brightness; i++) {
> - int j, end = i;
> + int end = i;
>
> if (brightness_fail[i]) {
> + int j;
> +
> /* Scan until we don't find a failure */
> for (j = i; j <= max_brightness && brightness_fail[j]; j++)
> end = j;
>
Acked-by: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list