hv: fixed compiling warning

removed some unnecessary variables and functions.

v1-->v2:
   Replace div-by-zero with an inline ASM code

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Mingqiang Chi
2018-08-16 10:31:56 +08:00
committed by lijinxia
parent 40745d90c5
commit bdcc3aef22
12 changed files with 13 additions and 72 deletions

View File

@@ -916,7 +916,10 @@ static int shell_trigger_crash(int argc, char **argv)
(void)argv;
snprintf(str, MAX_STR_SIZE, "trigger crash, divide by 0 ...\r\n");
shell_puts(str);
snprintf(str, MAX_STR_SIZE, "%d\r", 1/0);
asm("movl $0x1, %eax");
asm("movl $0x0, %ecx");
asm("idiv %ecx");
return 0;
}