[PATCH BlueZ v2 2/2] tools/mgmt-tester: Make data size explicit for log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 32 bit systems, sizeof macro doesn't always return (unsigned long)

Fix following error:

tools/mgmt-tester.c: In function ‘read_50_controller_cap_complete’:
tools/mgmt-tester.c:9124:58: error: format ‘%lu’ expects argument of type
‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Werror=format=]

 9124 |   tester_warn("Controller capabilities malformed, size %lu != %u",
      |                                                        ~~^
      |                                                          |
      |                                                  long unsigned int
      |                                                        %u
 9125 |     sizeof(rp->cap_len) + rp->cap_len, length);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                         |
      |                     unsigned int
---
 tools/mgmt-tester.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index fe73a6d89..6bc40181e 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -9122,7 +9122,7 @@ static void read_50_controller_cap_complete(uint8_t status, uint16_t length,
 
 	if (sizeof(rp->cap_len) + rp->cap_len != length) {
 		tester_warn("Controller capabilities malformed, size %lu != %u",
-				sizeof(rp->cap_len) + rp->cap_len, length);
+			(long) sizeof(rp->cap_len) + rp->cap_len, length);
 		tester_test_failed();
 	}
 
-- 
2.25.4




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux