From 53f166911a9e6f9dcdabb26295e0270ad31a2e7d Mon Sep 17 00:00:00 2001 From: luo-wei246 Date: Mon, 3 Jul 2023 02:29:23 -0700 Subject: [PATCH] fix:alarm clean up Signed-off-by: luo-wei246 --- adapter/khdf/linux/model/usb/host/src/usb_pnp_notify.c | 2 +- adapter/khdf/liteos/model/bus/usb/hdf_usb.c | 2 +- adapter/khdf/liteos/model/usb/host/src/usb_pnp_manager.c | 4 ++-- adapter/khdf/liteos/model/usb/host/src/usb_pnp_notify.c | 4 ++-- adapter/khdf/liteos/model/usb/host/src/usb_test_pnp_notify.c | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/adapter/khdf/linux/model/usb/host/src/usb_pnp_notify.c b/adapter/khdf/linux/model/usb/host/src/usb_pnp_notify.c index 3ccfaf485..0161f40d3 100644 --- a/adapter/khdf/linux/model/usb/host/src/usb_pnp_notify.c +++ b/adapter/khdf/linux/model/usb/host/src/usb_pnp_notify.c @@ -906,7 +906,7 @@ static int32_t UsbPnpNotifyInit(struct HdfDeviceObject *device) return HDF_SUCCESS; } -static void UsbPnpNotifyRelease(struct HdfDeviceObject *device) +static void UsbPnpNotifyRelease(const struct HdfDeviceObject *device) { if (device == NULL) { HDF_LOGI("%s: device is null", __func__); diff --git a/adapter/khdf/liteos/model/bus/usb/hdf_usb.c b/adapter/khdf/liteos/model/bus/usb/hdf_usb.c index 0e26a90f9..7fc5946b3 100644 --- a/adapter/khdf/liteos/model/bus/usb/hdf_usb.c +++ b/adapter/khdf/liteos/model/bus/usb/hdf_usb.c @@ -108,7 +108,7 @@ static int ProcControllorParam(const struct DeviceResourceIface *instance, const } DEV_RES_NODE_FOR_EACH_CHILD_NODE(node, subNode) { - if (index >= info->len) { + if (index == info->len) { break; } struct UsbConfig *cfg = &(info->cfg[index]); diff --git a/adapter/khdf/liteos/model/usb/host/src/usb_pnp_manager.c b/adapter/khdf/liteos/model/usb/host/src/usb_pnp_manager.c index 5d829e2ae..db3b1e29b 100644 --- a/adapter/khdf/liteos/model/usb/host/src/usb_pnp_manager.c +++ b/adapter/khdf/liteos/model/usb/host/src/usb_pnp_manager.c @@ -75,7 +75,7 @@ static int32_t UsbPnpManagerBind(struct HdfDeviceObject *device) return HDF_SUCCESS; } -static int32_t UsbPnpManagerInit(struct HdfDeviceObject *device) +static int32_t UsbPnpManagerInit(const struct HdfDeviceObject *device) { int32_t ret; @@ -97,7 +97,7 @@ static int32_t UsbPnpManagerInit(struct HdfDeviceObject *device) return ret; } -static void UsbPnpManagerRelease(struct HdfDeviceObject *device) +static void UsbPnpManagerRelease(const struct HdfDeviceObject *device) { if (device == NULL) { dprintf("%s: device is null\n", __func__); diff --git a/adapter/khdf/liteos/model/usb/host/src/usb_pnp_notify.c b/adapter/khdf/liteos/model/usb/host/src/usb_pnp_notify.c index 3fbd13aa7..d284ebb1f 100644 --- a/adapter/khdf/liteos/model/usb/host/src/usb_pnp_notify.c +++ b/adapter/khdf/liteos/model/usb/host/src/usb_pnp_notify.c @@ -66,7 +66,7 @@ struct UsbPnpNotifyMatchInfoTable *g_testUsbPnpInfo = NULL; struct DListHead g_usbPnpDeviceListHead; struct OsalMutex g_usbPnpNotifyDevicelistLock; -static bool UsbPnpNotifyFindDeviceList(struct usb_device *deviceObj, bool freeFlag) +static bool UsbPnpNotifyFindDeviceList(const struct usb_device *deviceObj, bool freeFlag) { struct UsbPnpNotifyDeviceList *pnpNotifyDevicePos = NULL; struct UsbPnpNotifyDeviceList *pnpNotifyDeviceTemp = NULL; @@ -995,7 +995,7 @@ static int32_t UsbPnpNotifyInit(struct HdfDeviceObject *device) return HDF_SUCCESS; } -static void UsbPnpNotifyRelease(struct HdfDeviceObject *device) +static void UsbPnpNotifyRelease(const struct HdfDeviceObject *device) { HDF_STATUS ret; diff --git a/adapter/khdf/liteos/model/usb/host/src/usb_test_pnp_notify.c b/adapter/khdf/liteos/model/usb/host/src/usb_test_pnp_notify.c index 38eb63f9f..a000cab2a 100644 --- a/adapter/khdf/liteos/model/usb/host/src/usb_test_pnp_notify.c +++ b/adapter/khdf/liteos/model/usb/host/src/usb_test_pnp_notify.c @@ -39,7 +39,7 @@ #endif static int32_t UsbTestPnpNotifyDispatch( - struct HdfDeviceIoClient *client, int32_t cmdId, struct HdfSBuf *data, struct HdfSBuf *reply) + const struct HdfDeviceIoClient *client, int32_t cmdId, struct HdfSBuf *data, const struct HdfSBuf *reply) { (void)data; int32_t ret = HDF_SUCCESS; @@ -66,7 +66,7 @@ static int32_t UsbTestPnpNotifyBind(struct HdfDeviceObject *deviceObject) return HDF_SUCCESS; } -static int32_t UsbTestPnpNotifyInit(struct HdfDeviceObject *deviceObject) +static int32_t UsbTestPnpNotifyInit(const struct HdfDeviceObject *deviceObject) { if (deviceObject == NULL) { HDF_LOGE("%s::ptr is null!", __func__); -- Gitee