fix: clear codex in framework

Signed-off-by: YOUR_NAME <guodongqi2@huawei.com>
This commit is contained in:
YOUR_NAME
2021-12-06 17:03:20 +08:00
parent 5e985c00ef
commit bb3a4e7ea1
11 changed files with 29 additions and 25 deletions
+1 -8
View File
@@ -8,16 +8,9 @@
#include "hdf_attribute_manager.h"
#include "devhost_service_clnt.h"
#include "devmgr_service.h"
#include "hcs_blob_if.h"
#include "hcs_parser.h"
#include "hcs_tree_if.h"
#include "hdf_base.h"
#include "hdf_device_info.h"
#include "hdf_host_info.h"
#include "hdf_log.h"
#include "osal_mem.h"
#include "securec.h"
#ifdef LOSCFG_DRIVERS_HDF_USB_PNP_NOTIFY
#include "usb_pnp_manager.h"
#endif
@@ -243,4 +236,4 @@ int HdfAttributeManagerGetDeviceList(struct DevHostServiceClnt *hostClnt)
}
return HDF_SUCCESS;
}
}
-4
View File
@@ -7,10 +7,6 @@
*/
#include "devsvc_manager_clnt.h"
#include "devmgr_service.h"
#include "devsvc_manager.h"
#include "hdf_attribute_manager.h"
#include "hdf_base.h"
#include "hdf_log.h"
#include "hdf_object_manager.h"
+1 -1
View File
@@ -31,7 +31,7 @@ static int HdfDeviceAttach(struct IHdfDevice *devInst, struct HdfDeviceNode *dev
// for dynamic added device node, assign device id here
if (devNode->devId == 0) {
devNode->devId = MK_DEVID(HOSTID(device->deviceId), DEVICEID(device->deviceId),
DlistGetCount(&device->devNodes));
(uint32_t)DlistGetCount(&device->devNodes));
devNode->token->devid = devNode->devId;
}
+3 -1
View File
@@ -190,7 +190,9 @@ int HdfDeviceObjectRegister(struct HdfDeviceObject *dev)
struct HdfDeviceNode *devNode = CONTAINER_OF(dev, struct HdfDeviceNode, deviceObject);
struct IDriverLoader *driverLoader = HdfDriverLoaderGetInstance();
if (dev == NULL || devNode->driverName == NULL || devNode->device == NULL) {
if (dev == NULL || devNode->driverName == NULL || devNode->device == NULL || driverLoader == NULL ||
driverLoader->GetDriver == NULL) {
HDF_LOGE("failed to add device, param invalid");
return HDF_ERR_INVALID_PARAM;
}
-1
View File
@@ -19,7 +19,6 @@ int32_t HdfDriverEntryConstruct()
struct HdfDriverEntry *driverEntry = NULL;
size_t *addrBegin = NULL;
int32_t count = (int32_t)(((uint8_t *)(HDF_DRIVER_END()) - (uint8_t *)(HDF_DRIVER_BEGIN())) / sizeof(size_t));
if (count <= 0) {
HDF_LOGE("%s: no hdf driver exist", __func__);
return HDF_FAILURE;
+6 -1
View File
@@ -267,6 +267,7 @@ static int DevmgrServiceStartDeviceHost(struct DevmgrService *devmgr, struct Hdf
static int DevmgrServiceStartDeviceHosts(struct DevmgrService *inst)
{
uint32_t ret;
struct HdfSList hostList;
struct HdfSListIterator it;
struct HdfHostInfo *hostAttr = NULL;
@@ -279,7 +280,11 @@ static int DevmgrServiceStartDeviceHosts(struct DevmgrService *inst)
HdfSListIteratorInit(&it, &hostList);
while (HdfSListIteratorHasNext(&it)) {
hostAttr = (struct HdfHostInfo *)HdfSListIteratorNext(&it);
DevmgrServiceStartDeviceHost(inst, hostAttr);
ret = DevmgrServiceStartDeviceHost(inst, hostAttr);
if (ret != HDF_SUCCESS) {
HDF_LOGW("%s failed to start device host, host id is %u, host name is '%s'",
__func__, hostAttr->hostId, hostAttr->hostName);
}
}
HdfSListFlush(&hostList, HdfHostInfoDelete);
return HDF_SUCCESS;
+1 -1
View File
@@ -66,7 +66,7 @@ int DevSvcManagerAddService(struct IDevSvcManager *inst, const char *svcName, st
int DevSvcManagerSubscribeService(struct IDevSvcManager *inst, const char *svcName, struct SubscriberCallback callBack)
{
struct DevmgrService *devMgrSvc = (struct DevmgrService *)DevmgrServiceGetInstance();;
struct DevmgrService *devMgrSvc = (struct DevmgrService *)DevmgrServiceGetInstance();
struct HdfObject *deviceService = NULL;
if (inst == NULL || svcName == NULL || devMgrSvc == NULL) {
return HDF_FAILURE;
-2
View File
@@ -6,10 +6,8 @@
* See the LICENSE file in the root of this repository for complete details.
*/
#include "hdf_attribute_manager.h"
#include "hdf_driver_installer.h"
#include "devhost_service.h"
#include "hdf_base.h"
#include "hdf_log.h"
#include "hdf_object_manager.h"
+3 -1
View File
@@ -11,6 +11,7 @@
#include "hdf_device_object.h"
#include "hdf_log.h"
#include "hdf_pm.h"
#include "osal_file.h"
#include "osal_mem.h"
#define HDF_LOG_TAG sample_driver_test
@@ -97,7 +98,8 @@ int32_t SampleDriverRegisterDevice(struct HdfDeviceObject *dev, struct HdfSBuf *
return HDF_FAILURE;
}
ret = HdfDeviceObjectPublishService(devObj, serviceName, SERVICE_POLICY_CAPACITY, 0664);
ret = HdfDeviceObjectPublishService(devObj, serviceName, SERVICE_POLICY_CAPACITY,
OSAL_S_IREAD | OSAL_S_IWRITE | OSAL_S_IRGRP | OSAL_S_IWGRP | OSAL_S_IROTH);
if (ret != HDF_SUCCESS) {
HDF_LOGE("faild to publish service for %s", serviceName);
HdfDeviceObjectRelease(devObj);
+11 -5
View File
@@ -241,11 +241,7 @@ void MacroGen::SetTypeData(uint32_t type, const std::shared_ptr<AstObject> &curr
case PARSEROP_UINT16:
case PARSEROP_UINT32:
case PARSEROP_UINT64: {
if (arraySize != 0) {
GenArray(arrayName, arraySize, arrayType, current);
} else {
ofs_ << " " << current->IntegerValue() << std::endl;
}
SetTypeDataUinit64(arrayName, arraySize, arrayType, current);
break;
}
case PARSEROP_STRING:
@@ -284,3 +280,13 @@ void MacroGen::SetTypeData(uint32_t type, const std::shared_ptr<AstObject> &curr
break;
}
}
void MacroGen::SetTypeDataUinit64(const std::string &arrayName, uint32_t &arraySize, uint32_t arrayType,
const std::shared_ptr<AstObject> &current)
{
if (arraySize != 0) {
GenArray(arrayName, arraySize, arrayType, current);
} else {
ofs_ << " " << current->IntegerValue() << std::endl;
}
}
+3
View File
@@ -36,6 +36,9 @@ private:
void SetTypeData(uint32_t type, const std::shared_ptr<AstObject> &current, uint32_t &arraySize, uint32_t depth);
void SetTypeDataUinit64(const std::string &arrayName, uint32_t &arraySize, uint32_t arrayType,
const std::shared_ptr<AstObject> &current);
bool HeaderTopOutput();
bool HeaderBottomOutput();