[PATCH] opal: cpu_info: remove redundant initialization of prop_string to NULL

Colin King colin.king at canonical.com
Tue Jan 24 12:29:08 UTC 2017


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

prop_string is initialized to NULL and then re-assigned immediately
afterwards.  Remove the redundant initialization.

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

diff --git a/src/opal/cpu_info.c b/src/opal/cpu_info.c
index 1d5ec3c..22cccbf 100644
--- a/src/opal/cpu_info.c
+++ b/src/opal/cpu_info.c
@@ -34,9 +34,8 @@ static int get_xscom_property(fwts_framework *fw,
 {
 	int node, prop_len, failures = 0;
 	const char *prop_buf;
-	char *prop_string = NULL;
+	char *prop_string = strstr(my_path, "/xscom");
 
-	prop_string = strstr(my_path, "/xscom");
 	if (prop_string) {
 		node = fdt_path_offset(fw->fdt, prop_string);
 		if (node >= 0) {
-- 
2.10.2




More information about the fwts-devel mailing list