[PATCH 03/46] acpi: brightness: reduce scope of variables

Colin King colin.king at canonical.com
Tue Jan 13 19:04:22 UTC 2015


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;
-- 
2.1.4




More information about the fwts-devel mailing list