diff mbox series

[2/3] qmi: Fix printing the wrong type for services

Message ID 20240311232036.49381-2-steve.schrock@getcruise.com (mailing list archive)
State Superseded
Headers show
Series [1/3] qmi: Discover timeout could cause a crash | expand

Commit Message

Steve Schrock March 11, 2024, 11:20 p.m. UTC
The __debug_msg refactoring introduced a bug where the service
transactions would not display the correct type in the log. The service
transaction type is shifted to the left by one bit compared to the
control transaction type so we need to perform a shift to be able to
share a common debug logging function.
---
 drivers/qmimodem/qmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c
index 31f88114..15324e6a 100644
--- a/drivers/qmimodem/qmi.c
+++ b/drivers/qmimodem/qmi.c
@@ -652,7 +652,7 @@  static void __qmux_debug_msg(const char dir, const void *buf, size_t len,
 		srv = buf + QMI_MUX_HDR_SIZE;
 		msg = buf + QMI_MUX_HDR_SIZE + QMI_SERVICE_HDR_SIZE;
 
-		transaction_type = srv->type;
+		transaction_type = srv->type >> 1;
 		tid = L_LE16_TO_CPU(srv->transaction);
 	}
 
@@ -676,7 +676,7 @@  static void __qrtr_debug_msg(const char dir, const void *buf, size_t len,
 
 	tid = L_LE16_TO_CPU(srv->transaction);
 
-	__debug_msg(dir, msg, service_type, srv->type, tid, 0, len,
+	__debug_msg(dir, msg, service_type, srv->type >> 1, tid, 0, len,
 						function, user_data);
 }