From patchwork Mon Aug 28 10:49:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Wieczor-Retman X-Patchwork-Id: 137022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3245551vqm; Mon, 28 Aug 2023 03:57:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpmQsa2H8Wkd18wfughKRsHDHfbODqhZ5O8oGKkyO0opCgc4+TQmuN76PQEbTbuj0kpNmu X-Received: by 2002:a05:6402:2039:b0:522:c0ea:15f with SMTP id ay25-20020a056402203900b00522c0ea015fmr17888169edb.41.1693220231045; Mon, 28 Aug 2023 03:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693220231; cv=none; d=google.com; s=arc-20160816; b=tITC9XePPOkg9kvIq6TYs3lcoAH7C0IVB89pzpXULxEt0A0zQ7YXyShyEq59OW6psx uvyxb0XI4OThl8uQtBXsi3Mq5qiUZv2YmsuKZBxULWzgk2qLtEtqHO97WkQ8GHFJZFXj QZwKbe2/tFFf1zQVsDo9ctpdhR2+8aPg5d+nBhVOgf8HE68NGZq9GBs7/uR0/7Dchqtg zm+vT8fyLikiF5Lhq7zl05SbfPUoJSWwOXRwFiUgjQQifrjGK3aHI2I772pIi5zPG68d 3VRidN2spDw46+zDbfU2us6R1a1aXjOy1Y2wOfl9ILcxeCc4j6jSAMu4cB0F3atHKHE4 hEfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aoKljOBcvdAHpws0FxEpUAGFDLzW4EdhPnvaosTWi1I=; fh=igH7VqxEwecq7pQ6yzzvf7S+SDYVMzf6CyJa33ki0Gg=; b=0q4biCDivHB/1rg49CVn3CY/oy1DZFei0lln4vgxHkH4x2vwzPK+qGTeczS6eiAN+G Xy5cQxjI2upSW4DsGM0j+yjD3ED3SZ3XmR2ttFACxCa6ttJ3FM1dxWblPMCHNbUsQWAL orjgXGLe0nhaj9uF8BLdX6pxUf6zTau17Ev1ZUuwDtI6FvZzYsUUIZSAsRHzEeqUOSyd O1Ta8sL06aFmCrwXPuPLcvEuYKLMZlbMi4LNUoHl7PQQYWDSJvU6W9227ayI4fE21cAf qNo/lahSPtxSpml4TaB7Y/YekbhYQ5NxUw5bgsyWLQ9hszhzLDInQrit/fMR1SM42WRE EkaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=Bz+C1rYp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a05640202ce00b005255bb59aeasi4246344edx.560.2023.08.28.03.56.29; Mon, 28 Aug 2023 03:57:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=Bz+C1rYp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbjH1Kvr (ORCPT + 99 others); Mon, 28 Aug 2023 06:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232340AbjH1KvU (ORCPT ); Mon, 28 Aug 2023 06:51:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4B86E5C; Mon, 28 Aug 2023 03:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693219839; x=1724755839; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CCfcVevobufNXrw1gfQzQygL8lnnjRYVk1T6GYsBWnI=; b=Bz+C1rYpKNjb90k9Nzg40kOUMEhlF7jaP1Dlo/yYMBHYHOAOQb7XSvkk riK9Mzuyn8/RTpzzBFFBjPlX1OekdKShxUUkih6uur4IhjPNEwQIKjNYb lM6QE9dmXOEIqdv+A5hyOiHrWnUDhUI9leh7FfOIKZwGigc01GYpD7QhP GwLGFxKYo8meM4OQEPMkYn8MzTjOlgFTNYaufvYz0HffzTsgVptNHXPoA P7aDmhjkGymUPADQ9h45uzJMXlDmYUMEFndDmsBBE98k0SAehtYrYybPa H5vqym8NkDYnG/3wiPKBNjEEUK7a9KuVNiLvshL+laycCtjB8aXsQrj12 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="355398910" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="355398910" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:50:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="803658340" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="803658340" Received: from nwiklans-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.22.120]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:50:39 -0700 From: "Wieczor-Retman, Maciej" To: Christian Brauner , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, reinette.chatre@intel.com, "Wieczor-Retman, Maciej" , Wieczor-Retman@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 4/6] selftests/pidfd: Fix ksft print formats Date: Mon, 28 Aug 2023 12:49:08 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775470096989301876 X-GMAIL-MSGID: 1775470096989301876 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); 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);