All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] client/player: fix printf format string
@ 2022-09-23 10:51 Christian Eggers
  2022-09-23 10:51 ` [PATCH BlueZ 2/3] monitor: fix printf format strings Christian Eggers
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christian Eggers @ 2022-09-23 10:51 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Eggers

Use macros from inttypes.h for correct printf format specifier for
int64_t
---
 client/player.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/player.c b/client/player.c
index 0daacabf3c27..30ae263c8e41 100644
--- a/client/player.c
+++ b/client/player.c
@@ -15,7 +15,7 @@
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdbool.h>
-#include <stdint.h>
+#include <inttypes.h>
 #include <errno.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -3056,7 +3056,7 @@ static void send_wait(struct timespec *t_start, uint32_t us)
 	delta_us = us - TS_USEC(&t_diff);
 
 	if (delta_us < 0) {
-		bt_shell_printf("Send is behind: %zd us - skip sleep",
+		bt_shell_printf("Send is behind: %" PRId64 " us - skip sleep",
 							delta_us);
 		delta_us = 1000;
 	}
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH BlueZ 2/3] monitor: fix printf format strings
  2022-09-23 10:51 [PATCH BlueZ 1/3] client/player: fix printf format string Christian Eggers
@ 2022-09-23 10:51 ` Christian Eggers
  2022-09-23 10:51 ` [PATCH BlueZ 3/3] tools: " Christian Eggers
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Eggers @ 2022-09-23 10:51 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Eggers

time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now
---
 monitor/analyze.c | 21 ++++++++++++---------
 monitor/packet.c  | 10 ++++++----
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/monitor/analyze.c b/monitor/analyze.c
index ac23e13bbd42..50e7e5542793 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
@@ -172,15 +172,18 @@ static void conn_destroy(void *data)
 	print_field("%lu RX packets", conn->rx_num);
 	print_field("%lu TX packets", conn->tx_num);
 	print_field("%lu TX completed packets", conn->tx_num_comp);
-	print_field("%ld msec min latency",
-			conn->tx_lat_min.tv_sec * 1000 +
-			conn->tx_lat_min.tv_usec / 1000);
-	print_field("%ld msec max latency",
-			conn->tx_lat_max.tv_sec * 1000 +
-			conn->tx_lat_max.tv_usec / 1000);
-	print_field("%ld msec median latency",
-			conn->tx_lat_med.tv_sec * 1000 +
-			conn->tx_lat_med.tv_usec / 1000);
+	print_field("%lld msec min latency",
+			(long long)
+			(conn->tx_lat_min.tv_sec * 1000 +
+			conn->tx_lat_min.tv_usec / 1000));
+	print_field("%lld msec max latency",
+			(long long)
+			(conn->tx_lat_max.tv_sec * 1000 +
+			conn->tx_lat_max.tv_usec / 1000));
+	print_field("%lld msec median latency",
+			(long long)
+			(conn->tx_lat_med.tv_sec * 1000 +
+			conn->tx_lat_med.tv_usec / 1000));
 	print_field("%u octets TX min packet size", conn->tx_pkt_min);
 	print_field("%u octets TX max packet size", conn->tx_pkt_max);
 	print_field("%u octets TX median packet size", conn->tx_pkt_med);
diff --git a/monitor/packet.c b/monitor/packet.c
index 1344fd5b2503..1a41498e9c52 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -384,8 +384,9 @@ static void print_packet(struct timeval *tv, struct ucred *cred, char ident,
 		}
 
 		if (filter_mask & PACKET_FILTER_SHOW_TIME) {
-			n = sprintf(ts_str + ts_pos, " %02d:%02d:%02d.%06lu",
-				tm.tm_hour, tm.tm_min, tm.tm_sec, tv->tv_usec);
+			n = sprintf(ts_str + ts_pos, " %02d:%02d:%02d.%06llu",
+				tm.tm_hour, tm.tm_min, tm.tm_sec,
+				(long long)tv->tv_usec);
 			if (n > 0) {
 				ts_pos += n;
 				ts_len += n;
@@ -393,8 +394,9 @@ static void print_packet(struct timeval *tv, struct ucred *cred, char ident,
 		}
 
 		if (filter_mask & PACKET_FILTER_SHOW_TIME_OFFSET) {
-			n = sprintf(ts_str + ts_pos, " %lu.%06lu",
-					tv->tv_sec - time_offset, tv->tv_usec);
+			n = sprintf(ts_str + ts_pos, " %llu.%06llu",
+				(long long)(tv->tv_sec - time_offset),
+				(long long)tv->tv_usec);
 			if (n > 0) {
 				ts_pos += n;
 				ts_len += n;
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH BlueZ 3/3] tools: fix printf format strings
  2022-09-23 10:51 [PATCH BlueZ 1/3] client/player: fix printf format string Christian Eggers
  2022-09-23 10:51 ` [PATCH BlueZ 2/3] monitor: fix printf format strings Christian Eggers
@ 2022-09-23 10:51 ` Christian Eggers
  2022-09-23 12:19 ` [BlueZ,1/3] client/player: fix printf format string bluez.test.bot
  2022-09-26 18:00 ` [PATCH BlueZ 1/3] " patchwork-bot+bluetooth
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Eggers @ 2022-09-23 10:51 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Christian Eggers

time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now
---
 tools/l2test.c | 5 +++--
 tools/rctest.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/l2test.c b/tools/l2test.c
index fbaca747eaaa..5aae4b687518 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -893,8 +893,9 @@ static void recv_mode(int sk)
 					timestamp = 0;
 					memset(ts, 0, sizeof(ts));
 				} else {
-					sprintf(ts, "[%ld.%ld] ",
-							tv.tv_sec, tv.tv_usec);
+					sprintf(ts, "[%lld.%lld] ",
+							(long long)tv.tv_sec,
+							(long long)tv.tv_usec);
 				}
 			}
 
diff --git a/tools/rctest.c b/tools/rctest.c
index 9eb8210d6eb2..269503701e6b 100644
--- a/tools/rctest.c
+++ b/tools/rctest.c
@@ -500,8 +500,9 @@ static void recv_mode(int sk)
 					timestamp = 0;
 					memset(ts, 0, sizeof(ts));
 				} else {
-					sprintf(ts, "[%ld.%ld] ",
-							tv.tv_sec, tv.tv_usec);
+					sprintf(ts, "[%lld.%lld] ",
+							(long long)tv.tv_sec,
+							(long long)tv.tv_usec);
 				}
 			}
 
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [BlueZ,1/3] client/player: fix printf format string
  2022-09-23 10:51 [PATCH BlueZ 1/3] client/player: fix printf format string Christian Eggers
  2022-09-23 10:51 ` [PATCH BlueZ 2/3] monitor: fix printf format strings Christian Eggers
  2022-09-23 10:51 ` [PATCH BlueZ 3/3] tools: " Christian Eggers
@ 2022-09-23 12:19 ` bluez.test.bot
  2022-09-26 18:00 ` [PATCH BlueZ 1/3] " patchwork-bot+bluetooth
  3 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2022-09-23 12:19 UTC (permalink / raw)
  To: linux-bluetooth, ceggers

[-- Attachment #1: Type: text/plain, Size: 4916 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=679835

---Test result---

Test Summary:
CheckPatch                    PASS      2.07 seconds
GitLint                       PASS      1.40 seconds
Prep - Setup ELL              PASS      33.40 seconds
Build - Prep                  PASS      0.86 seconds
Build - Configure             PASS      10.63 seconds
Build - Make                  PASS      1109.03 seconds
Make Check                    PASS      13.06 seconds
Make Check w/Valgrind         PASS      357.62 seconds
Make Distcheck                PASS      304.53 seconds
Build w/ext ELL - Configure   PASS      10.74 seconds
Build w/ext ELL - Make        PASS      108.05 seconds
Incremental Build w/ patches  PASS      377.76 seconds
Scan Build                    WARNING   772.37 seconds

Details
##############################
Test: Scan Build - WARNING
Desc: Run Scan Build with patches
Output:
*****************************************************************************
The bugs reported by the scan-build may or may not be caused by your patches.
Please check the list and fix the bugs if they are caused by your patch.
*****************************************************************************
monitor/analyze.c:381:2: warning: Value stored to 'data' is never read
        data += sizeof(*hdr);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:382:2: warning: Value stored to 'size' is never read
        size -= sizeof(*hdr);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:398:2: warning: Value stored to 'data' is never read
        data += sizeof(*evt);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:399:2: warning: Value stored to 'size' is never read
        size -= sizeof(*evt);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:418:2: warning: Value stored to 'data' is never read
        data += sizeof(*evt);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:419:2: warning: Value stored to 'size' is never read
        size -= sizeof(*evt);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:527:2: warning: Value stored to 'data' is never read
        data += sizeof(subtype);
        ^       ~~~~~~~~~~~~~~~
monitor/analyze.c:528:2: warning: Value stored to 'size' is never read
        size -= sizeof(subtype);
        ^       ~~~~~~~~~~~~~~~
monitor/analyze.c:629:2: warning: Value stored to 'data' is never read
        data += sizeof(*hdr);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:630:2: warning: Value stored to 'size' is never read
        size -= sizeof(*hdr);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:646:2: warning: Value stored to 'data' is never read
        data += sizeof(*hdr);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:647:2: warning: Value stored to 'size' is never read
        size -= sizeof(*hdr);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:710:2: warning: Value stored to 'data' is never read
        data += sizeof(*hdr);
        ^       ~~~~~~~~~~~~
monitor/analyze.c:711:2: warning: Value stored to 'size' is never read
        size -= sizeof(*hdr);
        ^       ~~~~~~~~~~~~
14 warnings generated.
monitor/packet.c:410:4: warning: Value stored to 'ts_pos' is never read
                        ts_pos += n;
                        ^         ~
monitor/packet.c:455:4: warning: Value stored to 'pos' is never read
                        pos += n;
                        ^      ~
monitor/packet.c:7477:2: warning: Value stored to 'mask' is never read
        mask = tx_phys;
        ^      ~~~~~~~
monitor/packet.c:7485:2: warning: Value stored to 'mask' is never read
        mask = rx_phys;
        ^      ~~~~~~~
monitor/packet.c:11229:3: warning: Value stored to 'str' is never read
                str = "AoA Constant Tone Extension";
                ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11232:3: warning: Value stored to 'str' is never read
                str = "AoA Constant Tone Extension with 1us slots";
                ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11235:3: warning: Value stored to 'str' is never read
                str = "AoD Constant Tone Extension with 2us slots";
                ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11238:3: warning: Value stored to 'str' is never read
                str = "No Constant Tone Extension";
                ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monitor/packet.c:11241:3: warning: Value stored to 'str' is never read
                str = "Reserved";
                ^     ~~~~~~~~~~
monitor/packet.c:11242:3: warning: Value stored to 'color_on' is never read
                color_on = COLOR_RED;
                ^          ~~~~~~~~~
10 warnings generated.




---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ 1/3] client/player: fix printf format string
  2022-09-23 10:51 [PATCH BlueZ 1/3] client/player: fix printf format string Christian Eggers
                   ` (2 preceding siblings ...)
  2022-09-23 12:19 ` [BlueZ,1/3] client/player: fix printf format string bluez.test.bot
@ 2022-09-26 18:00 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2022-09-26 18:00 UTC (permalink / raw)
  To: Christian Eggers; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 23 Sep 2022 12:51:39 +0200 you wrote:
> Use macros from inttypes.h for correct printf format specifier for
> int64_t
> ---
>  client/player.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Here is the summary with links:
  - [BlueZ,1/3] client/player: fix printf format string
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7b07f1f98059
  - [BlueZ,2/3] monitor: fix printf format strings
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=fa8411cf37a3
  - [BlueZ,3/3] tools: fix printf format strings
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e01e89179d4e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-26 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 10:51 [PATCH BlueZ 1/3] client/player: fix printf format string Christian Eggers
2022-09-23 10:51 ` [PATCH BlueZ 2/3] monitor: fix printf format strings Christian Eggers
2022-09-23 10:51 ` [PATCH BlueZ 3/3] tools: " Christian Eggers
2022-09-23 12:19 ` [BlueZ,1/3] client/player: fix printf format string bluez.test.bot
2022-09-26 18:00 ` [PATCH BlueZ 1/3] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.