From patchwork Fri Sep 22 09:06:37 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: 13395380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B79BCCD4F35 for ; Fri, 22 Sep 2023 09:07:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229476AbjIVJHH (ORCPT ); Fri, 22 Sep 2023 05:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbjIVJHG (ORCPT ); Fri, 22 Sep 2023 05:07:06 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10001C2; Fri, 22 Sep 2023 02:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695373620; x=1726909620; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+bd+QBscp0NY6rRNQqvwBPLTBFFQn+H/2YyOTsEGJGY=; b=Di8dTY3fzyFEfjMpsUqNliSZUktVeYqKsStwcd0X6B2k28SoMo1NmdWb nZeuVpC6LVpKfgBOxHmFDLNl6kQ6kqGcC1K550ei/xOPnn1UWDl/X4i2E bSuC/pS/NR7tajbpHIg8HhATXn+NEvQnbPiq8CX+/HD6GcZmQwPP2npGU UrjbQW2is8WQ7HdEXbFg0OkpBFBAp9efPCwlmtGAgGLRb66a0p5Ba0536 rIxYMPBxiSfJ92mM7LjZgl9pScTup4O28p8N28K02UexVcDbvWahWqgbW KUxYht28yaTlJqwhvLhR4UwWDfrQN9rExkfqtSIy5e9QfaUxgpXCrk0Vp w==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070737" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070737" 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:06:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837663632" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837663632" 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:06:57 -0700 From: Maciej Wieczor-Retman To: Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/8] selftests: Add printf attribute to ksefltest prints Date: Fri, 22 Sep 2023 11:06:37 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Kselftest header defines multiple variadic functions 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 printf 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. Reviewed-by: Ilpo Järvinen Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Reinette Chatre --- 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 529d29a35900..f4c677b5d68f 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; @@ -143,7 +145,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; @@ -155,7 +157,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; @@ -169,7 +171,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; @@ -195,7 +197,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; @@ -209,7 +211,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; @@ -224,7 +226,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; @@ -271,7 +273,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; @@ -298,7 +300,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 Fri Sep 22 09:06:38 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: 13395381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB872CD4F35 for ; Fri, 22 Sep 2023 09:07:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232849AbjIVJHQ (ORCPT ); Fri, 22 Sep 2023 05:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbjIVJHM (ORCPT ); Fri, 22 Sep 2023 05:07:12 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C7E2C2; Fri, 22 Sep 2023 02:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695373626; x=1726909626; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NiX1MgvNmkNZTzkEVA0Rdibok7pwobd1aq2tL12Wxxg=; b=EnhaFLb/8k4POGxkVux0yGe5QbcH7cmrlsHwK2CFX3orOICjzN1h0VC4 rWD3JoswQahaKK75IW6MBPKUfimMrcVok5XaKsfB9gSOKM3yFfJ2AXyID UgTWOuexsTGOwycl+PV4SJ1JA1gIxRGxHoYKF0tBxUWkFMg6LXkPZdDKd DMObMo8quT2AyVXMvZi67doeq/ZUbdvtcYT5kMgwTX/BiWsMpAG5HnONz zmnwGqogKTkVjxUwEYwEXEs/2SC8Qmty0OM0qHnQ5CMDHxW14jFY65m03 zdsTHIAD4Hx87/lhPOO1pCz+V3AuNFkd0VaG/xSYi+mSiLsKiMrmSj8mp g==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070761" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070761" 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:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837663649" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837663649" 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:03 -0700 From: Maciej Wieczor-Retman To: Nhat Pham , Johannes Weiner , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/8] selftests/cachestat: Fix print_cachestat format Date: Fri, 22 Sep 2023 11:06:38 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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. Acked-by: Nhat Pham Signed-off-by: Maciej Wieczor-Retman --- Changelog v2: - Add Acked-by tag (Nhat) 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 4804c7dc7b31..b171fd53b004 100644 --- a/tools/testing/selftests/cachestat/test_cachestat.c +++ b/tools/testing/selftests/cachestat/test_cachestat.c @@ -27,7 +27,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 Fri Sep 22 09:06:39 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: 13395382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 380F8CD4F35 for ; Fri, 22 Sep 2023 09:07:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232839AbjIVJHW (ORCPT ); Fri, 22 Sep 2023 05:07:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232837AbjIVJHU (ORCPT ); Fri, 22 Sep 2023 05:07:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51605E8; Fri, 22 Sep 2023 02:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695373634; x=1726909634; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KlaAKoKuo0NKz+v+pcQZY3dMuGk4elrmUzP0ASroud8=; b=C8uSrl0aT1P8I5t3p60pD2N40VhIjQwxc1vODrx69jCv0/1ZfkIBJhLc vNCtfhT6U7ViDoM1tHNBO1AcqlCCF3HcHLeCvCFC9gkInw9dtaRCdKVex 4HYH4QPWjwOv4tc4p7CISDXzqiLPBKXjf1wILMFNaexqskdgqkzg3lzrT 28dq2B2/8vj/BF36IjzEWoCFkYp58qpPWe2RDiF/WGreyx4EL2MJOfbpJ Poovfsho4/WLjI/jyQJLAUXC17Rhnno8c6Z6ere24dHAvWMcA1RP0LCqY IP4yu9mTKv3I5VpZLrxOBnOZQrBwZKpFLrQpRHNZf9Quhq/KAdfInEpoZ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070799" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070799" 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:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837663676" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837663676" 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:10 -0700 From: Maciej Wieczor-Retman To: Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/8] selftests/openat2: Fix wrong format specifier Date: Fri, 22 Sep 2023 11:06:39 +0200 Message-ID: <6733bc42d9c4df87d13c1272e4ab69753fad9ab9.1695373131.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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. Reviewed-by: Ilpo Järvinen Signed-off-by: Maciej Wieczor-Retman --- Changelog v2: - Add Reviewed-by tag (Ilpo) 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 Fri Sep 22 09:06:40 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: 13395383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B8A9CD4F33 for ; Fri, 22 Sep 2023 09:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232858AbjIVJH2 (ORCPT ); Fri, 22 Sep 2023 05:07:28 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@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: 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); From patchwork Fri Sep 22 09:06:41 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: 13395384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ADF4CD4F33 for ; Fri, 22 Sep 2023 09:07:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232851AbjIVJHe (ORCPT ); Fri, 22 Sep 2023 05:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232864AbjIVJHd (ORCPT ); Fri, 22 Sep 2023 05:07:33 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49D05E8; Fri, 22 Sep 2023 02:07: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=1695373647; x=1726909647; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zojj109GZBbPxByigSVPb5D5ra85zAqBk8BYV5s4DvQ=; b=A1z9tSD16hX8tDDo/AaM4W72dIXKlBDfQGWf+a35ZuVvMsyxMmVpXQZu 0WdA4of7BS6NuV6T52PlFMKI4zHgO7gqsnrPrNzVjAP2rkrZYff3nkTi7 A8PrxKCmkvkmW+dHkkHmdOoFbDmhxeWfVcMkjDV7W8eAqxznK861A3nXS E1oYZoatrTP511x2W2zSdwPHAIRkI6+l9UkpblSHKzIljS4gf1xzjUEox JIY5Hsuwyvv2SrC4IHF1+M61+sgbC/q2UaD6+ggs8N1/mvdXld+oMMZCv eC93wkqf8Ffk4Q9HWrsQjaTcxZ367wH0t8yEJWHaC7pz/htU6XnknsmKR Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070874" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070874" 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:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837663857" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837663857" 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:25 -0700 From: Maciej Wieczor-Retman To: Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/8] selftests/sigaltstack: Fix wrong format specifier Date: Fri, 22 Sep 2023 11:06:41 +0200 Message-ID: <84fc912d23fec3d2a866df7a8f0a48665784fa8c.1695373131.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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. Reviewed-by: Ilpo Järvinen Signed-off-by: Maciej Wieczor-Retman --- Changelog v2: - Add Reviewed-by tag (Ilpo) 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 Fri Sep 22 09:06:42 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: 13395385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AED92CD4F33 for ; Fri, 22 Sep 2023 09:07:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232946AbjIVJH7 (ORCPT ); Fri, 22 Sep 2023 05:07:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232895AbjIVJHx (ORCPT ); Fri, 22 Sep 2023 05:07:53 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD6CFCD5; Fri, 22 Sep 2023 02:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695373665; x=1726909665; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w0rSpTX77wKswH6vd54/bHP7hpBLDH5K7yc41Vt6tdc=; b=To0Sf8hrdH/czv8Sxtzi9w12PM4OkJJRzREBuIMRYHcB5dKh2dpqfXYQ 7+oKhpQCMxvJH3R8ou5Zva4Xm1E5re9FRTHaOgZqZyeWwPj7vZRQ7JzGY aKqrVtPD+cI1ymSh0qXpy56CDiRKXqaJFluf0g0uSc4gHkRFsuMwMk9Mv SIxQ8fasMbGgz4NCgCoXFK9YCklviBqbs70uM11JE330jFdZ7vlwfSeGa F4qQeBMaKHxC0FSAlNBFth+BDGmTM8SFTiIdkzFqXRoUxgtveuSx/TPmY JEEBucZB+5dliMOmiGZR9fQBYgqIE9FSpp5+5V3yWsdez0rR7S4KKi0EZ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070903" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070903" 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:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837663935" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837663935" 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:38 -0700 From: Maciej Wieczor-Retman To: Paolo Bonzini , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/8] selftests/kvm: Replace attribute with macro Date: Fri, 22 Sep 2023 11:06:42 +0200 Message-ID: <99d54721208ed4f9ef302905f7e7fea76e895865.1695373131.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The __printf() macro is used in many tools in the linux kernel to validate the format specifiers in functions that use printf. The kvm selftest uses it without putting it in a macro definition while it also imports the kselftests.h header. Use __printf() from kselftests.h instead of the full attribute. Signed-off-by: Maciej Wieczor-Retman --- Changelog v2: - Reword patch message. - Use __printf() on test_assert(). tools/testing/selftests/kvm/include/test_util.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h index 7e614adc6cf4..8e5f413a593d 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)) \ @@ -46,9 +46,9 @@ ssize_t test_write(int fd, const void *buf, size_t count); ssize_t test_read(int fd, void *buf, size_t count); int test_seq_read(const char *path, char **bufp, size_t *sizep); -void test_assert(bool exp, const char *exp_str, - const char *file, unsigned int line, const char *fmt, ...) - __attribute__((format(printf, 5, 6))); +void __printf(5, 6) test_assert(bool exp, const char *exp_str, + const char *file, unsigned int line, + const char *fmt, ...); #define TEST_ASSERT(e, fmt, ...) \ test_assert((e), #e, __FILE__, __LINE__, fmt, ##__VA_ARGS__) From patchwork Fri Sep 22 09:06:43 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: 13395386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94D4FCD4F3B for ; Fri, 22 Sep 2023 09:08:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232922AbjIVJIC (ORCPT ); Fri, 22 Sep 2023 05:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232898AbjIVJHz (ORCPT ); Fri, 22 Sep 2023 05:07:55 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BAC5197; Fri, 22 Sep 2023 02:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695373668; x=1726909668; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Bdu41z44xg0Fpb+rhew4qBVoBtMMCUBJABN2/+5EZiI=; b=dm2ozLtKqJ0JkEouBiqDh8ZJpRfahXupL67sAyHRJaFAv1StZBswa/GW 5SBSLbpKr7aLwp+AMypsBH9OXwLwQ3EShzXWzTwospUtSiJ3z8QA7B5Bb faVB1s3yV+WTMbrgjzi3dDvsf1PvP3WsGuFhNMNu5dCOlRfMTSD9Wtft4 2Wu2mMKDirOLoaqwNN/97IiddQ/AgP2vzpENEOm6EdK2RjGvsUOe6xiuP BpDqHPh0ZwaccdeCxmN2fk9zeXHygKAG4lZAUX83OAqR7BiM8ZU687Q31 GvKu5r+LhD0iISA/lopKfVFNPWr8qliZbz6hgbZgbDwEs0e1CBvMbZ/GV w==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070925" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070925" 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:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837663993" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837663993" 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:45 -0700 From: Maciej Wieczor-Retman To: Andrew Morton , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/8] selftests/mm: Substitute attribute with a macro Date: Fri, 22 Sep 2023 11:06:43 +0200 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The mm selftest uses the printf attribute in its full form. Since the header file that uses it also includes kselftests.h it can use the macro defined there. Use __printf() included with kselftests.h instead of the full attribute. Fix a wrong format specifier in ksft_print_msg(). Signed-off-by: Maciej Wieczor-Retman --- Changelog v2: - Add this patch to the series. tools/testing/selftests/mm/mremap_test.c | 2 +- tools/testing/selftests/mm/pkey-helpers.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c index 5c3773de9f0f..1dbfcf6df255 100644 --- a/tools/testing/selftests/mm/mremap_test.c +++ b/tools/testing/selftests/mm/mremap_test.c @@ -338,7 +338,7 @@ static long long remap_region(struct config c, unsigned int threshold_mb, char c = (char) rand(); if (((char *) dest_addr)[i] != c) { - ksft_print_msg("Data after remap doesn't match at offset %d\n", + ksft_print_msg("Data after remap doesn't match at offset %llu\n", i); ksft_print_msg("Expected: %#x\t Got: %#x\n", c & 0xff, ((char *) dest_addr)[i] & 0xff); diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h index 92f3be3dd8e5..1af3156a9db8 100644 --- a/tools/testing/selftests/mm/pkey-helpers.h +++ b/tools/testing/selftests/mm/pkey-helpers.h @@ -34,7 +34,7 @@ extern int test_nr; extern int iteration_nr; #ifdef __GNUC__ -__attribute__((format(printf, 1, 2))) +__printf(1, 2) #endif static inline void sigsafe_printf(const char *format, ...) { From patchwork Fri Sep 22 09:06:44 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: 13395387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFBF5CD4F33 for ; Fri, 22 Sep 2023 09:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232996AbjIVJIP (ORCPT ); Fri, 22 Sep 2023 05:08:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232923AbjIVJIC (ORCPT ); Fri, 22 Sep 2023 05:08:02 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1526197; Fri, 22 Sep 2023 02:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695373677; x=1726909677; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fIfufOMVX6qOMz3hJ3V7MKHi5KE15rGIfodp2fmInKw=; b=eovIzkBa9VdzZXo9vZ/d8A3SfiyknOIgG8jJB3GUt+7BLlUOhR7633AP R/34funHYfnQZFOEGS+0VqblfF93vs6ozYcHEb7fA7SgGYUxO09bykveV n9s8e22w3+AhVAiv9Qjt0UyMGjtEp5EqsiXq91wIkyRPz3mo4V55RInFy Yw3hziaTnkwD6ePEHp7togl25bdFgKR2dnlsqT3oEEvL9uAhIwg5TvnG6 Ux8Wb35qCiB6tqHN4TCwmq5MgZ96SJi1EjAlgeTGAVWSBBa9Kf3vHkojS lWMOFF7dmBHzFEIneYOqbr16Z/QAywijSCO7zCsNjYJY6yUVZRX+jFm36 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="378070941" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="378070941" 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:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10840"; a="837664095" X-IronPort-AV: E=Sophos;i="6.03,167,1694761200"; d="scan'208";a="837664095" 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:54 -0700 From: Maciej Wieczor-Retman To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v3 8/8] selftests/resctrl: Fix wrong format specifier Date: Fri, 22 Sep 2023 11:06:44 +0200 Message-ID: <1545d7dfb7dd73a7bb2b28fe2f643b87421bf20c.1695373131.git.maciej.wieczor-retman@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org A long unsigned int variable is passed to the ksft_print_msg() and the format specifier used expects a variable of type int. Change the format specifier to match the passed variable. Reviewed-by: Ilpo Järvinen Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Reinette Chatre --- Changelog v3: - Add Reviewed-by tag. (Ilpo) Changelog v2: - Add this patch to the series. tools/testing/selftests/resctrl/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c index d3cbb829ff6a..a5d082cd2d53 100644 --- a/tools/testing/selftests/resctrl/cache.c +++ b/tools/testing/selftests/resctrl/cache.c @@ -294,7 +294,7 @@ int show_cache_info(unsigned long sum_llc_val, int no_of_bits, ret = platform && abs((int)diff_percent) > max_diff_percent && (cmt ? (abs(avg_diff) > max_diff) : true); - ksft_print_msg("%s Check cache miss rate within %d%%\n", + ksft_print_msg("%s Check cache miss rate within %lu%%\n", ret ? "Fail:" : "Pass:", max_diff_percent); ksft_print_msg("Percent diff=%d\n", abs((int)diff_percent));