Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp3134990rdb; Fri, 22 Sep 2023 21:40:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhEysXppfgBcnFEqKfDnqsEgVUJaCgKKn/giNUbq0lhC3pRwFE7+DE5zT7JRjgfiTb0uny X-Received: by 2002:a05:6a00:24d1:b0:68f:b5a3:5ec6 with SMTP id d17-20020a056a0024d100b0068fb5a35ec6mr2368304pfv.0.1695444013511; Fri, 22 Sep 2023 21:40:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695444013; cv=none; d=google.com; s=arc-20160816; b=f7JYX9LcZ23h2oaA24YXVB9ZrhUVodnljrYT36BzQtQPhIedKzQgryj3stdP7nu4ip EQWMyWVaG279q6SDj2O5Mu9teeW3vxgs2Igy2l0iEY7QyW9+0YicMvILJ55pIpMSHdvP uMPIKVe+pE56pYPHJDc6vDQTKRTiqvCPmGbuNvPC2Yih+yh/qq6sPUcEwQQHt8douZYc r3zCHKuhDyP9W1/UkNlgu8wSGmhOTWq+TxviBOWxTl/p5wkvZCP0Gh/w7EyFYbRBd68l 9xOaKtR3k5Yv1cCullbxZsry+pc1og+50fNdRE8HrzP4b5MDmQYBzmS/geMVM2wmXwcL kddw== 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=s7f5WlKbwiPNn5x99oUW1c9UWCC8RkjDPUSTWLk42NRIT9OqKTvBKmCaKsQFekxFh2 a58A0DZMBmPGl8cnEw6OsN7j7FRHiuSYq+FyrNOCefi0jHZoGXwLvjduY0pI8tXJz+L0 sX3vlKoqTm0gRh0m1dsZcR5p+M7DnSqS2QkL+VvoTMQkzVE5HiR2vznw7bh0f/5bcEXh HmitCBImvDv7vu9UcqA1Hrp8wf/4OWR/WI1LonsAvYmHrzGXDvYNcBIT8mJefObFty6k K+SgxYlBpkh3Xgbs60JDUPAvwFGCkHeiwYmGzk4eeEGxcSxmHYUuC6lTKwxtECvYodaE qcCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HW2ENCAz; 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b26-20020a63931a000000b00578e662d9b3si5111044pge.486.2023.09.22.21.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 21:40:13 -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=HW2ENCAz; 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 998C8835C234; Fri, 22 Sep 2023 02:07:35 -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 S232868AbjIVJH3 (ORCPT + 99 others); Fri, 22 Sep 2023 05:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232854AbjIVJH1 (ORCPT ); Fri, 22 Sep 2023 05:07:27 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBBF29E; Fri, 22 Sep 2023 02:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695373641; x=1726909641; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TmtbaUEMxqVPjG+oZX6DU2I4wi1rrd3OfTC/l3qFAxM=; b=HW2ENCAzUrXbVQ+XkxYiX8rCQYV2A9poGt6OHlHaFcxd2JqANRgEMpjk jum3LTXN0nxr1usfeM3W5HIaTVHL3L+ARSkplTt1T1ZtvMFXumSix+N/z PUDTXCgfNAu2HGfv04J2DYx/8nY7LuQO7UY4//YHgT6k3AJpLw2YK1Aih CN5gvvEubCLqH6RfSCXSGGuqx2RrvDxLzvcBggqe/jKO4xKQyPySdxYoI Qp6YdzuSdQz7RosckQ11R0lHQOdEEo1s3vjOIf4X1yTMJIRweVIyDNRj2 J0OA7QFQTvquAdb8KEHQkriG+4IUeLsOn5IG9fbsLq1mc4QA9iH0ydTQN w==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070831" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070831" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 02:07:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837663808" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837663808" Received: from bmatwiej-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.8.2]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 02:07:18 -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 v3 4/8] selftests/pidfd: Fix ksft print formats Date: Fri, 22 Sep 2023 11:06:40 +0200 Message-ID: <96c418fe819e24522ebe72c2c842dcd7fe85352d.1695373131.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=-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,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]); Fri, 22 Sep 2023 02:07:35 -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