[PATCH] devicetree: dt_sysinfo: reduce scope of version_buf
Colin King
colin.king at canonical.com
Tue Jan 24 12:18:24 UTC 2017
From: Colin Ian King <colin.king at canonical.com>
minor code style change, no functional difference
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/devicetree/dt_sysinfo/dt_sysinfo.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/devicetree/dt_sysinfo/dt_sysinfo.c b/src/devicetree/dt_sysinfo/dt_sysinfo.c
index 9c22351..dd160ee 100644
--- a/src/devicetree/dt_sysinfo/dt_sysinfo.c
+++ b/src/devicetree/dt_sysinfo/dt_sysinfo.c
@@ -57,11 +57,10 @@ static int dt_sysinfo_get_version(fwts_framework *fw,
char *firmware)
{
int version_len;
- const char *version_buf;
/* only output if the platform_firmware node is present */
if (node >= 0) {
- version_buf = fdt_getprop(fw->fdt, node,
+ const char *version_buf = fdt_getprop(fw->fdt, node,
firmware, &version_len);
if (version_buf) {
fwts_passed(fw,
@@ -91,7 +90,6 @@ static int dt_sysinfo_check_version(fwts_framework *fw)
}
int node, version_len;
- const char *version_buf;
fwts_log_info(fw,
"OPAL base device tree path is %s.",
@@ -99,7 +97,7 @@ static int dt_sysinfo_check_version(fwts_framework *fw)
node = fdt_path_offset(fw->fdt,
opal_firmware);
if (node >= 0) {
- version_buf = fdt_getprop(fw->fdt, node,
+ const char *version_buf = fdt_getprop(fw->fdt, node,
"version", &version_len);
if (version_buf) {
fwts_passed(fw,
--
2.10.2
More information about the fwts-devel
mailing list