[PATCH] acpi: madt: move scope of boolean 'passed'

Colin King colin.king at canonical.com
Tue Jan 23 12:26:43 UTC 2018


From: Colin Ian King <colin.king at canonical.com>

The boolean variable passed can be moved to a deeper scope. Cleans
up a cppcheck style warning.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/madt/madt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/acpi/madt/madt.c b/src/acpi/madt/madt.c
index c97d9c53..883d5847 100644
--- a/src/acpi/madt/madt.c
+++ b/src/acpi/madt/madt.c
@@ -1445,7 +1445,6 @@ static int madt_subtables(fwts_framework *fw)
 	while (length > (ssize_t)sizeof(fwts_acpi_madt_sub_table_header)) {
 		ssize_t skip = 0;
 		int len = 0;
-		bool passed = true;
 		int type;
 		int offset = 0;
 
@@ -1487,6 +1486,8 @@ static int madt_subtables(fwts_framework *fw)
 		}
 
 		if (!(fw->flags & FWTS_FLAG_TEST_SBBR)) {
+			bool passed = true;
+
 			/* verify that the length is what we expect */
 			if (len == SUBTABLE_VARIABLE) {
 				if (hdr->type == FWTS_ACPI_MADT_LOCAL_SAPIC) {
-- 
2.15.1




More information about the fwts-devel mailing list