From patchwork Wed Oct 11 08:24:00 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: 151191 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp381559vqb; Wed, 11 Oct 2023 01:25:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG668iHOyCLGZJt32V8HFVtUJdBMILwtZoZjpVnIUn+AVnfohVfblvt3/GluHjFixAeL/bB X-Received: by 2002:a17:902:d2c7:b0:1c6:2b3d:d918 with SMTP id n7-20020a170902d2c700b001c62b3dd918mr23217201plc.3.1697012701278; Wed, 11 Oct 2023 01:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697012701; cv=none; d=google.com; s=arc-20160816; b=KxJzEGi4eqE5FegCoRUL4fLjVlCQnn6GRLs9mrNJTvfhdkt7/hQFbVr2DorUay+nvt LaQiIRIzZ7nBKQZaACoHZyyh3+N1UJ5y0zN7vj5VEzKcQydPUCQfxcZFplISC75ZvXae XJJya9DPvhj26qGDWwHmnO2KaXqLoJaP0nIyreI6oh2+ZwWanbw29BVCi5ChokPUPUTy 8TZa3CEZQJdXxRHkU0YtK6yMzYbm1Kkjtphy8BuDoLocQCYN/8/x22hAh1ugnSqMVmZW tTRcmpxA1atVRkfVtJupbHyUdmwpjVz1aFP9KZ0+3hMBhcbGQn00ec89OFGMXOzKbvuu x9Aw== 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=E852sCcAN3+ts7N+dYeSqMH1XgA0CvAFYd7qGbCKtm75G4jDPtJQDiKUiL+iy1zAXW 3g6v72zJrlvzrT0bord7NxVUQXV2QdtYaAHYHpdwlu/7ZlQaXorjwC5fUwPcrKaeHWaf Fp/iV8MzmuGsiA8YDhYxTRWAyLZKoX4WPGZVwF/374foRvqdVdD+NPSTTjwpYxgo0JES GTMELSkR6/hxTStM78aSJHUSWv21UaII2TvZ5psP7b+dzoZhHz1a4Ij9Wd31rg3jQn6o oqYxiMFwzSWFltdA+3WwY56cc3yMqhxDidFaMJBB8Um3kY4iQSztJhSFp/lW+H2eLCc6 Cd5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jQJLkX+X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kf4-20020a17090305c400b001c3e9b0bae1si13324002plb.443.2023.10.11.01.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 01:25:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jQJLkX+X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 31EE181B6A82; Wed, 11 Oct 2023 01:25:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345285AbjJKIYx (ORCPT + 19 others); Wed, 11 Oct 2023 04:24:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230327AbjJKIYr (ORCPT ); Wed, 11 Oct 2023 04:24:47 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9E05A4; Wed, 11 Oct 2023 01:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697012685; x=1728548685; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TmtbaUEMxqVPjG+oZX6DU2I4wi1rrd3OfTC/l3qFAxM=; b=jQJLkX+XvbsoVK78zW25i9/IYDh+0EX5C6jtjFr5HnmBFUmX9dD2cVK+ rxlVCOvNkUmg92XkTJkWF19+4dYUNtdCugYQ95DoBGJEbAC37xeP9eZLf cI5qKgBqARYJFsITjOQJbN0pbv+P7hPoFVVpqQYku9SMnisXlRQ2GzzuL r2eeDQ8p9PLznWFVth4kM9KcU76DriCZML5Uf4iFQ7mQM2Hq3iFhKMBFx 80vvBN0/8p+KJxSubDJ3hypstoyS6wRmhlxmPpFytcR2QZCgPYQ37uk+A CdyVFoN3/cE7HoeS/+8wyFTTtGR02/AGZDyOkwnxoyxK4RkCMKPLgHIwL w==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="3200825" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="3200825" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 01:24:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="730411675" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="730411675" Received: from bmatwiej-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.17.119]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 01:24:42 -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 v5 4/8] selftests/pidfd: Fix ksft print formats Date: Wed, 11 Oct 2023 10:24:00 +0200 Message-ID: <524c73a0a68f2403b5c428867ec5014b54069d1b.1697012398.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 01:25:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779446790673896713 X-GMAIL-MSGID: 1779446790673896713 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);