From patchwork Mon Aug 28 10:49:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maciej Wieczor-Retman X-Patchwork-Id: 137020 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3244004vqm; Mon, 28 Aug 2023 03:53:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHC9Q2eWuhsGGgCOUh9V6GkKYWJEV0YGG8NgS5CZjTpdw1B8lqTKuYm3qyusY3C1kjvqGHk X-Received: by 2002:a50:fa93:0:b0:523:102f:3cdd with SMTP id w19-20020a50fa93000000b00523102f3cddmr20014777edr.19.1693219982548; Mon, 28 Aug 2023 03:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693219982; cv=none; d=google.com; s=arc-20160816; b=ThrsFCo8f+8mCP7ROR3RroNqjKwGRofNrRKi2IdrOo1Sz+Cjakxq0v+wzXS5mVFLWC Mci3V90mtdBZ6lo3aQbQtS8l9uJTrKD3wH+70HPqvFOPURfZuElurxBt/gyWV3jssuf+ cTaHSlc/NchWumRtGvK7huZK8KGG5OSq2excQVN5+YMAf4Zac/0aGAIFqt624mboKYpz JUATX9IFcYinWmuIg+BfAlbO3lT2CGZGuK2GepYVDzMsFJc0QLQWFp7wILdbziwLWz3n Ljnq++2EzjBYg3guMeN0sLbEcXmujEyqkK4/MocLjvjPlzOjhPkVSXgme5H0eAVUDzAI 4kxQ== 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=VqiftTtYUgOhLADAEUJy2SjhHCRLrgO4RcCC3gerMWk=; fh=myjXE8eAMkM2H0tHGBnWa1ar6NNZsj4Z/nL+Y0E6/0U=; b=S35ye3Md/9OfiNwvAzHKn+L8YA4WF6vae0tWD/trE1NV52ckBhJYrUxuymGdSSPPxp JOuR1VB3xbyv0HEqmbJXRmkDHfsSYXh5yCP7i5LXc+HlxwBWH+Tu7EVWpW4SHH3VIVfW lEoFqH0gqEEgsedjUiJAhG7v94NU/PSxa4Jpc3Hg3fWrkD/yHhu8OYp7BCfZzsrd0kjw L1c/phtb1a6+l/h6piolQKGX+6CnPzxfvtMMk7rX5zuxcfIP3as8CgB+JWDWujHpPy9+ ur+ttBwXtrd5F+eigApXcr85sOuEBx2NRQfbq7GgUZUc2q6vc3jX2n05tAJLQsikfCfO VXbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=KQETilpX; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c23-20020aa7df17000000b0052a4b6e91ccsi2241644edy.362.2023.08.28.03.52.17; Mon, 28 Aug 2023 03:53:02 -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=fail header.i=@intel.com header.s=Intel header.b=KQETilpX; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232129AbjH1Kui (ORCPT + 99 others); Mon, 28 Aug 2023 06:50:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232172AbjH1KuR (ORCPT ); Mon, 28 Aug 2023 06:50:17 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ABA8CE5; Mon, 28 Aug 2023 03:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693219791; x=1724755791; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g6Q0I7XLa+4hBFvEvw3+AsTn1EkARykHZ9OAimd73mM=; b=KQETilpXK804MKHS8u7OpMq4aMBscQYvNH2+jGFSe7XxUixHV8g7TNhm 3JQgXzr67oTTHx+Fdji7RQW0PnwlLE7UoQsPG7KrMChGhOqaqX/Bc+WRt RRKUWFF9p/vLHt29vTUDTkgPk4+PsSM2C5RqXAQjiGxc7WOA56ZgRnVQy fl2NlGNbqJ10shCbO/3cKfHnYREsL04NAEBZdTz4pqzc2cEGfYchV0qWY V6TwYqTRSrW8GGG/gWisUc7PxXU/zbDQ9Bplook27r16ZrG4Lh7DvqHSY FKuLT2PZR4edBLVC9N4QW4pLE0tWgMwyOp9fmcKQaCBIWjSkfqZJuPjL3 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="355398778" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="355398778" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:49:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="803658305" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="803658305" Received: from nwiklans-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.22.120]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:49:40 -0700 From: "Wieczor-Retman, Maciej" To: Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, reinette.chatre@intel.com, "Wieczor-Retman, Maciej" , Wieczor-Retman@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] selftests: Add printf attribute to ksefltest prints Date: Mon, 28 Aug 2023 12:49:05 +0200 Message-ID: <85a37a74915f9b969d179254fb4588de70a97af1.1693216959.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=-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775469836560468898 X-GMAIL-MSGID: 1775469836560468898 Kselftest header defines multiple variadic function that use printf along with other logic. There is no format checking for the variadic functions that use printing inside kselftest.h. Because of this the compiler won't be able to catch instances of mismatched print formats and debugging tests might be more difficult. Add the common __printf attribute macro to kselftest.h. Add __printf attribute to every function using formatted printing with variadic arguments. Signed-off-by: Wieczor-Retman, Maciej Reviewed-by: Ilpo Järvinen --- tools/testing/selftests/kselftest.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h index 829be379545a..ff47ed711879 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -77,6 +77,8 @@ #define KSFT_XPASS 3 #define KSFT_SKIP 4 +#define __printf(a, b) __attribute__((format(printf, a, b))) + /* counters */ struct ksft_count { unsigned int ksft_pass; @@ -134,7 +136,7 @@ static inline void ksft_print_cnts(void) ksft_cnt.ksft_xskip, ksft_cnt.ksft_error); } -static inline void ksft_print_msg(const char *msg, ...) +static inline __printf(1, 2) void ksft_print_msg(const char *msg, ...) { int saved_errno = errno; va_list args; @@ -146,7 +148,7 @@ static inline void ksft_print_msg(const char *msg, ...) va_end(args); } -static inline void ksft_test_result_pass(const char *msg, ...) +static inline __printf(1, 2) void ksft_test_result_pass(const char *msg, ...) { int saved_errno = errno; va_list args; @@ -160,7 +162,7 @@ static inline void ksft_test_result_pass(const char *msg, ...) va_end(args); } -static inline void ksft_test_result_fail(const char *msg, ...) +static inline __printf(1, 2) void ksft_test_result_fail(const char *msg, ...) { int saved_errno = errno; va_list args; @@ -186,7 +188,7 @@ static inline void ksft_test_result_fail(const char *msg, ...) ksft_test_result_fail(fmt, ##__VA_ARGS__);\ } while (0) -static inline void ksft_test_result_xfail(const char *msg, ...) +static inline __printf(1, 2) void ksft_test_result_xfail(const char *msg, ...) { int saved_errno = errno; va_list args; @@ -200,7 +202,7 @@ static inline void ksft_test_result_xfail(const char *msg, ...) va_end(args); } -static inline void ksft_test_result_skip(const char *msg, ...) +static inline __printf(1, 2) void ksft_test_result_skip(const char *msg, ...) { int saved_errno = errno; va_list args; @@ -215,7 +217,7 @@ static inline void ksft_test_result_skip(const char *msg, ...) } /* TODO: how does "error" differ from "fail" or "skip"? */ -static inline void ksft_test_result_error(const char *msg, ...) +static inline __printf(1, 2) void ksft_test_result_error(const char *msg, ...) { int saved_errno = errno; va_list args; @@ -262,7 +264,7 @@ static inline int ksft_exit_fail(void) ksft_cnt.ksft_xfail + \ ksft_cnt.ksft_xskip) -static inline int ksft_exit_fail_msg(const char *msg, ...) +static inline __printf(1, 2) int ksft_exit_fail_msg(const char *msg, ...) { int saved_errno = errno; va_list args; @@ -289,7 +291,7 @@ static inline int ksft_exit_xpass(void) exit(KSFT_XPASS); } -static inline int ksft_exit_skip(const char *msg, ...) +static inline __printf(1, 2) int ksft_exit_skip(const char *msg, ...) { int saved_errno = errno; va_list args; From patchwork Mon Aug 28 10:49:06 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: 137021 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3244046vqm; Mon, 28 Aug 2023 03:53:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZyUaQlygmoEp6uYoAKkZi9sNgCigaYq3DHHuhwGTbqG3esVhY0xXX7fUhXueSTH+60s/8 X-Received: by 2002:a17:906:9bd8:b0:9a1:c812:cbb9 with SMTP id de24-20020a1709069bd800b009a1c812cbb9mr11790045ejc.31.1693219989095; Mon, 28 Aug 2023 03:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693219989; cv=none; d=google.com; s=arc-20160816; b=vOhhH0MB3g7abZI7dNgxHlflWRsCIId65nGTe3Dx0wIDON1xbBWvi60QYTfLZjZFF1 UJW91030pdpUSRKIbL+NC1WJfpvbmwako27N4v/S0fLiLfuAF4aTitfOgA8e+aqsPOu/ ZfbD0dujdWzH/8NT4jd1MAMgM04U7yo4i9dCcKHMp4NvmmCgDvNfePYmJqdLzJgGsd9p dPLAuFkFIRp41hxlmjgRtz/9hj+OIFg0OTJ+shSbjyQGMkfEzJuH6Qelpicc0mbBhGdE 2b0xgKqkLiEDyeqMMY4BJsUerorqG8HmSLv+1b5OLeicBr3KTSyWdnPL8klZbCqWsrmp xP5g== 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=kerPzjdwIGFQNh7mdPazVmM0fCblsNCX2mvZz2ZUeTU=; fh=iHIyRFPKPWRiwxRxZ+MijMeilqnQZXtg19MNCyK2GW0=; b=I7UqmNsHTMSA/2eOZOLC2nRpYSrlH+85n5vrGymK+vepEcTikzYzVROBdUedp2gD7M fr/VGAK0zTc4Bc6V6nFY3v4wHMO3XBfitmHRngUugBWknAdyvLAvA0uqgXGhuZSIGxz4 ntof/QK5nSxbCVtOZJHQtz3/1xr3HXcz9TDK98qqDOCYtgmue3qU00fYZ1cPTiwrDWo7 BDEgLyAog97kHPBA7nO5s1SPteX2bzfIJQ8YfoW/05AHKPFIE+CbYGzBM/L1vyO3yBbY UAPURwejmpu6Vktj4Xk/dYwaUooVOHSM5O4RhDqpfQvjM0hF5K3PLT4is7v/HBLpJFDa MFJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=ljUitEwj; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t22-20020a1709060c5600b009a59b604305si2139453ejf.406.2023.08.28.03.52.24; Mon, 28 Aug 2023 03:53:09 -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=fail header.i=@intel.com header.s=Intel header.b=ljUitEwj; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232156AbjH1Kun (ORCPT + 99 others); Mon, 28 Aug 2023 06:50:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232286AbjH1Ku3 (ORCPT ); Mon, 28 Aug 2023 06:50:29 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E87411B4; Mon, 28 Aug 2023 03:50:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693219802; x=1724755802; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oBFESXQeo8XUbeSjtiiAngLi2J8A9Sds/W2gNaZedsA=; b=ljUitEwj6gxEmWTMiQBDOeY3v93h/zvfHJuo3QqNyZ6LwgW7raWe/7sy vtoJgV6FGcba1MRwh8CfDFqywlP/0y3r8F58NP52o8HtQFmiZSMJGLXLv uRWuRCmKKitSQa/7it9rUpGgqbJsuquvHCq2X62nF3q1oDyXE8N62X8Zy vJEK5siVb0CQZMpHlv3lDlHSnQWC4Cqzcb61EpHFr1QPivXslAStvyTSq 9JSjfItyznL1eiag+lkfwWhUxhpnjY88PUGAbyMnq13oTUEQifmKKEMXr jXNhBArSlTmjj7/AY3ehlnpHxuSctsy9BonYDvV7IEMUPJFLWQm5naD5k w==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="355398803" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="355398803" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:49:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="803658311" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="803658311" Received: from nwiklans-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.22.120]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:49:54 -0700 From: "Wieczor-Retman, Maciej" To: Nhat Pham , Johannes Weiner , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, reinette.chatre@intel.com, "Wieczor-Retman, Maciej" , Wieczor-Retman@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] selftests/cachestat: Fix print_cachestat format Date: Mon, 28 Aug 2023 12:49:06 +0200 Message-ID: <8417dcd7ebdc464d12850873d6c48f95293e673c.1693216959.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=-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775469843250385617 X-GMAIL-MSGID: 1775469843250385617 The format specifier in printf() call expects long int variables and received long long int. Change format specifiers to long long int so they match passed variables. Signed-off-by: Wieczor-Retman, Maciej --- tools/testing/selftests/cachestat/test_cachestat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/cachestat/test_cachestat.c b/tools/testing/selftests/cachestat/test_cachestat.c index 77620e7ecf56..a7adf42afb20 100644 --- a/tools/testing/selftests/cachestat/test_cachestat.c +++ b/tools/testing/selftests/cachestat/test_cachestat.c @@ -25,7 +25,7 @@ static const char * const dev_files[] = { void print_cachestat(struct cachestat *cs) { ksft_print_msg( - "Using cachestat: Cached: %lu, Dirty: %lu, Writeback: %lu, Evicted: %lu, Recently Evicted: %lu\n", + "Using cachestat: Cached: %llu, Dirty: %llu, Writeback: %llu, Evicted: %llu, Recently Evicted: %llu\n", cs->nr_cache, cs->nr_dirty, cs->nr_writeback, cs->nr_evicted, cs->nr_recently_evicted); } From patchwork Mon Aug 28 10:49:07 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: 137023 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3245589vqm; Mon, 28 Aug 2023 03:57:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJgAh1VT8s6BglhjuueSBlPWTo3faUPQBqBhvD9DbCqjHtsRVfHKgvnLRfESkhwisOMauR X-Received: by 2002:a17:906:5199:b0:9a1:b705:75d1 with SMTP id y25-20020a170906519900b009a1b70575d1mr14023334ejk.51.1693220235446; Mon, 28 Aug 2023 03:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693220235; cv=none; d=google.com; s=arc-20160816; b=DKMJLH86rmeFZv7xtl/SPRhlsBUrYardS2lu22zmehCcb6BSZGPY9uc32oJMXK9g3t m9dzxWlh00hhJFNJQ/3eD54Nl1hgGtNj4dmodA+lvZCskaRo4DgIZnSx9VEosNnm1gM8 64DSeAaPyLKGxzSqlsy53oX7RT4cni5YXTOuA/6XCbs0R4TL5LN9cQyWRXmD5OAkvk01 KbGkc4msU9r6dET9KvRW2D4bnYH+HoCbrMg2fIgVCdGYNNaGtb2mJ0tE5dLTU2R1sAVT Ejb+q3Bf41hTBybyiuO0YguCcdG0EkLKc9XxW3qIHBvlvILgS1hKI63HDcbMzolI+Ag3 cLiQ== 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=QE7p4B3abom2ND4T90UwOmyI03Grfme7lAdOLihlQvA=; fh=myjXE8eAMkM2H0tHGBnWa1ar6NNZsj4Z/nL+Y0E6/0U=; b=xFI9yIzvsCJPBAI3vAiFb9+0vaRGi43//6s+UJlx+8/xeL+Ws4FBYnzqJKO8+m/ilE IxZJC4dxfuVgjiXcSw8Xiqv+58ub8BJvmhMnvcFSmrwnGJBBD2hOTVAuOqXfJL5G4r0A 3RZibWfgbfP2yZKqJSfcE+V/KziSgkfBOkdFk0MM0uXma8Mk/+XOCRzFoexYh2Zv3Ryj vzmvIQAgz6Rp3t5JCkU7FlihbuMUevN3ZDnaMsaCdW+VDtGcbWnWqIRtrNay3grj9dkR GogNbWEOSMMEAM5b8WVQsXYewEEgihaCNVRYQ5QNGfjCZsdvaK3FAQJCPAH5HFBnWGEP FREA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=XiXrDSwx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p7-20020a170906b20700b0099cbfe8a383si2474036ejz.779.2023.08.28.03.56.30; Mon, 28 Aug 2023 03:57:15 -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=fail header.i=@intel.com header.s=Intel header.b=XiXrDSwx; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232144AbjH1Kvo (ORCPT + 99 others); Mon, 28 Aug 2023 06:51:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232249AbjH1Kuu (ORCPT ); Mon, 28 Aug 2023 06:50:50 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF250199; Mon, 28 Aug 2023 03:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693219825; x=1724755825; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yeabUHzSr9wnJ5Khd/Kxt8JMKHZYb3HenPBaDj2y7Bw=; b=XiXrDSwxfMaYndVIHbKk2K9Y+ha9boTBhY4t2O+o6AWtRveg356IvsOk CPFVE6RtOLembWFeY6sfSykflTeRQMwn8xu71SEQMOyqmfKIWlcypUPmW QkYtNKhjK2OMUEtdEGM/AiF/yB/GQFdWHoRmBH/pmhECH4IJsMkIf79Jx N1D7A/kESZL44Y/TEoFkRfuUZA/zxZalh0Kcq4IugDVP2Eg4T/SzaD/Ne 2pTkXKwUylkf61donEE3MGbM0LE0Wih/B8u15EOez2MQJvtqRdyQXSGjS s20vZCj3xcJaRk7dXVijWbug8kHt0gZvH1T+7uXfUQUpAswqHY4w4HoKw g==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="355398873" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="355398873" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:50:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="803658331" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="803658331" Received: from nwiklans-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.22.120]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:50:22 -0700 From: "Wieczor-Retman, Maciej" To: Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, reinette.chatre@intel.com, "Wieczor-Retman, Maciej" , Wieczor-Retman@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] selftests/openat2: Fix wrong format specifier Date: Mon, 28 Aug 2023 12:49:07 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775470101607355168 X-GMAIL-MSGID: 1775470101607355168 Ksft_print_msg() inside test_openat2_flags() uses the wrong format specifier for printing test.how->flags variable. Change the format specifier to %llX so it matches the printed variable. Signed-off-by: Wieczor-Retman, Maciej --- tools/testing/selftests/openat2/openat2_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/openat2/openat2_test.c b/tools/testing/selftests/openat2/openat2_test.c index 7fb902099de4..9024754530b2 100644 --- a/tools/testing/selftests/openat2/openat2_test.c +++ b/tools/testing/selftests/openat2/openat2_test.c @@ -300,7 +300,7 @@ void test_openat2_flags(void) ksft_print_msg("openat2 unexpectedly returned "); if (fdpath) - ksft_print_msg("%d['%s'] with %X (!= %X)\n", + ksft_print_msg("%d['%s'] with %X (!= %llX)\n", fd, fdpath, fdflags, test->how.flags); else From patchwork Mon Aug 28 10:49:08 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: 137022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3245551vqm; Mon, 28 Aug 2023 03:57:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpmQsa2H8Wkd18wfughKRsHDHfbODqhZ5O8oGKkyO0opCgc4+TQmuN76PQEbTbuj0kpNmu X-Received: by 2002:a05:6402:2039:b0:522:c0ea:15f with SMTP id ay25-20020a056402203900b00522c0ea015fmr17888169edb.41.1693220231045; Mon, 28 Aug 2023 03:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693220231; cv=none; d=google.com; s=arc-20160816; b=tITC9XePPOkg9kvIq6TYs3lcoAH7C0IVB89pzpXULxEt0A0zQ7YXyShyEq59OW6psx uvyxb0XI4OThl8uQtBXsi3Mq5qiUZv2YmsuKZBxULWzgk2qLtEtqHO97WkQ8GHFJZFXj QZwKbe2/tFFf1zQVsDo9ctpdhR2+8aPg5d+nBhVOgf8HE68NGZq9GBs7/uR0/7Dchqtg zm+vT8fyLikiF5Lhq7zl05SbfPUoJSWwOXRwFiUgjQQifrjGK3aHI2I772pIi5zPG68d 3VRidN2spDw46+zDbfU2us6R1a1aXjOy1Y2wOfl9ILcxeCc4j6jSAMu4cB0F3atHKHE4 hEfg== 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=aoKljOBcvdAHpws0FxEpUAGFDLzW4EdhPnvaosTWi1I=; fh=igH7VqxEwecq7pQ6yzzvf7S+SDYVMzf6CyJa33ki0Gg=; b=0q4biCDivHB/1rg49CVn3CY/oy1DZFei0lln4vgxHkH4x2vwzPK+qGTeczS6eiAN+G Xy5cQxjI2upSW4DsGM0j+yjD3ED3SZ3XmR2ttFACxCa6ttJ3FM1dxWblPMCHNbUsQWAL orjgXGLe0nhaj9uF8BLdX6pxUf6zTau17Ev1ZUuwDtI6FvZzYsUUIZSAsRHzEeqUOSyd O1Ta8sL06aFmCrwXPuPLcvEuYKLMZlbMi4LNUoHl7PQQYWDSJvU6W9227ayI4fE21cAf qNo/lahSPtxSpml4TaB7Y/YekbhYQ5NxUw5bgsyWLQ9hszhzLDInQrit/fMR1SM42WRE EkaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=Bz+C1rYp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a05640202ce00b005255bb59aeasi4246344edx.560.2023.08.28.03.56.29; Mon, 28 Aug 2023 03:57:11 -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=fail header.i=@intel.com header.s=Intel header.b=Bz+C1rYp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbjH1Kvr (ORCPT + 99 others); Mon, 28 Aug 2023 06:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232340AbjH1KvU (ORCPT ); Mon, 28 Aug 2023 06:51:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4B86E5C; Mon, 28 Aug 2023 03:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693219839; x=1724755839; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CCfcVevobufNXrw1gfQzQygL8lnnjRYVk1T6GYsBWnI=; b=Bz+C1rYpKNjb90k9Nzg40kOUMEhlF7jaP1Dlo/yYMBHYHOAOQb7XSvkk riK9Mzuyn8/RTpzzBFFBjPlX1OekdKShxUUkih6uur4IhjPNEwQIKjNYb lM6QE9dmXOEIqdv+A5hyOiHrWnUDhUI9leh7FfOIKZwGigc01GYpD7QhP GwLGFxKYo8meM4OQEPMkYn8MzTjOlgFTNYaufvYz0HffzTsgVptNHXPoA P7aDmhjkGymUPADQ9h45uzJMXlDmYUMEFndDmsBBE98k0SAehtYrYybPa H5vqym8NkDYnG/3wiPKBNjEEUK7a9KuVNiLvshL+laycCtjB8aXsQrj12 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="355398910" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="355398910" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:50:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="803658340" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="803658340" Received: from nwiklans-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.22.120]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:50:39 -0700 From: "Wieczor-Retman, Maciej" To: Christian Brauner , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, reinette.chatre@intel.com, "Wieczor-Retman, Maciej" , Wieczor-Retman@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 4/6] selftests/pidfd: Fix ksft print formats Date: Mon, 28 Aug 2023 12:49:08 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775470096989301876 X-GMAIL-MSGID: 1775470096989301876 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. Signed-off-by: Wieczor-Retman, Maciej --- 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); From patchwork Mon Aug 28 10:49:09 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: 137033 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3298224vqm; Mon, 28 Aug 2023 05:37:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPo4xRP1O0hSWNGZIATTqQZlHcxo1xyDR3vixq5bxjHbfwFH7uOaX4vQSnMKSzsT+I5p3P X-Received: by 2002:a05:6a20:12cd:b0:140:f6c4:aa71 with SMTP id v13-20020a056a2012cd00b00140f6c4aa71mr31216360pzg.8.1693226232259; Mon, 28 Aug 2023 05:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693226232; cv=none; d=google.com; s=arc-20160816; b=Eg28+WvOjLMwektD+cx1uND09vSvbP0c0Hn8SgC+MqvbRwX8lQXDZ2rusUuEzsk51r sh2v/ByFrKFZDBZny1kJQKw382jjjgnPcuR2M6nzxdC/XNyaiEcK5wf07WVg0OLmPGBT kGFsB7is6CuVfXTf6ylGyA4QEHHOpJooGH+DYY6yI/jEaflwfBlW5P4AG4Fr7VIjAYQR 9JbwXD25NcOPo181hg5AFqk1MBO28HMC4bKbUIamvNNgW9iGUat2+t66iyCMfVqQ2iGm 3txY6gMJrGsj5KGisxmoi63tr1QaFCEtdhvtrIvgP9d6lfxAXt959olDh05LyjvgqxjI t73Q== 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=XeVgYk54uqe9dahlortF9vWxD7UurPNTmS+1sEY5vR0=; fh=myjXE8eAMkM2H0tHGBnWa1ar6NNZsj4Z/nL+Y0E6/0U=; b=vGvlX1Cq4SJhG3uFOBi2fY1+mShd2MNL4Ml7Vlk4liMWC12wUtY0cRusmAGhCxvqQ9 2l5O+Rr663MKtSgeYW4q0eWa/0qNF5LxFx+YsZ7wDjwmBZpbXRe3N8oFEs/aUDFZLXs2 SZlFwBHMMX6JeoYqrrmfHLm7x5mDEvGkFqCkRV8uVUWkMWzDe2l4tGYiAcsdfEHruO9S dfDInwErVeb6wR0ipp1htFDwm+hGSBPvISfKCc3u5nF3I615XrzjPwizCI9xPpK1tA5B wdIa5WGLEtaplBtLwfW3WrF4hsByvmlpHpi1y+5mDJirHGd2dnLp5Iq5OIjeuh7l5CDO 6w3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=Eai3InN0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a056a000b8100b0068c0070d170si573900pfj.334.2023.08.28.05.36.46; Mon, 28 Aug 2023 05:37:12 -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=fail header.i=@intel.com header.s=Intel header.b=Eai3InN0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232328AbjH1KzA (ORCPT + 91 others); Mon, 28 Aug 2023 06:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232408AbjH1Kyw (ORCPT ); Mon, 28 Aug 2023 06:54:52 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 662F5D8; Mon, 28 Aug 2023 03:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693220065; x=1724756065; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QSTkRKepbci7ZibAbLE07UEc26Bgp7zEFWSUgACZfHY=; b=Eai3InN0kYeNuPXpWc7UglyYQMAFkt7qGX+k2jpkEU8O9LaYbEo/ZfNf OWje54hFiEK+gdg3k2Rnw4TtzKC2YwizNMLSXQoaZzOZJMHb8cU1qg3vp XpHohgSCf+XLKLngMqMKwAUhsNyZBXa4OWko6jzSIoPRkwcVoLBEE0DYj LGig1zJh33OscIqmoZsyjTulsyYw3y2BK6I1JnP1QviyGaRbZVRM8XZy/ lFDMfl9EkNwTLkH/hnZhe4Ed1rzGdCDMs8C7v5a+jjtrY9CtWqp8LDHku HsnntEublYD6frubdPhT6paxY6P+eNPgqkKk2tYJldY/kILlICzbAyPlG g==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="355398964" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="355398964" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:50:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="803658351" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="803658351" Received: from nwiklans-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.22.120]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:50:53 -0700 From: "Wieczor-Retman, Maciej" To: Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, reinette.chatre@intel.com, "Wieczor-Retman, Maciej" , Wieczor-Retman@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] selftests/sigaltstack: Fix wrong format specifier Date: Mon, 28 Aug 2023 12:49:09 +0200 Message-ID: <613189f12a8c15df7dc725e4b7ed66ffa4b30fb5.1693216959.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=-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775476389278687740 X-GMAIL-MSGID: 1775476389278687740 The format specifier inside ksft printing function expects a long unsigned int but the passed variable is of unsigned int type. Fix the format specifier so it matches the passed variable. Signed-off-by: Wieczor-Retman, Maciej --- tools/testing/selftests/sigaltstack/sas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/sigaltstack/sas.c b/tools/testing/selftests/sigaltstack/sas.c index 98d37cb744fb..07227fab1cc9 100644 --- a/tools/testing/selftests/sigaltstack/sas.c +++ b/tools/testing/selftests/sigaltstack/sas.c @@ -111,7 +111,7 @@ int main(void) /* Make sure more than the required minimum. */ stack_size = getauxval(AT_MINSIGSTKSZ) + SIGSTKSZ; - ksft_print_msg("[NOTE]\tthe stack size is %lu\n", stack_size); + ksft_print_msg("[NOTE]\tthe stack size is %u\n", stack_size); ksft_print_header(); ksft_set_plan(3); From patchwork Mon Aug 28 10:49:10 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: 137024 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3246197vqm; Mon, 28 Aug 2023 03:58:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+vMOsXxEmvQTJpmGLlpMvkZvpV6/wc9J7XUYGuya5h3yfONzJWFjZfFklXcXFJdWbMxvb X-Received: by 2002:a17:902:e5c5:b0:1c0:aca0:8c2d with SMTP id u5-20020a170902e5c500b001c0aca08c2dmr14070368plf.67.1693220328434; Mon, 28 Aug 2023 03:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693220328; cv=none; d=google.com; s=arc-20160816; b=IfaaQFKQTRpD2vFDYL4YBsA4xfBqIlx1/sceetAChtY3VyQ9YjK8JI1UtpKvt8luy6 gVNmbP4Z3zn+ChTU/yLpnB3xK88ZtU/ZeyLuFE8o1NhI3cbKMxrE6E524xXnL3l/ysoJ +InTfaZTEtrWwTOyx6owXK8Y3rTW/lshqMk/o2YKC0PuXmhonqmYAb5MSiwjzz2fjuVc +oxucxlm/ZrSGYg+n8/HNSApgsDyAfHjORzGrONCx5/JdG8l4/v2Uv3m/GiKNS+4w7xX umDRB22YxMkttfIG1NGQjGjfbckrHN5EHBxGAImFhudE6Ns/SwqbFdrFdrb6CJOk8z4c dSxg== 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=/7l+yXX1f1M0T8fVhUGmH1XTl08b6+N5SmxoVbBqQxY=; fh=f/D0KJUUqEJI+w11XCowSved/IA8gS7qdr7ejcDj1CM=; b=KHlyhG9QMsA1AxQDXP/9AmbBWJQpszhRvUo8DITQLk///y4hcQ7YygDQ6Jh3ibvqID Rkz5bCopMJK06ezhB2J99VoMiY9rzUt8BeZ6QWKuGaJfdb+HpYiyKRpz9E8FpBWNl20K FKqjFoS7nHbT8eZ92TmhJL7s61G54YV8K1AJCzw1Cb6IatetBuZVwUID6d/99eOtu6B9 /f94wLhdyjeqiovubpu02VU0EAMPM27pivw8IjXQ4hcAW8ePNXW55E9qeNFzf6b82neA 4+EoSGde2336X28N5fC+LVWci5Re0LPGEitAyLHLLjO0ldntp5WJACur8Tg4WTrFkgS8 8cjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=b0W5P6iF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a17090332ca00b001b9e3a18270si1783766plr.420.2023.08.28.03.58.21; Mon, 28 Aug 2023 03:58:48 -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=fail header.i=@intel.com header.s=Intel header.b=b0W5P6iF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232286AbjH1K4c (ORCPT + 99 others); Mon, 28 Aug 2023 06:56:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232399AbjH1K4U (ORCPT ); Mon, 28 Aug 2023 06:56:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F81C19A; Mon, 28 Aug 2023 03:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693220121; x=1724756121; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UxKUOhuwkcSCEpW7Xpnp4lHioctyE1x03cSt4igskt4=; b=b0W5P6iFza4XakXzQXI+bRa5Pv0g+qLDgR7WUDi0YuZZm7TC482liD0P 80YBBd5jsAUXk+SrHchSxVzyWp8rolKJS731+CNXtKajdiNd2sV3QwJEK 0Nz47lXN4PqATSI6wlvG81MM225XZXX8+oEBbF8PnLsV3xndWsW5CbDxd pXs4tYEhsCEQU7kYaLo2uNpCObZ1DhghFFjI6+L+ajmvXQ+rIeeAqMYaj nzsZm/Ro6v1NdTcL66fXmRgpSgH7bHxCqZPmKqT+vP2/EOqQhrWQapJ9M 0dD9dZl2Ira1Joetusld17nk3rElki443eLMKoqVaTav4arCEN7rAJWuP w==; X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="355399043" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="355399043" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:51:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10815"; a="803658371" X-IronPort-AV: E=Sophos;i="6.02,207,1688454000"; d="scan'208";a="803658371" Received: from nwiklans-mobl.ger.corp.intel.com (HELO wieczorr-mobl1.intel.com) ([10.213.22.120]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Aug 2023 03:51:24 -0700 From: "Wieczor-Retman, Maciej" To: Paolo Bonzini , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, reinette.chatre@intel.com, "Wieczor-Retman, Maciej" , Wieczor-Retman@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] selftests/kvm: Replace attribute with macro Date: Mon, 28 Aug 2023 12:49:10 +0200 Message-ID: <82ed62dd7070203701b4ca326e62862404dd5f72.1693216959.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=-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775470198590441217 X-GMAIL-MSGID: 1775470198590441217 The __printf() macro is used in many tools in the linux kernel to validate the format specifiers in functions that use printf. Some selftests use it without putting it in a macro definition and some tests import the kselftests.h header. Use __printf() attribute instead of the full attribute since the macro is inside kselftests.h and the header is already imported. Signed-off-by: Wieczor-Retman, Maciej --- tools/testing/selftests/kvm/include/test_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h index a6e9f215ce70..710a8a78e8ce 100644 --- a/tools/testing/selftests/kvm/include/test_util.h +++ b/tools/testing/selftests/kvm/include/test_util.h @@ -33,7 +33,7 @@ static inline int _no_printf(const char *format, ...) { return 0; } #define pr_info(...) _no_printf(__VA_ARGS__) #endif -void print_skip(const char *fmt, ...) __attribute__((format(printf, 1, 2))); +void __printf(1, 2) print_skip(const char *fmt, ...); #define __TEST_REQUIRE(f, fmt, ...) \ do { \ if (!(f)) \