diff mbox series

[4/8] qmi: Eliminate unnecessary casting to unsigned int

Message ID 20240419164458.36078-4-steve.schrock@getcruise.com (mailing list archive)
State Accepted
Commit 28d60206ba2d17f3149f39638dc7a9e232e848c4
Headers show
Series [1/8] qmi unit: Link to dl | expand

Commit Message

Steve Schrock April 19, 2024, 4:44 p.m. UTC
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.
---
 drivers/qmimodem/qmi.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index e1091b872f23..f406d01a8df6 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;