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

selftests: net: Fix printf format warnings on arm

Fix printf format warnings on arm (and other 32bit arch).

- udpgso.c and udpgso_bench_tx use %lu for size_t but it
should be unsigned long long on 32bit arch.

- so_txtime.c uses %ld for int64_t, but it should be
unsigned long long on 32bit arch.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Willem de Bruijn <willemb@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Masami Hiramatsu and committed by
Shuah Khan
670cd684 e698a237

+6 -4
+2 -2
tools/testing/selftests/net/so_txtime.c
··· 105 105 tstop = (gettime_ns() - glob_tstart) / 1000; 106 106 texpect = ts->delay_us >= 0 ? ts->delay_us : 0; 107 107 108 - fprintf(stderr, "payload:%c delay:%ld expected:%ld (us)\n", 109 - rbuf[0], tstop, texpect); 108 + fprintf(stderr, "payload:%c delay:%lld expected:%lld (us)\n", 109 + rbuf[0], (long long)tstop, (long long)texpect); 110 110 111 111 if (rbuf[0] != ts->data) 112 112 error(1, 0, "payload mismatch. expected %c", ts->data);
+2 -1
tools/testing/selftests/net/udpgso.c
··· 448 448 if (ret == -1) 449 449 error(1, errno, "sendmsg"); 450 450 if (ret != msg->msg_iov->iov_len) 451 - error(1, 0, "sendto: %d != %lu", ret, msg->msg_iov->iov_len); 451 + error(1, 0, "sendto: %d != %llu", ret, 452 + (unsigned long long)msg->msg_iov->iov_len); 452 453 if (msg->msg_flags) 453 454 error(1, 0, "sendmsg: return flags 0x%x\n", msg->msg_flags); 454 455
+2 -1
tools/testing/selftests/net/udpgso_bench_tx.c
··· 405 405 if (ret == -1) 406 406 error(1, errno, "sendmsg"); 407 407 if (ret != iov.iov_len) 408 - error(1, 0, "sendmsg: %u != %lu\n", ret, iov.iov_len); 408 + error(1, 0, "sendmsg: %u != %llu\n", ret, 409 + (unsigned long long)iov.iov_len); 409 410 410 411 return 1; 411 412 }