diff --git a/support/platform/src/dmac_core.c b/support/platform/src/dmac_core.c index 320fcf5cd211b17454d329990f335ec32aae1d90..b2b207b4c2696000d1129cc671c10ca5071dddda 100644 --- a/support/platform/src/dmac_core.c +++ b/support/platform/src/dmac_core.c @@ -6,16 +6,17 @@ * See the LICENSE file in the root of this repository for complete details. */ +#include "dmac_core.h" #include #include "hdf_log.h" #include "osal_io.h" #include "osal_irq.h" #include "osal_mem.h" -#include "dmac_core.h" #define HDF_LOG_TAG dmac_core #define DMA_ALIGN_SIZE 256 +#define DMA_MAX_TRANS_SIZE_DEFAULT 256 static int DmacCheck(struct DmaCntlr *cntlr) { @@ -66,7 +67,7 @@ static void DmacFreeLli(struct DmacChanInfo *chanInfo) */ void DmaCntlrDestroy(struct DmaCntlr *cntlr) { - int i; + unsigned int i; if (cntlr == NULL || cntlr->channelNum > DMAC_CHAN_NUM_MAX) { HDF_LOGE("%s: cntlr null or channel invalid!", __func__); @@ -107,7 +108,7 @@ static void DmacCallbackHandle(struct DmacChanInfo *chanInfo) static int DmacWaitM2mSendComplete(struct DmaCntlr *cntlr, struct DmacChanInfo *chanInfo) { - unsigned int ret; + uint32_t ret; if (DmacCheck(cntlr) != HDF_SUCCESS) { HDF_LOGE("check fail"); @@ -130,7 +131,7 @@ static int DmacWaitM2mSendComplete(struct DmaCntlr *cntlr, struct DmacChanInfo * static int DmacAllocateChannel(struct DmaCntlr *cntlr) { - unsigned int flags; + uint32_t flags; int i; if (DmacCheck(cntlr) != HDF_SUCCESS) { @@ -190,7 +191,7 @@ static struct DmacChanInfo *DmacRequestChannel(struct DmaCntlr *cntlr, HDF_LOGE("%s: get channel fail ret = %d", __func__, ret); return NULL; } - HDF_LOGD("channel = %d, transfer type = %d width = %u, config = 0x%x, lliflag = 0x%x", + HDF_LOGD("channel = %d, transfer type = %u width = %u, config = 0x%x, lliflag = 0x%x", ret, chanInfo->transferType, chanInfo->width, chanInfo->config, chanInfo->lliEnFlag); return chanInfo; } @@ -220,19 +221,13 @@ static int DmacFillLli(struct DmaCntlr *cntlr, struct DmacChanInfo *chanInfo, plli->count = cntlr->maxTransSize; } else { plli->nextLli = 0; - plli->count = (length % cntlr->maxTransSize); + plli->count = cntlr->maxTransSize == 0 ? length : (length % cntlr->maxTransSize); } plli->srcAddr = (long long)srcaddr; plli->destAddr = (long long)dstaddr; plli->config = chanInfo->config; - HDF_LOGD("plli->srcAddr = 0x%llx\n", plli->srcAddr); - HDF_LOGD("plli->destAddr = 0x%llx\n", plli->destAddr); - HDF_LOGD("plli->nextLli = 0x%llx\n", plli->nextLli); - HDF_LOGD("plli->config = 0x%x\n", plli->config); - HDF_LOGD("plli->count = 0x%x\n", plli->count); - if (chanInfo->transferType == TRASFER_TYPE_P2M) { dstaddr += plli->count; } else if (chanInfo->transferType == TRASFER_TYPE_M2P) { @@ -240,6 +235,7 @@ static int DmacFillLli(struct DmaCntlr *cntlr, struct DmacChanInfo *chanInfo, } plli++; } + plli = chanInfo->lli; cntlr->dmacCacheFlush((UINTPTR)plli, (UINTPTR)plli + (UINTPTR)(sizeof(struct DmacLli) * lliNum)); HDF_LOGD("alloc_addr = 0x%x, alloc_addr + (sizeof(DmacLli) * lli_num)= 0x%x\n", (UINTPTR)plli, (UINTPTR)plli + (UINTPTR)(sizeof(struct DmacLli) * lliNum)); @@ -369,6 +365,7 @@ static int DmacM2mTransfer(struct DmaCntlr *cntlr, struct DmacMsg *msg) return HDF_FAILURE; } if (dmaSize == 0) { + DmacFreeChannel(cntlr, chanInfo->channel); return HDF_FAILURE; } leftSize -= dmaSize; @@ -403,7 +400,7 @@ int32_t DmaCntlrTransfer(struct DmaCntlr *cntlr, struct DmacMsg *msg) } else if (msg->direct == TRASFER_TYPE_M2M) { return DmacM2mTransfer(cntlr, msg); } else { - HDF_LOGE("%s: invalid direct %d", __func__, msg->direct); + HDF_LOGE("%s: invalid direct %u", __func__, msg->direct); return HDF_FAILURE; } return DmacPeriphTransfer(cntlr, msg, periphAddr); @@ -419,7 +416,7 @@ unsigned int DmaGetCurrChanDestAddr(struct DmaCntlr *cntlr, unsigned int chan) return cntlr->dmacGetCurrDestAddr(cntlr, chan); } -static uint32_t DmacIsr(int irq, void *dev) +static uint32_t DmacIsr(uint32_t irq, void *dev) { struct DmaCntlr *cntlr = (struct DmaCntlr *)dev; unsigned int channelStatus; @@ -431,9 +428,9 @@ static uint32_t DmacIsr(int irq, void *dev) } if (irq != cntlr->irq || cntlr->channelNum > DMAC_CHAN_NUM_MAX) { - HDF_LOGE("%s: cntlr parm err! irq:%d, channel:%u", + HDF_LOGE("%s: cntlr param err! irq:%u, channel:%u", __func__, cntlr->irq, cntlr->channelNum); - return HDF_SUCCESS; + return HDF_ERR_INVALID_PARAM; } for (i = 0; i < cntlr->channelNum; i++) { channelStatus = cntlr->dmacGetChanStatus(cntlr, i); @@ -455,15 +452,19 @@ int DmacInit(struct DmaCntlr *cntlr) HDF_LOGE("check fail"); return HDF_FAILURE; } - if (cntlr->channelNum > DMAC_CHAN_NUM_MAX) { - HDF_LOGE("%s: invalid channel:%d", __func__, cntlr->channelNum); + if (cntlr->channelNum == 0 || cntlr->channelNum > DMAC_CHAN_NUM_MAX) { + HDF_LOGE("%s: invalid channel:%u", __func__, cntlr->channelNum); return HDF_FAILURE; } + if (cntlr->maxTransSize == 0) { + cntlr->maxTransSize = DMA_MAX_TRANS_SIZE_DEFAULT; + } cntlr->remapBase = (char *)OsalIoRemap((unsigned long)cntlr->phyBase, (unsigned long)cntlr->regSize); - OsalSpinInit(&cntlr->lock); + (void)OsalSpinInit(&cntlr->lock); cntlr->channelList = (struct DmacChanInfo *)OsalMemCalloc(sizeof(struct DmacChanInfo) * cntlr->channelNum); if (cntlr->channelList == NULL) { HDF_LOGE("channel list malloc fail"); + (void)OsalSpinDestroy(&cntlr->lock); OsalIoUnmap((void *)cntlr->remapBase); return HDF_FAILURE; } @@ -474,9 +475,10 @@ int DmacInit(struct DmaCntlr *cntlr) } ret = OsalRegisterIrq(cntlr->irq, 0, (OsalIRQHandle)DmacIsr, "PlatDmac", cntlr); if (ret != HDF_SUCCESS) { - HDF_LOGE("DMA Irq %d request failed, ret = %d\n", cntlr->irq, ret); + HDF_LOGE("DMA Irq %u request failed, ret = %d\n", cntlr->irq, ret); OsalMemFree(cntlr->channelList); cntlr->channelList = NULL; + (void)OsalSpinDestroy(&cntlr->lock); OsalIoUnmap((void *)cntlr->remapBase); } return ret; diff --git a/support/platform/src/emmc_core.c b/support/platform/src/emmc_core.c index b30cc433f1aeceea257f2cb470d972c4791a0478..3de968cb14bc8f68359f97309c7a31c7d71618ef 100644 --- a/support/platform/src/emmc_core.c +++ b/support/platform/src/emmc_core.c @@ -6,8 +6,8 @@ * See the LICENSE file in the root of this repository for complete details. */ -#include "device_resource_if.h" #include "emmc_core.h" +#include "device_resource_if.h" #include "hdf_log.h" #include "osal_mem.h" @@ -15,12 +15,12 @@ int32_t EmmcCntlrFindHost(struct EmmcCntlr *cntlr) { - if (cntlr == NULL || cntlr->method == NULL || cntlr->method->findHost == NULL) { - HDF_LOGE("EmmcCntlrFindHost: cntlr or method or findHost is NULL!"); + if (cntlr == null || cntlr->method == null || cntlr->method->findHost == null) { + HDF_LOGE("EmmcCntlrFindHost: cntlr or method or findHost is null!"); return HDF_ERR_INVALID_PARAM; } if (cntlr->method->findHost(cntlr, &(cntlr->configData)) != HDF_SUCCESS) { - HDF_LOGE("EmmcCntlrFindHost: findHost fail!"); + HDF_LOGE("EmmcCntlrFindHost: findHost failed"); return HDF_ERR_INVALID_OBJECT; } return HDF_SUCCESS; @@ -28,12 +28,12 @@ int32_t EmmcCntlrFindHost(struct EmmcCntlr *cntlr) int32_t EmmcCntlrGetCid(struct EmmcCntlr *cntlr, uint8_t *cid, uint32_t size) { - if (cntlr == NULL) { + if (cntlr == null) { HDF_LOGE("EmmcCntlrGetCid: cntlr is null"); return HDF_ERR_INVALID_OBJECT; } - if (cntlr->method == NULL || cntlr->method->getCid == NULL) { + if (cntlr->method == null || cntlr->method->getCid == null) { HDF_LOGE("EmmcCntlrGetCid: ops or getCid is null"); return HDF_ERR_NOT_SUPPORT; } @@ -42,8 +42,8 @@ int32_t EmmcCntlrGetCid(struct EmmcCntlr *cntlr, uint8_t *cid, uint32_t size) static int32_t EmmcGetCidWriteBackReply(struct HdfSBuf *reply, uint8_t *cid, uint32_t size) { - if (HdfSbufWriteBuffer(reply, cid, size) == false) { - HDF_LOGE("EmmcGetCidWriteBackReply: write to reply fail!"); + if (!HdfSbufWriteBuffer(reply, cid, size)) { + HDF_LOGE("EmmcGetCidWriteBackReply: write to reply failed"); return HDF_ERR_IO; } return HDF_SUCCESS; @@ -56,7 +56,7 @@ static int32_t EmmcGetCidDispatch(struct EmmcCntlr *cntlr, struct HdfSBuf *reply ret = EmmcCntlrGetCid(cntlr, cid, EMMC_CID_LEN); if (ret != HDF_SUCCESS) { - HDF_LOGE("EmmcGetCidDispatch: EmmcCntlrGetCid fail!"); + HDF_LOGE("EmmcGetCidDispatch: EmmcCntlrGetCid failed"); return ret; } return EmmcGetCidWriteBackReply(reply, cid, EMMC_CID_LEN); @@ -65,27 +65,27 @@ static int32_t EmmcGetCidDispatch(struct EmmcCntlr *cntlr, struct HdfSBuf *reply static int32_t EmmcIoDispatch(struct HdfDeviceIoClient *client, int cmd, struct HdfSBuf *data, struct HdfSBuf *reply) { int32_t ret; - struct EmmcCntlr *cntlr = NULL; + struct EmmcCntlr *cntlr = null; (void)data; - if (client == NULL || client->device == NULL) { - HDF_LOGE("EmmcIoDispatch: client or client->device is NULL"); + if (client == null || client->device == null) { + HDF_LOGE("EmmcIoDispatch: client or client->device is null"); return HDF_ERR_INVALID_OBJECT; } - if (reply == NULL) { - HDF_LOGE("EmmcIoDispatch: reply is NULL"); + if (reply == null) { + HDF_LOGE("EmmcIoDispatch: reply is null"); return HDF_ERR_INVALID_PARAM; } cntlr = (struct EmmcCntlr *)client->device->service; - if (cntlr == NULL) { - HDF_LOGE("EmmcIoDispatch: service is NULL"); + if (cntlr == null) { + HDF_LOGE("EmmcIoDispatch: service is null"); return HDF_ERR_INVALID_OBJECT; } - if (cntlr->priv == NULL) { + if (cntlr->priv == null) { if (EmmcCntlrFindHost(cntlr) != HDF_SUCCESS) { - HDF_LOGE("EmmcIoDispatch: find host fail!"); + HDF_LOGE("EmmcIoDispatch: find host failed"); return HDF_ERR_INVALID_OBJECT; } } @@ -104,17 +104,17 @@ static int32_t EmmcIoDispatch(struct HdfDeviceIoClient *client, int cmd, struct struct EmmcCntlr *EmmcCntlrCreateAndBind(struct HdfDeviceObject *device) { - struct EmmcCntlr *cntlr = NULL; + struct EmmcCntlr *cntlr = null; - if (device == NULL) { - HDF_LOGE("EmmcCntlrCreateAndBind: device is NULL!"); - return NULL; + if (device == null) { + HDF_LOGE("EmmcCntlrCreateAndBind: device is null!"); + return null; } cntlr = (struct EmmcCntlr *)OsalMemCalloc(sizeof(*cntlr)); - if (cntlr == NULL) { - HDF_LOGE("EmmcCntlrCreateAndBind: malloc host fail!"); - return NULL; + if (cntlr == null) { + HDF_LOGE("EmmcCntlrCreateAndBind: malloc host failed"); + return null; } cntlr->device = device; device->service = &cntlr->service; @@ -124,42 +124,42 @@ struct EmmcCntlr *EmmcCntlrCreateAndBind(struct HdfDeviceObject *device) void EmmcCntlrDestroy(struct EmmcCntlr *cntlr) { - if (cntlr != NULL) { - cntlr->device = NULL; - cntlr->priv = NULL; - cntlr->method = NULL; + if (cntlr != null) { + cntlr->device = null; + cntlr->priv = null; + cntlr->method = null; OsalMemFree(cntlr); } } int32_t EmmcFillConfigData(struct HdfDeviceObject *device, struct EmmcConfigData *configData) { - const struct DeviceResourceNode *node = NULL; - struct DeviceResourceIface *drsOps = NULL; + const struct DeviceResourceNode *node = null; + struct DeviceResourceIface *drsOps = null; int32_t ret; - if (device == NULL || configData == NULL) { - HDF_LOGE("EmmcFillConfigData: input para is NULL."); + if (device == null || configData == null) { + HDF_LOGE("EmmcFillConfigData: input para is null."); return HDF_FAILURE; } node = device->property; - if (node == NULL) { - HDF_LOGE("EmmcFillConfigData: drs node is NULL."); + if (node == null) { + HDF_LOGE("EmmcFillConfigData: drs node is null."); return HDF_FAILURE; } drsOps = DeviceResourceGetIfaceInstance(HDF_CONFIG_SOURCE); - if (drsOps == NULL || drsOps->GetUint32 == NULL) { - HDF_LOGE("EmmcFillConfigData: invalid drs ops fail!"); + if (drsOps == null || drsOps->GetUint32 == null) { + HDF_LOGE("EmmcFillConfigData: invalid drs ops failed"); return HDF_FAILURE; } ret = drsOps->GetUint32(node, "hostId", &(configData->hostId), 0); if (ret != HDF_SUCCESS) { - HDF_LOGE("EmmcFillConfigData: read funcNum fail!"); + HDF_LOGE("EmmcFillConfigData: read funcNum failed"); return ret; } - HDF_LOGD("EmmcFillConfigData: Success! hostId = %d.", configData->hostId); + HDF_LOGD("EmmcFillConfigData: Success! hostId = %u.", configData->hostId); return HDF_SUCCESS; } diff --git a/support/platform/src/emmc_if.c b/support/platform/src/emmc_if.c index 1010af751c8a2657b8926ef2ea7d43d57c5663b3..ed70d88c7ee53d588c77062f3c8a5e1e0f451203 100644 --- a/support/platform/src/emmc_if.c +++ b/support/platform/src/emmc_if.c @@ -6,12 +6,12 @@ * See the LICENSE file in the root of this repository for complete details. */ +#include "emmc_if.h" #include #ifndef __USER__ #include "devsvc_manager_clnt.h" #include "emmc_core.h" #endif -#include "emmc_if.h" #include "hdf_base.h" #ifdef __USER__ #include "hdf_io_service_if.h" @@ -96,16 +96,10 @@ static int32_t EmmcGetCidReadReplyData(struct HdfSBuf *reply, uint8_t *cid, uint uint32_t rLen; const void *rBuf = NULL; - if (HdfSbufReadBuffer(reply, &rBuf, &rLen) == false) { + if (!HdfSbufReadBuffer(reply, &rBuf, &rLen)) { HDF_LOGE("EmmcGetCidReadReplyData: read rBuf fail!"); return HDF_ERR_IO; } - if (size != rLen) { - HDF_LOGE("EmmcGetCidReadReplyData: err len:%u, rLen:%u", size, rLen); - if (rLen > size) { - rLen = size; - } - } if (memcpy_s(cid, size, rBuf, rLen) != EOK) { HDF_LOGE("EmmcGetCidReadReplyData: memcpy rBuf fail!"); @@ -115,7 +109,7 @@ static int32_t EmmcGetCidReadReplyData(struct HdfSBuf *reply, uint8_t *cid, uint return HDF_SUCCESS; } -int32_t EmmcServiceGetCid(struct HdfIoService *service, uint8_t *cid, uint32_t size) +static int32_t EmmcServiceGetCid(struct HdfIoService *service, uint8_t *cid, uint32_t size) { int32_t ret; struct HdfSBuf *reply = NULL; @@ -161,7 +155,7 @@ int32_t EmmcGetCid(DevHandle handle, uint8_t *cid, uint32_t size) } if (cid == NULL || size < EMMC_CID_LEN) { - HDF_LOGE("EmmcGetCid: error parms!"); + HDF_LOGE("EmmcGetCid: error params!"); return HDF_ERR_INVALID_PARAM; } #ifdef __USER__ @@ -176,7 +170,7 @@ void EmmcGetHuid(uint8_t *cid, uint32_t size) DevHandle handle = NULL; if (cid == NULL || size == 0) { - HDF_LOGE("EmmcGetUdid: error parms!"); + HDF_LOGE("EmmcGetUdid: error params!"); return; } if (memset_s(cid, sizeof(uint8_t) * size, 0, sizeof(uint8_t) * size) != EOK) { @@ -186,11 +180,11 @@ void EmmcGetHuid(uint8_t *cid, uint32_t size) handle = EmmcOpen(0); if (handle == NULL) { - HDF_LOGD("EmmcGetUdid: open fail, use default value!"); + HDF_LOGW("EmmcGetUdid: open fail, use default value!"); return; } if (EmmcGetCid(handle, cid, size) != HDF_SUCCESS) { - HDF_LOGD("EmmcGetUdid: get fail, use default value!"); + HDF_LOGW("EmmcGetUdid: get fail, use default value!"); } EmmcClose(handle); } diff --git a/support/platform/src/i2c_if.c b/support/platform/src/i2c_if.c index 2da224466a94bbfbd88feb78d8440177674ec21f..59665074332dc15e5edb4b2df987d5d4ae913414 100644 --- a/support/platform/src/i2c_if.c +++ b/support/platform/src/i2c_if.c @@ -267,7 +267,7 @@ int32_t I2cTransfer(DevHandle handle, struct I2cMsg *msgs, int16_t count) } if (msgs == NULL || count <= 0) { - HDF_LOGE("I2cTransfer: err parms! msgs:%s, count:%d", + HDF_LOGE("I2cTransfer: err params! msgs:%s, count:%d", (msgs == NULL) ? "0" : "x", count); return HDF_ERR_INVALID_PARAM; } diff --git a/support/platform/src/mipi_dsi_core.c b/support/platform/src/mipi_dsi_core.c index 0e2c74cb4e32862adfd7835da0a0e80e6eb52f13..6a6169351a017420469f32d9be1e5a4df50c5ee9 100644 --- a/support/platform/src/mipi_dsi_core.c +++ b/support/platform/src/mipi_dsi_core.c @@ -6,10 +6,10 @@ * See the LICENSE file in the root of this repository for complete details. */ -#include "osal_time.h" -#include "osal_mem.h" -#include "hdf_log.h" #include "mipi_dsi_core.h" +#include "hdf_log.h" +#include "osal_mem.h" +#include "osal_time.h" #define HDF_LOG_TAG mipi_dsi_core @@ -36,21 +36,21 @@ int32_t MipiDsiRegisterCntlr(struct MipiDsiCntlr *cntlr) return HDF_FAILURE; } -DevHandle MipiDsiOpen(uint8_t id) +DevHandle MipiDsiOpen(uint8_t number) { - if (id >= MAX_CNTLR_CNT) { - HDF_LOGE("id invalid"); + if (number >= MAX_CNTLR_CNT) { + HDF_LOGE("invalid number"); return NULL; } - if (g_mipiDsihandle[id].cntlr == NULL) { - HDF_LOGE("no mipi_dsi %d cntlr", id); + if (g_mipiDsihandle[number].cntlr == NULL) { + HDF_LOGE("no mipi_dsi %d cntlr", number); return NULL; } - if (OsalMutexLock(&(g_mipiDsihandle[id].lock)) != HDF_SUCCESS) { + if (OsalMutexLock(&(g_mipiDsihandle[number].lock)) != HDF_SUCCESS) { HDF_LOGE("mutex lock fail"); return NULL; } - return (DevHandle)(&(g_mipiDsihandle[id])); + return (DevHandle)(&(g_mipiDsihandle[number])); } void MipiDsiClose(DevHandle handle) @@ -64,7 +64,7 @@ void MipiDsiClose(DevHandle handle) static int32_t MipiDsiSetDevCfg(struct MipiDsiCntlr *cntlr) { - /* set controler config */ + /* set controller config */ if (cntlr->setCntlrCfg == NULL) { HDF_LOGE("setCntlrCfg is NULL"); return HDF_FAILURE; @@ -137,6 +137,7 @@ void MipiDsiSetLpMode(DevHandle handle) HDF_LOGI("toLp not support!"); } } + void MipiDsiSetHsMode(DevHandle handle) { struct MipiDsiCntlr *cntlr = NULL; @@ -151,6 +152,7 @@ void MipiDsiSetHsMode(DevHandle handle) HDF_LOGI("toHs not support!"); } } + void MipiDsiEnterUlps(DevHandle handle) { struct MipiDsiCntlr *cntlr = NULL; @@ -165,6 +167,7 @@ void MipiDsiEnterUlps(DevHandle handle) HDF_LOGI("enterUlps not support!"); } } + void MipiDsiExitUlps(DevHandle handle) { struct MipiDsiCntlr *cntlr = NULL; diff --git a/support/platform/src/rtc_base.c b/support/platform/src/rtc_base.c index 9b63c970b96b054057cda14d6a3b111acc0e3c8b..5e671ac0600b3f65e229b4c602295a4a07f0477b 100644 --- a/support/platform/src/rtc_base.c +++ b/support/platform/src/rtc_base.c @@ -6,9 +6,9 @@ * See the LICENSE file in the root of this repository for complete details. */ +#include "rtc_base.h" #include "hdf_log.h" #include "plat_log.h" -#include "rtc_base.h" #define HDF_LOG_TAG rtc_base @@ -21,7 +21,7 @@ uint8_t RtcGetMonthDays(const uint8_t isLeapYear, const uint8_t month) return 0; } - if (RTC_FEBRUARY == month) { + if (month == RTC_FEBRUARY) { days = RTC_TWO_MONTH_DAY + isLeapYear; } else { oddMonth = (month >= RTC_AUGUST) ? (month - RTC_UNIT_DIFF) : month; diff --git a/support/platform/src/rtc_core.c b/support/platform/src/rtc_core.c index 3df837d3ad4962f13c67512fe39500bbda03cf49..93ae217397c068091f61d1dd0039bc940e5dd852 100644 --- a/support/platform/src/rtc_core.c +++ b/support/platform/src/rtc_core.c @@ -6,9 +6,9 @@ * See the LICENSE file in the root of this repository for complete details. */ +#include "rtc_core.h" #include "hdf_log.h" #include "osal_mem.h" -#include "rtc_core.h" #define HDF_LOG_TAG rtc_core diff --git a/support/platform/src/rtc_if.c b/support/platform/src/rtc_if.c index 232126ca24eaf8cc02508ba9f4f0338299942258..140f3c3f968851596623ecd9eba8928e73d63b7f 100644 --- a/support/platform/src/rtc_if.c +++ b/support/platform/src/rtc_if.c @@ -6,13 +6,13 @@ * See the LICENSE file in the root of this repository for complete details. */ +#include "rtc_if.h" +#include "devsvc_manager_clnt.h" #include "hdf_base.h" #include "hdf_log.h" -#include "devsvc_manager_clnt.h" #include "osal_mem.h" #include "rtc_base.h" #include "rtc_core.h" -#include "rtc_if.h" #define HDF_LOG_TAG rtc_if diff --git a/support/platform/src/sdio_core.c b/support/platform/src/sdio_core.c index 990c460d6b6060f2b1ffbaaec2ad84e074a35f84..737480a90680ad34855101f0adfa59dcf3b284e8 100644 --- a/support/platform/src/sdio_core.c +++ b/support/platform/src/sdio_core.c @@ -6,10 +6,10 @@ * See the LICENSE file in the root of this repository for complete details. */ +#include "sdio_core.h" #include "device_resource_if.h" #include "osal_mem.h" #include "plat_log.h" -#include "sdio_core.h" #define HDF_LOG_TAG sdio_core diff --git a/support/platform/src/spi_if.c b/support/platform/src/spi_if.c index 45eb03af4252a9c81e92aa901c28384ee88e557b..4fb01a58d77979b33ac09bd76597599dff4994a7 100644 --- a/support/platform/src/spi_if.c +++ b/support/platform/src/spi_if.c @@ -6,12 +6,12 @@ * See the LICENSE file in the root of this repository for complete details. */ -#include "securec.h" +#include "spi_if.h" #include "devsvc_manager_clnt.h" #include "hdf_log.h" #include "osal_mem.h" +#include "securec.h" #include "spi_core.h" -#include "spi_if.h" #define HDF_LOG_TAG spi_if #define HOST_NAME_LEN 32 @@ -128,17 +128,19 @@ DevHandle SpiOpen(const struct SpiDevInfo *info) return NULL; } + object = (struct SpiObject *)OsalMemCalloc(sizeof(*object)); + if (object == NULL) { + HDF_LOGE("%s: object malloc error", __func__); + return NULL; + } + ret = SpiCntlrOpen(cntlr, info->csNum); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: SpiCntlrOpen error, ret is %d", __func__, ret); + OsalMemFree(object); return NULL; } - object = (struct SpiObject *)OsalMemCalloc(sizeof(*object)); - if (object == NULL) { - HDF_LOGE("%s: object malloc error", __func__); - return NULL; - } object->cntlr = cntlr; object->csNum = info->csNum; return (DevHandle)object; diff --git a/support/platform/src/uart_core.c b/support/platform/src/uart_core.c index 524ad61f9efcd51f789615520bb961f80221699d..71cfcb0501f1d31a32ee627c5e726c0ee4d5574a 100644 --- a/support/platform/src/uart_core.c +++ b/support/platform/src/uart_core.c @@ -154,7 +154,7 @@ static int32_t UartUserSetTransMode(struct UartHost *host, struct HdfSBuf *data) size_t size; enum UartTransMode *mode = NULL; - if (!HdfSbufReadBuffer(data, (const void **)&mode, &size)) { + if (!HdfSbufReadBuffer(data, (const void **)&mode, &size) || mode == NULL) { HDF_LOGE("%s: sbuf read buffer failed", __func__); return HDF_ERR_IO; } diff --git a/support/platform/src/uart_if.c b/support/platform/src/uart_if.c index 88b1dccb14588775b608f7931ef4ecc66ccbc1cf..b25b6a7c2760861e5d08a067c7f5b1bf0b13e463 100644 --- a/support/platform/src/uart_if.c +++ b/support/platform/src/uart_if.c @@ -6,6 +6,7 @@ * See the LICENSE file in the root of this repository for complete details. */ +#include "uart_if.h" #include "securec.h" #ifndef __USER__ #include "devsvc_manager_clnt.h" @@ -17,7 +18,6 @@ #ifndef __USER__ #include "uart_core.h" #endif -#include "uart_if.h" #define HDF_LOG_TAG uart_if_c #define UART_HOST_NAME_LEN 32 @@ -78,12 +78,14 @@ DevHandle UartOpen(uint32_t port) return NULL; } ret = service->dispatcher->Dispatch(&service->object, UART_IO_INIT, NULL, NULL); + if (ret != HDF_SUCCESS) { + UartPutObjByPointer(handle); + } #else ret = UartHostInit((struct UartHost *)handle); #endif if (ret != HDF_SUCCESS) { HDF_LOGE("%s: UartHostInit error, ret %d", __func__, ret); - UartPutObjByPointer(handle); return NULL; } @@ -106,13 +108,13 @@ void UartClose(DevHandle handle) return; } ret = service->dispatcher->Dispatch(&service->object, UART_IO_DEINIT, NULL, NULL); + UartPutObjByPointer(handle); #else ret = UartHostDeinit((struct UartHost *)handle); #endif if (ret != HDF_SUCCESS) { HDF_LOGE("%s: UartHostDeinit error, ret %d", __func__, ret); } - UartPutObjByPointer(handle); } #ifdef __USER__ diff --git a/support/platform/test/unittest/common/hdf_emmc_test.cpp b/support/platform/test/unittest/common/hdf_emmc_test.cpp index 9e1b51dd15b330c309aec7bd703ae4526b03f4dd..6231cdf2af576638c83da852591dde12c7104a7d 100644 --- a/support/platform/test/unittest/common/hdf_emmc_test.cpp +++ b/support/platform/test/unittest/common/hdf_emmc_test.cpp @@ -56,7 +56,7 @@ static void TestUserEmmcGetCid(void) EmmcGetHuid(cid, EMMC_CID_LEN); for (i = 0; i < EMMC_CID_LEN; i++) { - printf("user interface get cid[%d] = 0x%x\n", i, cid[i]); + printf("user interface get cid[%u] = 0x%x\n", i, cid[i]); } } @@ -66,7 +66,7 @@ static void TestUserEmmcGetCid(void) * @tc.type: FUNC * @tc.require: AR000F5LSD AR000F5LV3 */ -HWTEST_F(HdfLiteEmmcTest, EmmcGetCid001, TestSize.Level1) +HWTEST_F(HdfLiteEmmcTest, EmmcGetCid001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_EMMC_TYPE, EMMC_GET_CID_01, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); diff --git a/support/platform/test/unittest/common/hdf_gpio_test.cpp b/support/platform/test/unittest/common/hdf_gpio_test.cpp index f6800ef9684fb0fa279daff907256aea9edce7c1..7584fc1071e1c00e11b8220b2d84314943def59b 100644 --- a/support/platform/test/unittest/common/hdf_gpio_test.cpp +++ b/support/platform/test/unittest/common/hdf_gpio_test.cpp @@ -61,7 +61,7 @@ void HdfLiteGpioTest::TearDown() * @tc.type: FUNC * @tc.require: AR000F868H */ -HWTEST_F(HdfLiteGpioTest, GpioTestSetGetDir001, TestSize.Level1) +HWTEST_F(HdfLiteGpioTest, GpioTestSetGetDir001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_GPIO_TYPE, GPIO_TEST_SET_GET_DIR, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -73,7 +73,7 @@ HWTEST_F(HdfLiteGpioTest, GpioTestSetGetDir001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868H */ -HWTEST_F(HdfLiteGpioTest, GpioTestWriteRead001, TestSize.Level1) +HWTEST_F(HdfLiteGpioTest, GpioTestWriteRead001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_GPIO_TYPE, GPIO_TEST_WRITE_READ, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -85,7 +85,7 @@ HWTEST_F(HdfLiteGpioTest, GpioTestWriteRead001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868H */ -HWTEST_F(HdfLiteGpioTest, GpioTestIrqLevel001, TestSize.Level1) +HWTEST_F(HdfLiteGpioTest, GpioTestIrqLevel001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_GPIO_TYPE, GPIO_TEST_IRQ_LEVEL, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -97,7 +97,7 @@ HWTEST_F(HdfLiteGpioTest, GpioTestIrqLevel001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868H */ -HWTEST_F(HdfLiteGpioTest, GpioTestIrqEdge001, TestSize.Level1) +HWTEST_F(HdfLiteGpioTest, GpioTestIrqEdge001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_GPIO_TYPE, GPIO_TEST_IRQ_EDGE, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -109,7 +109,7 @@ HWTEST_F(HdfLiteGpioTest, GpioTestIrqEdge001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868H */ -HWTEST_F(HdfLiteGpioTest, GpioTestIrqThread001, TestSize.Level1) +HWTEST_F(HdfLiteGpioTest, GpioTestIrqThread001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_GPIO_TYPE, GPIO_TEST_IRQ_THREAD, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -121,7 +121,7 @@ HWTEST_F(HdfLiteGpioTest, GpioTestIrqThread001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868H */ -HWTEST_F(HdfLiteGpioTest, GpioTestReliability001, TestSize.Level1) +HWTEST_F(HdfLiteGpioTest, GpioTestReliability001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_GPIO_TYPE, GPIO_TEST_RELIABILITY, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); diff --git a/support/platform/test/unittest/common/hdf_i2c_test.cpp b/support/platform/test/unittest/common/hdf_i2c_test.cpp index 05a5f15fbf08a26cc733ad6df1697d126bd549fc..3bc5b21ef300017ecc812627c747cb4755aa228a 100644 --- a/support/platform/test/unittest/common/hdf_i2c_test.cpp +++ b/support/platform/test/unittest/common/hdf_i2c_test.cpp @@ -69,7 +69,7 @@ void HdfLiteI2cTest::TearDown() * @tc.type: FUNC * @tc.require: AR000F8688 */ -HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestTransfer001, TestSize.Level1) +HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestTransfer001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_I2C_TYPE, I2C_TEST_CMD_TRANSFER, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -84,7 +84,7 @@ HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestTransfer001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8688 */ -HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestWriteRead001, TestSize.Level1) +HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestWriteRead001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_I2C_TYPE, I2C_TEST_CMD_WRITE_READ, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -99,7 +99,7 @@ HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestWriteRead001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8688 */ -HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestMultiThread001, TestSize.Level1) +HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestMultiThread001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_I2C_TYPE, I2C_TEST_CMD_MULTI_THREAD, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -114,7 +114,7 @@ HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestMultiThread001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8688 */ -HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestReliability001, TestSize.Level1) +HWTEST_F(HdfLiteI2cTest, HdfLiteI2cTestReliability001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_I2C_TYPE, I2C_TEST_CMD_RELIABILITY, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); diff --git a/support/platform/test/unittest/common/hdf_mipi_dsi_test.cpp b/support/platform/test/unittest/common/hdf_mipi_dsi_test.cpp index 4f394ec3895b9b9378acc3ec26ef378aa6688187..db7e2bf6811a74ce5cd53f83352bcee38be3936c 100644 --- a/support/platform/test/unittest/common/hdf_mipi_dsi_test.cpp +++ b/support/platform/test/unittest/common/hdf_mipi_dsi_test.cpp @@ -67,7 +67,7 @@ static void MipiDsiTest(enum MipiDsiTestCmd cmd) * @tc.type: FUNC * @tc.require: AR000F868F */ -HWTEST_F(HdfLiteMipiDsiTest, MipiDsiSetCfgTest001, TestSize.Level1) +HWTEST_F(HdfLiteMipiDsiTest, MipiDsiSetCfgTest001, TestSize.Level0) { MipiDsiTest(MIPI_DSI_TEST_SET_CFG); } @@ -78,7 +78,7 @@ HWTEST_F(HdfLiteMipiDsiTest, MipiDsiSetCfgTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868F */ -HWTEST_F(HdfLiteMipiDsiTest, MipiDsiGetCfgTest001, TestSize.Level1) +HWTEST_F(HdfLiteMipiDsiTest, MipiDsiGetCfgTest001, TestSize.Level0) { MipiDsiTest(MIPI_DSI_TEST_GET_CFG); } @@ -89,7 +89,7 @@ HWTEST_F(HdfLiteMipiDsiTest, MipiDsiGetCfgTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868F */ -HWTEST_F(HdfLiteMipiDsiTest, MipiDsiTxRxTest001, TestSize.Level1) +HWTEST_F(HdfLiteMipiDsiTest, MipiDsiTxRxTest001, TestSize.Level0) { MipiDsiTest(MIPI_DSI_TEST_TX_RX); } @@ -100,7 +100,7 @@ HWTEST_F(HdfLiteMipiDsiTest, MipiDsiTxRxTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868F */ -HWTEST_F(HdfLiteMipiDsiTest, MipiDsiLpHsTest001, TestSize.Level1) +HWTEST_F(HdfLiteMipiDsiTest, MipiDsiLpHsTest001, TestSize.Level0) { MipiDsiTest(MIPI_DSI_TEST_TO_LP_TO_HS); } diff --git a/support/platform/test/unittest/common/hdf_pwm_test.cpp b/support/platform/test/unittest/common/hdf_pwm_test.cpp index 3a439a5eacf35a633739fab2eb4f7a8bad25f16e..bf8d33b5c68f3df0e0e4abd6a978447a40437f88 100644 --- a/support/platform/test/unittest/common/hdf_pwm_test.cpp +++ b/support/platform/test/unittest/common/hdf_pwm_test.cpp @@ -61,7 +61,7 @@ void HdfLitePwmTest::TearDown() * @tc.type: FUNC * @tc.require: AR000F868C */ -HWTEST_F(HdfLitePwmTest, PwmSetPeriodTest001, TestSize.Level1) +HWTEST_F(HdfLitePwmTest, PwmSetPeriodTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_PWM_TYPE, PWM_SET_PERIOD_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -73,7 +73,7 @@ HWTEST_F(HdfLitePwmTest, PwmSetPeriodTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868C */ -HWTEST_F(HdfLitePwmTest, PwmSetDutyTest001, TestSize.Level1) +HWTEST_F(HdfLitePwmTest, PwmSetDutyTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_PWM_TYPE, PWM_SET_DUTY_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -85,7 +85,7 @@ HWTEST_F(HdfLitePwmTest, PwmSetDutyTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868C */ -HWTEST_F(HdfLitePwmTest, PwmSetPolarityTest001, TestSize.Level1) +HWTEST_F(HdfLitePwmTest, PwmSetPolarityTest001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_PWM_TYPE, PWM_SET_POLARITY_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -97,7 +97,7 @@ HWTEST_F(HdfLitePwmTest, PwmSetPolarityTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868D */ -HWTEST_F(HdfLitePwmTest, PwmSetConfigTest001, TestSize.Level1) +HWTEST_F(HdfLitePwmTest, PwmSetConfigTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_PWM_TYPE, PWM_SET_CONFIG_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -109,7 +109,7 @@ HWTEST_F(HdfLitePwmTest, PwmSetConfigTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868D */ -HWTEST_F(HdfLitePwmTest, PwmGetConfigTest001, TestSize.Level1) +HWTEST_F(HdfLitePwmTest, PwmGetConfigTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_PWM_TYPE, PWM_GET_CONFIG_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -121,7 +121,7 @@ HWTEST_F(HdfLitePwmTest, PwmGetConfigTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868D */ -HWTEST_F(HdfLitePwmTest, PwmEnableTest001, TestSize.Level1) +HWTEST_F(HdfLitePwmTest, PwmEnableTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_PWM_TYPE, PWM_ENABLE_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -133,7 +133,7 @@ HWTEST_F(HdfLitePwmTest, PwmEnableTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868D */ -HWTEST_F(HdfLitePwmTest, PwmDisableTest001, TestSize.Level1) +HWTEST_F(HdfLitePwmTest, PwmDisableTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_PWM_TYPE, PWM_DISABLE_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); diff --git a/support/platform/test/unittest/common/hdf_rtc_test.cpp b/support/platform/test/unittest/common/hdf_rtc_test.cpp index f6d326292883afa31580a399b990e7d2426e0605..f55ae56561fcefb07db3122f7daa89c642b1298e 100644 --- a/support/platform/test/unittest/common/hdf_rtc_test.cpp +++ b/support/platform/test/unittest/common/hdf_rtc_test.cpp @@ -78,7 +78,7 @@ void HdfRtcTest::TearDown() * @tc.type: FUNC * @tc.require: AR000F868I */ -HWTEST_F(HdfRtcTest, testRtcReadWriteTime001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcReadWriteTime001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_TIME, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -90,7 +90,7 @@ HWTEST_F(HdfRtcTest, testRtcReadWriteTime001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868I */ -HWTEST_F(HdfRtcTest, testRtcReadWriteMaxTime001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcReadWriteMaxTime001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_MAX_TIME, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -102,7 +102,7 @@ HWTEST_F(HdfRtcTest, testRtcReadWriteMaxTime001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868I */ -HWTEST_F(HdfRtcTest, testRtcReadWriteMinTime001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcReadWriteMinTime001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_MIN_TIME, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -114,7 +114,7 @@ HWTEST_F(HdfRtcTest, testRtcReadWriteMinTime001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868I */ -HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmTime001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmTime001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_ALARM_TIME, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -126,7 +126,7 @@ HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmTime001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868I */ -HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmMaxTime001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmMaxTime001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_ALARM_MAX_TIME, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -137,7 +137,7 @@ HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmMaxTime001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868I */ -HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmMinTime001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmMinTime001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_ALARM_MIN_TIME, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -150,7 +150,7 @@ HWTEST_F(HdfRtcTest, testRtcReadWriteAlarmMinTime001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868I */ -HWTEST_F(HdfRtcTest, testRtcAlarmEnable001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcAlarmEnable001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_ALARM_ENABLE, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -164,7 +164,7 @@ HWTEST_F(HdfRtcTest, testRtcAlarmEnable001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcAlarmIqr001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcAlarmIqr001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_ALARM_IRQ, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -176,7 +176,7 @@ HWTEST_F(HdfRtcTest, testRtcAlarmIqr001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcRegCallback001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcRegCallback001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_REGISTER_CALLBACK, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -188,7 +188,7 @@ HWTEST_F(HdfRtcTest, testRtcRegCallback001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcRegCallbackNull001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcRegCallbackNull001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_REGISTER_CALLBACK_NULL, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -200,7 +200,7 @@ HWTEST_F(HdfRtcTest, testRtcRegCallbackNull001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcFreq001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcFreq001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_FREQ, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -212,7 +212,7 @@ HWTEST_F(HdfRtcTest, testRtcFreq001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcMaxFreq001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcMaxFreq001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_MAX_FREQ, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -224,7 +224,7 @@ HWTEST_F(HdfRtcTest, testRtcMaxFreq001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcMinFreq001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcMinFreq001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_MIN_FREQ, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -236,7 +236,7 @@ HWTEST_F(HdfRtcTest, testRtcMinFreq001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcUserReg001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcUserReg001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_USER_REG, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -248,7 +248,7 @@ HWTEST_F(HdfRtcTest, testRtcUserReg001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcUserRegMaxIndex001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcUserRegMaxIndex001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_USER_REG_MAX_INDEX, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -260,7 +260,7 @@ HWTEST_F(HdfRtcTest, testRtcUserRegMaxIndex001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcReliability001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcReliability001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_WR_RELIABILITY, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -273,7 +273,7 @@ HWTEST_F(HdfRtcTest, testRtcReliability001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000EKRKU */ -HWTEST_F(HdfRtcTest, testRtcModule001, TestSize.Level1) +HWTEST_F(HdfRtcTest, testRtcModule001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_RTC_TYPE, RTC_FUNCTION_TEST, -1 }; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); diff --git a/support/platform/test/unittest/common/hdf_sdio_test.cpp b/support/platform/test/unittest/common/hdf_sdio_test.cpp index 8fa564b3bc6b4a2a921f50c82de7f9f5bf6822c6..c2ae82dc5c7dfaa3fcd0fb8561592d1bc5a9a2c8 100644 --- a/support/platform/test/unittest/common/hdf_sdio_test.cpp +++ b/support/platform/test/unittest/common/hdf_sdio_test.cpp @@ -60,7 +60,7 @@ void HdfLiteSdioTest::TearDown() * @tc.type: FUNC * @tc.require: AR000F868B */ -HWTEST_F(HdfLiteSdioTest, SdioDisableFunc001, TestSize.Level1) +HWTEST_F(HdfLiteSdioTest, SdioDisableFunc001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SDIO_TYPE, SDIO_DISABLE_FUNC_01, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -72,7 +72,7 @@ HWTEST_F(HdfLiteSdioTest, SdioDisableFunc001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868B */ -HWTEST_F(HdfLiteSdioTest, SdioEnableFunc001, TestSize.Level1) +HWTEST_F(HdfLiteSdioTest, SdioEnableFunc001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SDIO_TYPE, SDIO_ENABLE_FUNC_01, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -84,7 +84,7 @@ HWTEST_F(HdfLiteSdioTest, SdioEnableFunc001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868B */ -HWTEST_F(HdfLiteSdioTest, SdioSetBlockSize001, TestSize.Level1) +HWTEST_F(HdfLiteSdioTest, SdioSetBlockSize001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SDIO_TYPE, SDIO_SET_BLOCK_SIZE_01, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -96,7 +96,7 @@ HWTEST_F(HdfLiteSdioTest, SdioSetBlockSize001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868B */ -HWTEST_F(HdfLiteSdioTest, SdioIncrAddrReadAndWriteBytes001, TestSize.Level1) +HWTEST_F(HdfLiteSdioTest, SdioIncrAddrReadAndWriteBytes001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SDIO_TYPE, SDIO_INCR_ADDR_READ_AND_WRITE_BYTES_01, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -108,7 +108,7 @@ HWTEST_F(HdfLiteSdioTest, SdioIncrAddrReadAndWriteBytes001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868B */ -HWTEST_F(HdfLiteSdioTest, SdioFixedAddrReadAndWriteBytes001, TestSize.Level1) +HWTEST_F(HdfLiteSdioTest, SdioFixedAddrReadAndWriteBytes001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SDIO_TYPE, SDIO_FIXED_ADDR_READ_AND_WRITE_BYTES_01, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -120,7 +120,7 @@ HWTEST_F(HdfLiteSdioTest, SdioFixedAddrReadAndWriteBytes001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868B */ -HWTEST_F(HdfLiteSdioTest, SdioFunc0ReadAndWriteBytes001, TestSize.Level1) +HWTEST_F(HdfLiteSdioTest, SdioFunc0ReadAndWriteBytes001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_SDIO_TYPE, SDIO_FUNC0_READ_AND_WRITE_BYTES_01, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -132,7 +132,7 @@ HWTEST_F(HdfLiteSdioTest, SdioFunc0ReadAndWriteBytes001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868B */ -HWTEST_F(HdfLiteSdioTest, SdioSetAndGetCommonInfo001, TestSize.Level1) +HWTEST_F(HdfLiteSdioTest, SdioSetAndGetCommonInfo001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SDIO_TYPE, SDIO_SET_AND_GET_COMMON_INFO_01, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); diff --git a/support/platform/test/unittest/common/hdf_spi_test.cpp b/support/platform/test/unittest/common/hdf_spi_test.cpp index 1a9eef0f34ef45667c905de3da704c9966850bcf..7f4fd3f94613c57bfbed830d03de3a72098740ce 100644 --- a/support/platform/test/unittest/common/hdf_spi_test.cpp +++ b/support/platform/test/unittest/common/hdf_spi_test.cpp @@ -60,7 +60,7 @@ void HdfLiteSpiTest::TearDown() * @tc.type: FUNC * @tc.require: SR000DQ0VO */ -HWTEST_F(HdfLiteSpiTest, SpiSetCfgTest001, TestSize.Level1) +HWTEST_F(HdfLiteSpiTest, SpiSetCfgTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SPI_TYPE, SPI_SET_CFG_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -72,7 +72,7 @@ HWTEST_F(HdfLiteSpiTest, SpiSetCfgTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: SR000DQ0VO */ -HWTEST_F(HdfLiteSpiTest, SpiTransferTest001, TestSize.Level1) +HWTEST_F(HdfLiteSpiTest, SpiTransferTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SPI_TYPE, SPI_TRANSFER_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -84,7 +84,7 @@ HWTEST_F(HdfLiteSpiTest, SpiTransferTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: SR000DQ0VO */ -HWTEST_F(HdfLiteSpiTest, SpiWriteTest001, TestSize.Level1) +HWTEST_F(HdfLiteSpiTest, SpiWriteTest001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_SPI_TYPE, SPI_WRITE_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -96,7 +96,7 @@ HWTEST_F(HdfLiteSpiTest, SpiWriteTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: SR000DQ0VO */ -HWTEST_F(HdfLiteSpiTest, SpiReadTest001, TestSize.Level1) +HWTEST_F(HdfLiteSpiTest, SpiReadTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SPI_TYPE, SPI_READ_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -108,7 +108,7 @@ HWTEST_F(HdfLiteSpiTest, SpiReadTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: SR000DQ0VO */ -HWTEST_F(HdfLiteSpiTest, SpiReliabilityTest001, TestSize.Level1) +HWTEST_F(HdfLiteSpiTest, SpiReliabilityTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_SPI_TYPE, SPI_RELIABILITY_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); diff --git a/support/platform/test/unittest/common/hdf_uart_test.cpp b/support/platform/test/unittest/common/hdf_uart_test.cpp index 083b0ea7c179268bcb19bf99b6c8c67fb97acbe2..f12a6b5e28b645a2d64daac7ff3572d7ef4cf26c 100644 --- a/support/platform/test/unittest/common/hdf_uart_test.cpp +++ b/support/platform/test/unittest/common/hdf_uart_test.cpp @@ -66,7 +66,7 @@ void HdfLiteUartTest::TearDown() * @tc.type: FUNC * @tc.require: AR000F8689 */ -HWTEST_F(HdfLiteUartTest, UartSetTransModeTest001, TestSize.Level1) +HWTEST_F(HdfLiteUartTest, UartSetTransModeTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_UART_TYPE, UART_SET_TRANSMODE_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -79,7 +79,7 @@ HWTEST_F(HdfLiteUartTest, UartSetTransModeTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8689 */ -HWTEST_F(HdfLiteUartTest, UartWriteTest001, TestSize.Level1) +HWTEST_F(HdfLiteUartTest, UartWriteTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_UART_TYPE, UAER_WRITE_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -91,7 +91,7 @@ HWTEST_F(HdfLiteUartTest, UartWriteTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8689 */ -HWTEST_F(HdfLiteUartTest, UartReadTest001, TestSize.Level1) +HWTEST_F(HdfLiteUartTest, UartReadTest001, TestSize.Level0) { struct HdfTestMsg msg = { TEST_PAL_UART_TYPE, UART_READ_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -103,7 +103,7 @@ HWTEST_F(HdfLiteUartTest, UartReadTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8689 */ -HWTEST_F(HdfLiteUartTest, UartSetBaudTest001, TestSize.Level1) +HWTEST_F(HdfLiteUartTest, UartSetBaudTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_UART_TYPE, UART_SET_BAUD_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -115,7 +115,7 @@ HWTEST_F(HdfLiteUartTest, UartSetBaudTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8689 */ -HWTEST_F(HdfLiteUartTest, UartGetBaudTest001, TestSize.Level1) +HWTEST_F(HdfLiteUartTest, UartGetBaudTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_UART_TYPE, UART_GET_BAUD_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -127,7 +127,7 @@ HWTEST_F(HdfLiteUartTest, UartGetBaudTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8689 */ -HWTEST_F(HdfLiteUartTest, UartSetAttributeTest001, TestSize.Level1) +HWTEST_F(HdfLiteUartTest, UartSetAttributeTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_UART_TYPE, UART_SET_ATTRIBUTE_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -139,7 +139,7 @@ HWTEST_F(HdfLiteUartTest, UartSetAttributeTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8689 */ -HWTEST_F(HdfLiteUartTest, UartGetAttributeTest001, TestSize.Level1) +HWTEST_F(HdfLiteUartTest, UartGetAttributeTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_UART_TYPE, UART_GET_ATTRIBUTE_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -151,7 +151,7 @@ HWTEST_F(HdfLiteUartTest, UartGetAttributeTest001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F8689 */ -HWTEST_F(HdfLiteUartTest, UartReliabilityTest001, TestSize.Level1) +HWTEST_F(HdfLiteUartTest, UartReliabilityTest001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_UART_TYPE, UART_RELIABILITY_TEST, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); diff --git a/support/platform/test/unittest/common/hdf_watchdog_test.cpp b/support/platform/test/unittest/common/hdf_watchdog_test.cpp index 201c8cbc510c68fc91aa0d8a27605470b58433ea..6b6f8061b061a08685b4783883c83de5be0c4a88 100644 --- a/support/platform/test/unittest/common/hdf_watchdog_test.cpp +++ b/support/platform/test/unittest/common/hdf_watchdog_test.cpp @@ -60,7 +60,7 @@ void HdfLiteWatchdogTest::TearDown() * @tc.type: FUNC * @tc.require: AR000F868G */ -HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestSetGetTimeout001, TestSize.Level1) +HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestSetGetTimeout001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_WDT_TYPE, WATCHDOG_TEST_SET_GET_TIMEOUT, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -72,7 +72,7 @@ HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestSetGetTimeout001, TestSize.Leve * @tc.type: FUNC * @tc.require: AR000F868G */ -HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestStartStop001, TestSize.Level1) +HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestStartStop001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_WDT_TYPE, WATCHDOG_TEST_START_STOP, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -84,7 +84,7 @@ HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestStartStop001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868G */ -HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestFeed001, TestSize.Level1) +HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestFeed001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_WDT_TYPE, WATCHDOG_TEST_FEED, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); @@ -96,7 +96,7 @@ HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestFeed001, TestSize.Level1) * @tc.type: FUNC * @tc.require: AR000F868G */ -HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestReliability001, TestSize.Level1) +HWTEST_F(HdfLiteWatchdogTest, HdfLiteWatchdogTestReliability001, TestSize.Level0) { struct HdfTestMsg msg = {TEST_PAL_WDT_TYPE, WATCHDOG_TEST_RELIABILITY, -1}; EXPECT_EQ(0, HdfTestSendMsgToService(&msg));