dm: cleanup assert in core.c

- check input by condition check, instead of assert.
 - remove redundant header file including for some files.

Tracked-On: #3252
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Shuo Liu <shuo.a.liu@intel.com>
This commit is contained in:
Yonghua Huang
2019-07-04 13:25:21 +08:00
committed by ACRN System Integration
parent 012ec75163
commit 842da0ac1e
9 changed files with 2 additions and 9 deletions

View File

@@ -2291,7 +2291,8 @@ pci_emul_cfgdata(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
{
int coff;
assert(bytes == 1 || bytes == 2 || bytes == 4);
if ((bytes != 1) && (bytes != 2) && (bytes != 4))
return -1;
coff = cfgoff + (port - CONF1_DATA_PORT);
if (cfgenable) {