diff options
author | Steve Schrock <steve.schrock@getcruise.com> | 2024-04-19 16:44:54 +0000 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2024-04-22 11:16:06 -0500 |
commit | 28d60206ba2d17f3149f39638dc7a9e232e848c4 (patch) | |
tree | 582f5c081197abd9531b8c4dba69b54e0ffed024 | |
parent | 6131bfc81468d847901417e095485a6358284148 (diff) | |
download | ofono-28d60206ba2d17f3149f39638dc7a9e232e848c4.tar.gz |
qmi: Eliminate unnecessary casting to unsigned int
uint16_t values were copied into unsigned ints before being passed to
L_UINT_TO_PTR. Perhaps this was necessary when the glib macro
GUINT_TO_POINTER was used, but it is not necessary now with the ell macro.
-rw-r--r-- | drivers/qmimodem/qmi.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c index e1091b872..f406d01a8 100644 --- a/drivers/qmimodem/qmi.c +++ b/drivers/qmimodem/qmi.c @@ -1330,7 +1330,6 @@ static void __rx_ctl_message(struct qmi_device_qmux *qmux, struct qmi_request *req; uint16_t message; uint16_t length; - unsigned int tid; /* Ignore control messages with client identifier */ if (client_id != 0x00) @@ -1338,7 +1337,6 @@ static void __rx_ctl_message(struct qmi_device_qmux *qmux, message = L_LE16_TO_CPU(msg->message); length = L_LE16_TO_CPU(msg->length); - tid = control->transaction; if (control->type == 0x02 && control->transaction == 0x00) { handle_indication(&qmux->super, service_type, client_id, @@ -1347,7 +1345,7 @@ static void __rx_ctl_message(struct qmi_device_qmux *qmux, } req = l_queue_remove_if(qmux->control_queue, __request_compare, - L_UINT_TO_PTR(tid)); + L_UINT_TO_PTR(control->transaction)); if (!req) return; @@ -2860,12 +2858,11 @@ uint16_t qmi_service_send(struct qmi_service *service, bool qmi_service_cancel(struct qmi_service *service, uint16_t id) { - unsigned int tid = id; struct qmi_device *device; struct qmi_request *req; struct service_family *family; - if (!service || !tid) + if (!service || !id) return false; family = service->family; @@ -2878,11 +2875,11 @@ bool qmi_service_cancel(struct qmi_service *service, uint16_t id) return false; req = l_queue_remove_if(device->req_queue, __request_compare, - L_UINT_TO_PTR(tid)); + L_UINT_TO_PTR(id)); if (!req) { req = l_queue_remove_if(device->service_queue, __request_compare, - L_UINT_TO_PTR(tid)); + L_UINT_TO_PTR(id)); if (!req) return false; } @@ -2965,7 +2962,6 @@ uint16_t qmi_service_register(struct qmi_service *service, bool qmi_service_unregister(struct qmi_service *service, uint16_t id) { - unsigned int nid = id; struct service_family *family; struct qmi_notify *notify; @@ -2975,7 +2971,7 @@ bool qmi_service_unregister(struct qmi_service *service, uint16_t id) family = service->family; notify = l_queue_remove_if(family->notify_list, __notify_compare, - L_UINT_TO_PTR(nid)); + L_UINT_TO_PTR(id)); if (!notify) return false; |