Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Doc: networking: txtimestamp: fix printf format warning

Documentation/networking/timestamping/txtimestamp.c: In function ‘__print_timestamp’:
Documentation/networking/timestamping/txtimestamp.c:99:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int64_t’ [-Wformat=]
fprintf(stderr, " (%+ld us)", cur_ms - prev_ms);

int64_t differs per platform, so a type specifier that differs along
with it is required.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Frans Klaver and committed by
Jonathan Corbet
03e8f01a 1df1b361

+2 -2
+2 -2
Documentation/networking/timestamping/txtimestamp.c
··· 36 36 #include <asm/types.h> 37 37 #include <error.h> 38 38 #include <errno.h> 39 + #include <inttypes.h> 39 40 #include <linux/errqueue.h> 40 41 #include <linux/if_ether.h> 41 42 #include <linux/net_tstamp.h> ··· 50 49 #include <poll.h> 51 50 #include <stdarg.h> 52 51 #include <stdbool.h> 53 - #include <stdint.h> 54 52 #include <stdio.h> 55 53 #include <stdlib.h> 56 54 #include <string.h> ··· 96 96 prev_ms = (long) ts_prev.tv_sec * 1000 * 1000; 97 97 prev_ms += ts_prev.tv_nsec / 1000; 98 98 99 - fprintf(stderr, " (%+ld us)", cur_ms - prev_ms); 99 + fprintf(stderr, " (%+" PRId64 " us)", cur_ms - prev_ms); 100 100 } 101 101 102 102 ts_prev = *cur;