dm: platform: clean up assert() for some platform devices

Tracked-On: #3252
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
2019-06-18 14:00:23 +08:00
committed by wenlingz
parent 1b7995387d
commit db7e7f1c44
4 changed files with 26 additions and 27 deletions

View File

@@ -28,7 +28,6 @@
*/
#include <stdio.h>
#include <assert.h>
#include <stdbool.h>
#include "inout.h"
@@ -63,9 +62,6 @@ cmos_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
static int buf_offset;
static int next_ops; /* 0 for addr, 1 for data, in pair (addr,data)*/
assert(port == CMOS_ADDR || port == CMOS_DATA);
assert(bytes == 1);
#ifdef CMOS_DEBUG
if (!dbg_file)
dbg_file = fopen("/tmp/cmos_log", "a+");
@@ -77,7 +73,6 @@ cmos_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
if (port == CMOS_ADDR) {
/* if port is addr, ops should be 0 */
assert(next_ops == 0 && !in);
if (next_ops != 0) {
next_ops = 0;
return -1;
@@ -88,7 +83,6 @@ cmos_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
} else if (port == CMOS_DATA) {
assert(next_ops == 1);
if (next_ops != 1) {
next_ops = 0;
return -1;