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

tools: fix mq_perf_tests compile warnings

Fix numerous compile warnings in mq_perf_tests.c. All of these
are wrong format in printfs when printing nvsec.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Shuah Khan and committed by
Greg Kroah-Hartman
f15fed3d 5e4ff695

+21 -19
+21 -19
tools/testing/selftests/mqueue/mq_perf_tests.c
··· 296 296 printf("\n\tQueue %s created:\n", queue_path); 297 297 printf("\t\tmq_flags:\t\t\t%s\n", result.mq_flags & O_NONBLOCK ? 298 298 "O_NONBLOCK" : "(null)"); 299 - printf("\t\tmq_maxmsg:\t\t\t%d\n", result.mq_maxmsg); 300 - printf("\t\tmq_msgsize:\t\t\t%d\n", result.mq_msgsize); 301 - printf("\t\tmq_curmsgs:\t\t\t%d\n", result.mq_curmsgs); 299 + printf("\t\tmq_maxmsg:\t\t\t%lu\n", result.mq_maxmsg); 300 + printf("\t\tmq_msgsize:\t\t\t%lu\n", result.mq_msgsize); 301 + printf("\t\tmq_curmsgs:\t\t\t%lu\n", result.mq_curmsgs); 302 302 } 303 303 304 304 void *fake_cont_thread(void *arg) ··· 440 440 shutdown(2, "clock_getres()", __LINE__); 441 441 442 442 printf("\t\tMax priorities:\t\t\t%d\n", mq_prio_max); 443 - printf("\t\tClock resolution:\t\t%d nsec%s\n", res.tv_nsec, 443 + printf("\t\tClock resolution:\t\t%lu nsec%s\n", res.tv_nsec, 444 444 res.tv_nsec > 1 ? "s" : ""); 445 445 446 446 ··· 454 454 recv_total.tv_nsec = 0; 455 455 for (i = 0; i < TEST1_LOOPS; i++) 456 456 do_send_recv(); 457 - printf("\t\tSend msg:\t\t\t%d.%ds total time\n", 457 + printf("\t\tSend msg:\t\t\t%ld.%lus total time\n", 458 458 send_total.tv_sec, send_total.tv_nsec); 459 459 nsec = ((unsigned long long)send_total.tv_sec * 1000000000 + 460 460 send_total.tv_nsec) / TEST1_LOOPS; 461 - printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); 462 - printf("\t\tRecv msg:\t\t\t%d.%ds total time\n", 461 + printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec); 462 + printf("\t\tRecv msg:\t\t\t%ld.%lus total time\n", 463 463 recv_total.tv_sec, recv_total.tv_nsec); 464 464 nsec = ((unsigned long long)recv_total.tv_sec * 1000000000 + 465 465 recv_total.tv_nsec) / TEST1_LOOPS; 466 - printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); 466 + printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec); 467 467 468 468 469 469 for (cur_test = test2; cur_test->desc != NULL; cur_test++) { 470 - printf(cur_test->desc); 470 + printf("%s:\n", cur_test->desc); 471 471 printf("\t\t(%d iterations)\n", TEST2_LOOPS); 472 472 prio_out = 0; 473 473 send_total.tv_sec = 0; ··· 493 493 cur_test->func(&prio_out); 494 494 } 495 495 printf("done.\n"); 496 - printf("\t\tSend msg:\t\t\t%d.%ds total time\n", 496 + printf("\t\tSend msg:\t\t\t%ld.%lus total time\n", 497 497 send_total.tv_sec, send_total.tv_nsec); 498 498 nsec = ((unsigned long long)send_total.tv_sec * 1000000000 + 499 499 send_total.tv_nsec) / TEST2_LOOPS; 500 - printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); 501 - printf("\t\tRecv msg:\t\t\t%d.%ds total time\n", 500 + printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec); 501 + printf("\t\tRecv msg:\t\t\t%ld.%lus total time\n", 502 502 recv_total.tv_sec, recv_total.tv_nsec); 503 503 nsec = ((unsigned long long)recv_total.tv_sec * 1000000000 + 504 504 recv_total.tv_nsec) / TEST2_LOOPS; 505 - printf("\t\t\t\t\t\t%d nsec/msg\n", nsec); 505 + printf("\t\t\t\t\t\t%lld nsec/msg\n", nsec); 506 506 printf("\t\tDraining queue..."); 507 507 fflush(stdout); 508 508 clock_gettime(clock, &start); ··· 653 653 /* Tell the user our initial state */ 654 654 printf("\nInitial system state:\n"); 655 655 printf("\tUsing queue path:\t\t\t%s\n", queue_path); 656 - printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%d\n", saved_limits.rlim_cur); 657 - printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%d\n", saved_limits.rlim_max); 656 + printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%ld\n", 657 + (long) saved_limits.rlim_cur); 658 + printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%ld\n", 659 + (long) saved_limits.rlim_max); 658 660 printf("\tMaximum Message Size:\t\t\t%d\n", saved_max_msgsize); 659 661 printf("\tMaximum Queue Size:\t\t\t%d\n", saved_max_msgs); 660 662 printf("\tNice value:\t\t\t\t%d\n", cur_nice); ··· 669 667 printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t(unlimited)\n"); 670 668 printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t(unlimited)\n"); 671 669 } else { 672 - printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%d\n", 673 - cur_limits.rlim_cur); 674 - printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%d\n", 675 - cur_limits.rlim_max); 670 + printf("\tRLIMIT_MSGQUEUE(soft):\t\t\t%ld\n", 671 + (long) cur_limits.rlim_cur); 672 + printf("\tRLIMIT_MSGQUEUE(hard):\t\t\t%ld\n", 673 + (long) cur_limits.rlim_max); 676 674 } 677 675 printf("\tMaximum Message Size:\t\t\t%d\n", cur_max_msgsize); 678 676 printf("\tMaximum Queue Size:\t\t\t%d\n", cur_max_msgs);