dm: Fix some issues from string operations

The patch fix some string operations issues and also improve readability
of several snippet.

Tracked-On: #2133
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Shuo A Liu
2018-12-20 11:00:31 +08:00
committed by wenlingz
parent 20d0e666ff
commit 3e0b06cfd6
7 changed files with 62 additions and 84 deletions

View File

@@ -52,10 +52,11 @@ int guest_domid = 1;
int
acrn_parse_gvtargs(char *arg)
{
if (parse_bdf(arg, &gvt_low_gm_sz, &gvt_high_gm_sz,
&gvt_fence_sz, 10) != 0) {
if (dm_strtoi(arg, &arg, 10, &gvt_low_gm_sz) != 0 ||
dm_strtoi(arg, &arg, 10, &gvt_high_gm_sz) != 0 ||
dm_strtoi(arg, &arg, 10, &gvt_fence_sz) != 0)
return -1;
}
printf("passed gvt-g optargs low_gm %d, high_gm %d, fence %d\n",
gvt_low_gm_sz, gvt_high_gm_sz, gvt_fence_sz);