Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1942380rdb; Tue, 5 Sep 2023 09:23:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5hv9a+iGIF6JklsyZGmlqNi6wrLO2kwOh9Sn3biaAbbIz3J2DzVq5OA7KkdiIKS1xTtxp X-Received: by 2002:a17:907:b0a:b0:9a1:b705:75d1 with SMTP id h10-20020a1709070b0a00b009a1b70575d1mr223183ejl.51.1693931029223; Tue, 05 Sep 2023 09:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693931029; cv=none; d=google.com; s=arc-20160816; b=SnftHD7+V0SiZNgr1csbyQN/KHJyX+dWcbkp9+nKt4nvP2HLwuI9l4gERc12YasbKP LTtffRFLzBXA6nXYw11fT0vgqEzFPQBKmtbmEoKu1iw2i//9Ko7nTEySJYzzqOrTf8A7 G3Zxl4Ql7d+x+A0doDY6wbbMk7Jy4r2RNq5LZuHYb5RexyOf8CaWQy8mhynC0eVi+Eol tkg23BLxt3pjCK9QjRQFGnNx2liWH+joH8SArnYsIK9FHzfvV9MJtIIH2y8hUBtNrnTS LOnxzaydm1Sqlw4yDxlVbnwqDEKNXbx5e+1OxZYbJdh3YaEMZxaYu8NbLIzN+QQh1xOR LAYQ== 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=uMMV54GDXuZCdp083Nc/C9ABDQE5jzwJZm7P/2L7iJU=; fh=33DkgOLZOhGl4RjlhWAp5nFcYUbqyWwnGv4zJFDsNbM=; b=DSbABqbo04zOeL99GmoUHk0bNhXVvZL/PKgykqOm21PrmSg/yF4Q5mQmzXSzp1Xv7T gBZzszYtPg/6Vo2XjmXhvfmLLi6WBdjv+gOosP0QUr2MOglsZbQpeJw1gwDGVX1eAB4t 2ucK3kxnxgFcXz3oZkc1Rzh4YALf207jhIkKBLqQZqEvVgljuTr33spYqMth+X2Ae7Pq ac3VEFla4uIpcQpPuREWyFDYAu7Cju1HuBTPHX7YuT4YFSWiFKy5gtR+xlpVS6GOghsh egsYAPq4jaHkygcOG3jrc63E+l1sLBj6el17wg1C3qCbMtPNpmGCi9HLlhXMmLulG1vj TDuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QPRTv9Oe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cb2-20020a170906a44200b009a2097f8863si7743650ejb.545.2023.09.05.09.23.42; Tue, 05 Sep 2023 09:23:49 -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=pass header.i=@intel.com header.s=Intel header.b=QPRTv9Oe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352984AbjIDMp5 (ORCPT + 18 others); Mon, 4 Sep 2023 08:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240763AbjIDMpz (ORCPT ); Mon, 4 Sep 2023 08:45:55 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8208CCE; Mon, 4 Sep 2023 05:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693831547; x=1725367547; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ur7uZoww6FS6EfbpNkxHkTWp9s13PDMr1Npv7yNc/3U=; b=QPRTv9OeGPvpJjbv5xgTMYsSIQZ4aGidcoINN2KENtCi/Ok0trOVr7P1 S9CbQSd+6VVm32TYdFSMMldMM1DYyKcVIRD07w3yfNNB9tvviUvfVyIcn kqYrLIdPGnH9H0UfC9++DDdyOrfQeSj9TLB0wTk/7UiJ7St4uFL+FPqLy lfnhzQp2UTaQ3XKD3CpzRcfFtrgu2muwD/yeAA8rQ8ATdpcCdCibEYdQp h/vCDpcNgUFbj0YVJY0Wqal2INiDsGG5tI8NFe8LR0chIXa9hIN9g/K9g dHntr9AzCunrCUSYJzFJ17TonR9Euwx8ADscrfSodTyDV/0YMWgeaEuAD w==; X-IronPort-AV: E=McAfee;i="6600,9927,10823"; a="440555404" X-IronPort-AV: E=Sophos;i="6.02,226,1688454000"; d="scan'208";a="440555404" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2023 05:45:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10823"; a="914497823" X-IronPort-AV: E=Sophos;i="6.02,226,1688454000"; d="scan'208";a="914497823" Received: from mfederki-mobl1.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.15.69]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2023 05:45:28 -0700 From: Wieczor-Retman Maciej 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 v2 4/8] selftests/pidfd: Fix ksft print formats Date: Mon, 4 Sep 2023 14:44:27 +0200 Message-ID: <0ac871f5a15392dac7f308b8759cb17707faf789.1693829810.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 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 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: Wieczor-Retman Maciej --- 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