acpi: method: reduce scope of boolean flag matching_levels
diff mbox series

Message ID 20190611090906.21213-1-colin.king@canonical.com
State Accepted
Headers show
Series
  • acpi: method: reduce scope of boolean flag matching_levels
Related show

Commit Message

Colin King June 11, 2019, 9:09 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Clean up a cppcheck style check.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/method/method.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Hung June 11, 2019, 4:31 p.m. UTC | #1
On 2019-06-11 2:09 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Clean up a cppcheck style check.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/method/method.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index d1f20bb2..eeb9c7fa 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -5739,7 +5739,6 @@ static void method_test_BCL_return(
>  	uint32_t i;
>  	bool failed = false;
>  	bool ascending_levels = false;
> -	bool matching_levels;
>  	char *str = NULL;
>  
>  	FWTS_UNUSED(private);
> @@ -5812,7 +5811,8 @@ static void method_test_BCL_return(
>  	}
>  
>  	if (!access("/sys/class/backlight/acpi_video0", R_OK)) {
> -		matching_levels = false;
> +		bool matching_levels = false;
> +
>  		for (i = 2; i < obj->Package.Count; i++) {
>  			if (obj->Package.Elements[0].Integer.Value ==
>  			    obj->Package.Elements[i].Integer.Value) {
> 




Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan June 12, 2019, 3:41 a.m. UTC | #2
On 6/11/19 5:09 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Clean up a cppcheck style check.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/method/method.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index d1f20bb2..eeb9c7fa 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -5739,7 +5739,6 @@ static void method_test_BCL_return(
>  	uint32_t i;
>  	bool failed = false;
>  	bool ascending_levels = false;
> -	bool matching_levels;
>  	char *str = NULL;
>  
>  	FWTS_UNUSED(private);
> @@ -5812,7 +5811,8 @@ static void method_test_BCL_return(
>  	}
>  
>  	if (!access("/sys/class/backlight/acpi_video0", R_OK)) {
> -		matching_levels = false;
> +		bool matching_levels = false;
> +
>  		for (i = 2; i < obj->Package.Count; i++) {
>  			if (obj->Package.Elements[0].Integer.Value ==
>  			    obj->Package.Elements[i].Integer.Value) {


Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch
diff mbox series

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index d1f20bb2..eeb9c7fa 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -5739,7 +5739,6 @@  static void method_test_BCL_return(
 	uint32_t i;
 	bool failed = false;
 	bool ascending_levels = false;
-	bool matching_levels;
 	char *str = NULL;
 
 	FWTS_UNUSED(private);
@@ -5812,7 +5811,8 @@  static void method_test_BCL_return(
 	}
 
 	if (!access("/sys/class/backlight/acpi_video0", R_OK)) {
-		matching_levels = false;
+		bool matching_levels = false;
+
 		for (i = 2; i < obj->Package.Count; i++) {
 			if (obj->Package.Elements[0].Integer.Value ==
 			    obj->Package.Elements[i].Integer.Value) {