Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1800937rdb; Mon, 9 Oct 2023 03:31:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2u1OscJEaiC5+rIArz8SivKbL0l6Vbt4SswK+44ecHN/VrCmoTiI/g//LJUzBfjbdvD0l X-Received: by 2002:a05:6a00:2314:b0:68f:cb69:8e7f with SMTP id h20-20020a056a00231400b0068fcb698e7fmr15413399pfh.7.1696847519078; Mon, 09 Oct 2023 03:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696847519; cv=none; d=google.com; s=arc-20160816; b=QEEyCpN6QyBnJfUmhtfR5B0IgOhJ5TgMGfQ78qc4Dte92OP7psLTgVzJHDmbbCkOKc O+U1tVp1Lx/A8UzFGDprQ3Z98jAfs4Ktm0IqPHB6O026Xx3Kl3MtgVpTPFxi29/tXw57 ZUaRdw/vnhD2UUxu+flLQAd6rDyBsCTWbqlZ+S7vOn3DvDb9kLZpJZCdgFcp46vpRMAq olqt25XB1jkPKwIMj6CCIW3UNg5E0b01z41YY4tRAs+ldWaozZxJch1vugJKp2qmhKVS VFZsvSqZ2bVbTfGCFdYoqY7A6yyOi0AUWT7o+CxYc05FWcIbuG4xKGadJIjgLfWF4uxv 7i1w== 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=0k2R5gHEY0n9s6qPk/hpVEz7tqFZahW1VetBxc/Ephc=; fh=33DkgOLZOhGl4RjlhWAp5nFcYUbqyWwnGv4zJFDsNbM=; b=QbviWQbk+g4JWtF0KGdQV3v8y2XzgPKGVWxBek04Fqh7xaSJPoIIvtW/J19+i2FtQZ tgRw1RohSrygxyixd6qp/URdtUcIGJCTlFxwAntkH/GaZe9+TdJmR31IpE25xM1AxpVw WR0X3C1BWWJMIW8YrTOVv+1cpSLNHBwEvELY91fdcRoxBle2F9XqzznK1hWBqOdbWRKA saypOjVDV3xPW0YwYtbTeTIDSXuMVkyaDcIslRGucBU7E+eQpS+ZAHQBVoMBAn4ggj8r U9vadLisCDnZH2r2F1hRZXzfp/Hl96phgtGRPWUaOBqi2mHShtQ+JEzm6qE2eX6AB2XJ wM8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Trv65CwB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id w63-20020a638242000000b00565f65e16bfsi9074563pgd.762.2023.10.09.03.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 03:31:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Trv65CwB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B9B5A8052BCA; Mon, 9 Oct 2023 03:31:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345871AbjJIKbe (ORCPT + 99 others); Mon, 9 Oct 2023 06:31:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345831AbjJIKbc (ORCPT ); Mon, 9 Oct 2023 06:31:32 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A40B6DB; Mon, 9 Oct 2023 03:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696847490; x=1728383490; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TmtbaUEMxqVPjG+oZX6DU2I4wi1rrd3OfTC/l3qFAxM=; b=Trv65CwBnXBPVX6CKjUe+3SVYVt6Qs4Ywex6zCgBVDVO59wFwR9LcKxm MpzBNyqUUB0NmbG9mLPOphYBMRrdgcGJHNeGoitjH0ohNZ0mxRNYHZNjd iREXX4+wc3LZVPtAPuH/93epO57MzZ7Tu3zjHX9At/TXkjeMATty+OI5O 0GlntAu04NVVpCsLUdUPGKXvjkZ+pj8OKiCdBuWHJYj08vU1+6D55BxTa 3EKIWp8/dPi5jovPqk6SCXg+8+RwtenY4nVN1wt2K4GzsRNvP239LTJG8 myEu2t6y7L6hyUGmXFzXKhkqnmPqdposSB4aJtdwMtGhvSNnIw8KeVvc9 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10857"; a="363468434" X-IronPort-AV: E=Sophos;i="6.03,210,1694761200"; d="scan'208";a="363468434" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2023 03:31:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10857"; a="926718709" X-IronPort-AV: E=Sophos;i="6.03,210,1694761200"; d="scan'208";a="926718709" Received: from kkensic-mobl1.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.30.239]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2023 03:31:27 -0700 From: Maciej Wieczor-Retman To: Christian Brauner , Shuah Khan , Christian Kellner Cc: ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v4 4/8] selftests/pidfd: Fix ksft print formats Date: Mon, 9 Oct 2023 12:30:38 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 03:31:53 -0700 (PDT) X-Spam-Level: ** 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. Fixes: 2def297ec7fb ("pidfd: add tests for NSpid info in fdinfo") Signed-off-by: Maciej Wieczor-Retman --- Changelog v2: - Add fixes tag to patch message. 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); -- 2.42.0