[PATCH] devicetree: dt_sysinfo: reduce scope of variables 'model_buf' and 'compat_buf'

Colin King colin.king at canonical.com
Wed Aug 17 10:10:46 UTC 2016


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

Minor change to fix cppcheck style warnings, no functional chang

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

diff --git a/src/devicetree/dt_sysinfo/dt_sysinfo.c b/src/devicetree/dt_sysinfo/dt_sysinfo.c
index 743feb0..f9fc851 100644
--- a/src/devicetree/dt_sysinfo/dt_sysinfo.c
+++ b/src/devicetree/dt_sysinfo/dt_sysinfo.c
@@ -213,7 +213,6 @@ static bool machine_matches_reference_model(fwts_framework *fw,
 static int dt_sysinfo_check_ref_plat_compatible(fwts_framework *fw)
 {
 	int node, compat_len, model_len;
-	const char *model_buf, *compat_buf;
 
 	node = fdt_path_offset(fw->fdt, "/");
 	if (node < 0) {
@@ -228,6 +227,8 @@ static int dt_sysinfo_check_ref_plat_compatible(fwts_framework *fw)
 			"root of the device tree", "ibm,powernv");
 		return FWTS_ERROR;
 	} else {
+		const char *model_buf, *compat_buf;
+
 		compat_buf = fdt_getprop(fw->fdt, node,
 				"compatible", &compat_len);
 		model_buf = fdt_getprop(fw->fdt, node,
-- 
2.8.1




More information about the fwts-devel mailing list