[PATCH 5/7] opal: remove redundant initializations of command to NULL
Colin King
colin.king at canonical.com
Wed Oct 19 13:26:37 UTC 2016
From: Colin Ian King <colin.king at canonical.com>
command is immediately set to point to a command line literal string
so no need to initialize it to NULL.
Cleans up 2 cppcheck style warnings:
src/opal/prd_info.c:79: (style) Variable 'command' is reassigned a
value before the old one has been used.
src/opal/prd_info.c:130: (style) Variable 'command' is reassigned a
value before the old one has been used.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/opal/prd_info.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/opal/prd_info.c b/src/opal/prd_info.c
index f507baa..a019b8e 100644
--- a/src/opal/prd_info.c
+++ b/src/opal/prd_info.c
@@ -73,7 +73,7 @@ int prd_dev_query(fwts_framework *fw)
static int prd_service_check(fwts_framework *fw, int *restart)
{
int rc = FWTS_OK, status = 0, stop_status = 0;
- char *command = NULL;
+ char *command;
char *output = NULL;
command = "systemctl status opal-prd.service 2>&1";
@@ -124,7 +124,7 @@ out:
static int prd_restart(fwts_framework *fw)
{
int status = 0;
- char *command = NULL;
+ char *command;
char *output = NULL;
command = "systemctl start opal-prd.service 2>&1";
--
2.9.3
More information about the fwts-devel
mailing list