diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index e3510e686f0e58fa76873af77cb4e900dcb7aafa..bfa6e612fb42c71b05780d389648c999149379f1 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -768,11 +768,12 @@ static int32_t WifiCmdSendAction(const RequestContext *context, struct HdfSBuf * static int32_t WifiCmdGetNetworkInfo(const RequestContext *context, struct HdfSBuf *reqData, struct HdfSBuf *rspData) { - (void)context; - (void)reqData; - uint32_t netDevNum = 1; + uint32_t netDevNum; char *defaultIfName = "wlan0"; uint8_t supportMode[PROTOCOL_80211_IFTYPE_NUM] = {0}; + netDevNum = 1; + (void)context; + (void)reqData; if (!HdfSbufWriteUint32(rspData, netDevNum)) { HDF_LOGE("%s: %s!", __func__, ERROR_DESC_WRITE_RSP_FAILED); @@ -808,8 +809,8 @@ static int32_t WifiCmdIsSupportCombo(const RequestContext *context, struct HdfSB static int32_t WifiCmdGetSupportCombo(const RequestContext *context, struct HdfSBuf *reqData, struct HdfSBuf *rspData) { - (void)context; uint8_t isComboValid; + (void)context; if (reqData == NULL || rspData == NULL) { return HDF_ERR_INVALID_PARAM; } @@ -1265,13 +1266,13 @@ static uint32_t GetIftype(struct NetDevice *netdev, uint8_t *iftype) #define MAX_NETDEVICE_COUNT 20 static int32_t WifiCmdGetNetDevInfo(const RequestContext *context, struct HdfSBuf *reqData, struct HdfSBuf *rspData) { - (void)context; - (void)reqData; uint32_t i; uint32_t netdevNum; uint8_t iftype; struct NetDevice *netDev = NULL; - + (void)context; + (void)reqData; + netdevNum = NetDevGetRegisterCount(); if (!HdfSbufWriteUint32(rspData, netdevNum)) { HDF_LOGE("%s: %s!", __func__, ERROR_DESC_WRITE_RSP_FAILED); diff --git a/model/network/wifi/platform/src/message/message_dispatcher.c b/model/network/wifi/platform/src/message/message_dispatcher.c index c3bbc95b3561263200d89d8048708c7643a29347..9231270ded554e4c8f603bc912c0074811a49d0b 100644 --- a/model/network/wifi/platform/src/message/message_dispatcher.c +++ b/model/network/wifi/platform/src/message/message_dispatcher.c @@ -281,7 +281,7 @@ static ErrorCode StartDispatcher(MessageDispatcher *dispatcher) HDF_STATUS status; ErrorCode errCode; LocalMessageDispatcher *localDispatcher = NULL; - + struct OsalThreadParam config; if (dispatcher == NULL) { return ME_ERROR_NULL_PTR; } @@ -298,11 +298,9 @@ static ErrorCode StartDispatcher(MessageDispatcher *dispatcher) break; } dispatcher->status = ME_STATUS_STARTTING; - struct OsalThreadParam config = { - .name = "MessageDispatcher", - .priority = OSAL_THREAD_PRI_DEFAULT, - .stackSize = 0x2000, - }; + config.name = "MessageDispatcher"; + config.priority = OSAL_THREAD_PRI_DEFAULT; + config.stackSize = 0x2000; localDispatcher = (LocalMessageDispatcher *)dispatcher; status = OsalThreadCreate(&localDispatcher->dispatcherThread, RunDispatcher, localDispatcher); if (status != HDF_SUCCESS) { diff --git a/model/network/wifi/platform/src/message/message_router.c b/model/network/wifi/platform/src/message/message_router.c index 0c0b6e9c4be4ec9da93a3091ace2e730959606e0..17e295e1c007cda2d88f59ed725279bd87762d93 100644 --- a/model/network/wifi/platform/src/message/message_router.c +++ b/model/network/wifi/platform/src/message/message_router.c @@ -682,9 +682,9 @@ static ErrorCode DoShutdownMessageRouter(void) ErrorCode ShutdownMessageRouter() { - HDF_LOGW("%s:Shutdown router...", __func__); HDF_STATUS status; ErrorCode errCode; + HDF_LOGW("%s:Shutdown router...", __func__); status = OsalMutexTimedLock(&g_routerMutex, HDF_WAIT_FOREVER); if (status != HDF_SUCCESS) { HDF_LOGE("Unable to get lock!status=%d", status); diff --git a/model/network/wifi/platform/src/message/nodes/local_node.c b/model/network/wifi/platform/src/message/nodes/local_node.c index 506d9f890529cf3546d3ef1123eff26485a0799b..24b856024f6c57a0a124d6a5229912bc70a3fa6a 100644 --- a/model/network/wifi/platform/src/message/nodes/local_node.c +++ b/model/network/wifi/platform/src/message/nodes/local_node.c @@ -34,6 +34,7 @@ static void HandleRequestMessage(const RemoteService *service, MessageContext *c LocalNodeService *localNodeService = NULL; localNodeService = (LocalNodeService *)service; struct MessageDef messageDef = { NULL, 0 }; + if (context == NULL || service == NULL) { HDF_LOGE("%s:input is NULL", __func__); return; @@ -50,8 +51,8 @@ static void HandleRequestMessage(const RemoteService *service, MessageContext *c static void HandleResponseMessage(const RemoteService *service, MessageContext *context) { - (void)service; HDF_STATUS status; + (void)service; if (context->requestType < MESSAGE_RSP_START) { return; } @@ -135,8 +136,8 @@ static void DestroyLocalNodeRemoteService(RemoteService *service) RemoteService *CreateLocalNodeService(MessageNode *node, MessageDispatcher *dispatcher, struct ServiceDef *mapper) { LocalNodeService *service = NULL; - (void)node; ErrorCode errCode; + (void)node; if (mapper == NULL) { return NULL; } diff --git a/test/unittest/model/network/wifi/unittest/message/hdf_queue_test.c b/test/unittest/model/network/wifi/unittest/message/hdf_queue_test.c index feee6d0e8a4a661dabe979bc0fef565271f0210a..af57a8ed13df3c36b26db2b59dad163e111d206f 100644 --- a/test/unittest/model/network/wifi/unittest/message/hdf_queue_test.c +++ b/test/unittest/model/network/wifi/unittest/message/hdf_queue_test.c @@ -136,19 +136,18 @@ int32_t MessageQueueTest003(void) void *p = NULL; PriorityQueue *queue = NULL; int32_t status; + struct OsalThreadParam config; + OSAL_DECLARE_THREAD(pushThread); queue = CreatePriorityQueue(TEST_QUEUE_SIZE, NO_PRIORITY); if (queue == NULL) { HDF_LOGE("%s:Create queue failed!", __func__); return -1; } - OSAL_DECLARE_THREAD(pushThread); + do { - struct OsalThreadParam config = { - .name = "PushQueueWithDelay", - .priority = OSAL_THREAD_PRI_DEFAULT, - .stackSize = 0x1000, - }; - + config.name = "PushQueueWithDelay"; + config.priority = OSAL_THREAD_PRI_DEFAULT; + config.stackSize = 0x1000; status = OsalThreadCreate(&pushThread, RunPushQueue, queue); if (status != HDF_SUCCESS) { HDF_LOGE("%s:OsalThreadCreate failed!status=%d", __func__, status);