Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 396e9254 authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman
Browse files

staging: vchiq_core: fix format strings in vchiq_dump_service_state



The member localport and remoteport are unsigned. So fix the format
string accordingly.

The issue has been found by Cppcheck.

Signed-off-by: default avatarStefam Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 81a8b542
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3740,7 +3740,7 @@ vchiq_dump_service_state(void *dump_context, VCHIQ_SERVICE_T *service)
	char buf[80];
	char buf[80];
	int len;
	int len;


	len = snprintf(buf, sizeof(buf), "Service %d: %s (ref %u)",
	len = snprintf(buf, sizeof(buf), "Service %u: %s (ref %u)",
		service->localport, srvstate_names[service->srvstate],
		service->localport, srvstate_names[service->srvstate],
		service->ref_count - 1); /*Don't include the lock just taken*/
		service->ref_count - 1); /*Don't include the lock just taken*/


@@ -3752,7 +3752,7 @@ vchiq_dump_service_state(void *dump_context, VCHIQ_SERVICE_T *service)
		int tx_pending, rx_pending;
		int tx_pending, rx_pending;
		if (service->remoteport != VCHIQ_PORT_FREE) {
		if (service->remoteport != VCHIQ_PORT_FREE) {
			int len2 = snprintf(remoteport, sizeof(remoteport),
			int len2 = snprintf(remoteport, sizeof(remoteport),
				"%d", service->remoteport);
				"%u", service->remoteport);
			if (service->public_fourcc != VCHIQ_FOURCC_INVALID)
			if (service->public_fourcc != VCHIQ_FOURCC_INVALID)
				snprintf(remoteport + len2,
				snprintf(remoteport + len2,
					sizeof(remoteport) - len2,
					sizeof(remoteport) - len2,