diff mbox

devicetree: dt_sysinfo: reduce scope of variables 'model_buf' and 'compat_buf'

Message ID 1471428646-128824-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King Aug. 17, 2016, 10:10 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Minor change to fix cppcheck style warnings, no functional chang

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

Comments

Alex Hung Aug. 18, 2016, 2:13 a.m. UTC | #1
On 2016-08-17 06:10 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Minor change to fix cppcheck style warnings, no functional chang
>
> Signed-off-by: Colin Ian King <colin.king@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,
>


Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Aug. 18, 2016, 2:21 a.m. UTC | #2
On 2016年08月17日 18:10, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Minor change to fix cppcheck style warnings, no functional chang
>
> Signed-off-by: Colin Ian King <colin.king@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,
>

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

Patch

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,