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

@ -28,7 +28,6 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <openssl/rand.h>
#include "types.h"

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) {

View File

@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -6,7 +6,6 @@
*/
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>

View File

@ -10,7 +10,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <pthread.h>
#include "vmmapi.h"

View File

@ -19,7 +19,6 @@
#include <stdbool.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#include "vmmapi.h"
#include "tpm_internal.h"

View File

@ -28,7 +28,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "usb.h"
#include "usbdi.h"

View File

@ -8,7 +8,6 @@
#include <pthread.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <unistd.h>
#include "usb.h"

View File

@ -76,7 +76,6 @@
*/
#include <sys/types.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>