hv:Fix unused var value on all paths

MISRAC checks whether a variable is assigned a value not used in
all branches of a program. Var value which is unused on all paths
can be removed with a consequent improvement in the readability
and efficiency of the code. This patch is used to fix these
violations.

Tracked-On: #861
Signed-off-by: Junjun Shan <junjun.shan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Junjun Shan
2018-09-19 18:04:29 +08:00
committed by lijinxia
parent f1cce6710a
commit 89ca54cafa
8 changed files with 29 additions and 27 deletions

View File

@@ -450,7 +450,7 @@ void shell_init(void)
#define MAX_INDENT_LEN 16
static int shell_cmd_help(__unused int argc, __unused char **argv)
{
int spaces = 0;
int spaces;
struct shell_cmd *p_cmd = NULL;
char space_buf[MAX_INDENT_LEN + 1];
@@ -679,7 +679,7 @@ static int shell_dumpmem(int argc, char **argv)
{
uint64_t addr;
uint64_t *ptr;
uint32_t i, length = 32U;
uint32_t i, length;
char temp_str[MAX_STR_SIZE];
/* User input invalidation */