[PATCH] opal: cpu_info: reduce scope of some variables

Colin King colin.king at canonical.com
Tue Jan 24 12:30:23 UTC 2017


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

clean up some cppcheck style warnings by reducing scope of some
variables.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/opal/cpu_info.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/opal/cpu_info.c b/src/opal/cpu_info.c
index 22cccbf..603163c 100644
--- a/src/opal/cpu_info.c
+++ b/src/opal/cpu_info.c
@@ -32,12 +32,13 @@ static int get_xscom_property(fwts_framework *fw,
 			bool hex,
 			char *property)
 {
-	int node, prop_len, failures = 0;
-	const char *prop_buf;
+	int failures = 0;
 	char *prop_string = strstr(my_path, "/xscom");
 
 	if (prop_string) {
-		node = fdt_path_offset(fw->fdt, prop_string);
+		const char *prop_buf;
+		int prop_len;
+		int node = fdt_path_offset(fw->fdt, prop_string);
 		if (node >= 0) {
 			prop_buf = fdt_getprop(fw->fdt, node,
 					property,
-- 
2.10.2




More information about the fwts-devel mailing list