From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 672D8C83F12 for ; Mon, 28 Aug 2023 11:02:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbjH1LBo (ORCPT ); Mon, 28 Aug 2023 07:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232458AbjH1LBZ (ORCPT ); Mon, 28 Aug 2023 07:01:25 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56F87A7; Mon, 28 Aug 2023 04:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693220483; x=1724756483; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=6Sd5QShyFtlsZBfAcyEAspH6vjNE9Hs58VQFciHuCzI=; b=J49sXw9p9f6elqW5sRJWRCIT5aZkN9C85+thI/p1PBiBR9QCiw8yfHbS 7DFdj3K9lmppddtXWueDdbMKojqeBHC4MiomXiztdft+9dtWv8w4kwxXn HCgVBVIi3vPjZS+VCvsXT/wA//3fPbd2iI47uwFlrwTdfnfyb/i5ju/Yg pBiWQjyWoebPt7sY2OXb/XFzihxaVOoWU2khcvdc838gOChC6n92CQPt0 5ieoUu6c56YtDhMmvJbUhTxgyaTfAdpX+L7F2cMK1MKndomrUS4wP4Ry/ zRp4YqOGYiFeu6wB45TE92tPFTVc5wO2lM9GDqBFs4rM28pgRBuDEylHX Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="372479593" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="372479593" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 04:01:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="731784870" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="731784870" Received: from gliakhov-mobl.ger.corp.intel.com ([10.251.214.48]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 04:01:20 -0700 Date: Mon, 28 Aug 2023 14:01:18 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: "Wieczor-Retman, Maciej" cc: Christian Brauner , Shuah Khan , Reinette Chatre , LKML , linux-kselftest@vger.kernel.org Subject: Re: [PATCH 4/6] selftests/pidfd: Fix ksft print formats In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On Mon, 28 Aug 2023, Wieczor-Retman, Maciej wrote: > Many calls to ksft print functions have format strings that don't match > with other passed arguments. One call expects a string but doesn't > provide any argument after the format string. > > Fix format specifiers so they match the passed variables. > > Add a missing variable to ksft_test_result_pass() inside > pidfd_fdinfo_test() so it matches other cases in the switch statement. > > Signed-off-by: Wieczor-Retman, Maciej > --- > tools/testing/selftests/pidfd/pidfd_fdinfo_test.c | 2 +- > tools/testing/selftests/pidfd/pidfd_test.c | 12 ++++++------ > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c b/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c > index 4e86f927880c..01cc37bf611c 100644 > --- a/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c > +++ b/tools/testing/selftests/pidfd/pidfd_fdinfo_test.c > @@ -62,7 +62,7 @@ static void error_report(struct error *err, const char *test_name) > break; > > case PIDFD_PASS: > - ksft_test_result_pass("%s test: Passed\n"); > + ksft_test_result_pass("%s test: Passed\n", test_name); Missing test_name leads to crash so this looks a Fixes: class thing for me but you didn't provide one. > break; > > default: > diff --git a/tools/testing/selftests/pidfd/pidfd_test.c b/tools/testing/selftests/pidfd/pidfd_test.c > index 00a07e7c571c..c081ae91313a 100644 > --- a/tools/testing/selftests/pidfd/pidfd_test.c > +++ b/tools/testing/selftests/pidfd/pidfd_test.c > @@ -381,13 +381,13 @@ static int test_pidfd_send_signal_syscall_support(void) > > static void *test_pidfd_poll_exec_thread(void *priv) > { > - ksft_print_msg("Child Thread: starting. pid %d tid %d ; and sleeping\n", > + ksft_print_msg("Child Thread: starting. pid %d tid %ld ; and sleeping\n", > getpid(), syscall(SYS_gettid)); > ksft_print_msg("Child Thread: doing exec of sleep\n"); > > execl("/bin/sleep", "sleep", str(CHILD_THREAD_MIN_WAIT), (char *)NULL); > > - ksft_print_msg("Child Thread: DONE. pid %d tid %d\n", > + ksft_print_msg("Child Thread: DONE. pid %d tid %ld\n", > getpid(), syscall(SYS_gettid)); > return NULL; > } > @@ -427,7 +427,7 @@ static int child_poll_exec_test(void *args) > { > pthread_t t1; > > - ksft_print_msg("Child (pidfd): starting. pid %d tid %d\n", getpid(), > + ksft_print_msg("Child (pidfd): starting. pid %d tid %ld\n", getpid(), > syscall(SYS_gettid)); > pthread_create(&t1, NULL, test_pidfd_poll_exec_thread, NULL); > /* > @@ -480,10 +480,10 @@ static void test_pidfd_poll_exec(int use_waitpid) > > static void *test_pidfd_poll_leader_exit_thread(void *priv) > { > - ksft_print_msg("Child Thread: starting. pid %d tid %d ; and sleeping\n", > + ksft_print_msg("Child Thread: starting. pid %d tid %ld ; and sleeping\n", > getpid(), syscall(SYS_gettid)); > sleep(CHILD_THREAD_MIN_WAIT); > - ksft_print_msg("Child Thread: DONE. pid %d tid %d\n", getpid(), syscall(SYS_gettid)); > + ksft_print_msg("Child Thread: DONE. pid %d tid %ld\n", getpid(), syscall(SYS_gettid)); > return NULL; > } > > @@ -492,7 +492,7 @@ static int child_poll_leader_exit_test(void *args) > { > pthread_t t1, t2; > > - ksft_print_msg("Child: starting. pid %d tid %d\n", getpid(), syscall(SYS_gettid)); > + ksft_print_msg("Child: starting. pid %d tid %ld\n", getpid(), syscall(SYS_gettid)); > pthread_create(&t1, NULL, test_pidfd_poll_leader_exit_thread, NULL); > pthread_create(&t2, NULL, test_pidfd_poll_leader_exit_thread, NULL); > > -- i.