Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp655122rdg; Wed, 11 Oct 2023 01:24:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhPMFAuwSnUH3btug2gKIPaHfyPUJ5psxL5tGNHmxAbKPaLoT2dwQsi+EQd3ChstXywSrE X-Received: by 2002:a05:6871:b11:b0:1bb:4606:5be with SMTP id fq17-20020a0568710b1100b001bb460605bemr26176316oab.9.1697012698903; Wed, 11 Oct 2023 01:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697012698; cv=none; d=google.com; s=arc-20160816; b=lQJ7oU7g7OlY5MhXFlVwMTxUmnKzV5nLTVtdRsGDbtOBV1grO71rlp0t4k+ZvhGrOE WoaFdPQyFIsb7FNGvjyG4m+QHNY1O96NDZf/crissyrudkP6HQ8Ruh8YGcA+GQG+omXo 1VG5cv5IRwyutzbLT+I4naQRrqdOjhb82pQDsMC0XuabWUeoIy6qEZpj3GZBNnwY2fH2 nRLmVDG+L1JqsyS1RKBZRpbqYS0aFt/gWbN35IodCGQ7QL6f7TTf1C3ZrEf+Ab/7SFXw BkyJBhVS4jyjpp+Z88eWtsxSgdS3X2ENAI4n5VBsTM+E7sf1HL1jFXwR0+hUTQsDRSeU zpxg== 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 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u20-20020a63b554000000b0054405623a4asi2899201pgo.615.2023.10.11.01.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 01:24:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; 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 23.128.96.37 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 95B4F81B6A81; Wed, 11 Oct 2023 01:24:57 -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 S230325AbjJKIYw (ORCPT + 99 others); Wed, 11 Oct 2023 04:24:52 -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 Content-Transfer-Encoding: 8bit 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:24:57 -0700 (PDT) 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