All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: Nhat Pham <nphamcs@gmail.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Shuah Khan <shuah@kernel.org>
Cc: ilpo.jarvinen@linux.intel.com, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v6 2/8] selftests/cachestat: Fix print_cachestat format
Date: Fri, 13 Oct 2023 13:36:26 +0200	[thread overview]
Message-ID: <0988d25d89523ba21307f70a265cd5446ae15d4d.1697196663.git.maciej.wieczor-retman@intel.com> (raw)
In-Reply-To: <cover.1697196663.git.maciej.wieczor-retman@intel.com>

Compiling cachestat selftest after adding a __printf() attribute to
ksft_print_msg() exposes a -Wformat warning in print_cachestat().
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: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Acked-by: Nhat Pham <nphamcs@gmail.com>
---
Changelog v6:
- Add an explanation to the patch message on how the warnings that the
  patch resolves were caught. (Shuah)

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);
 }
-- 
2.42.0


  parent reply	other threads:[~2023-10-13 11:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13 11:36 [PATCH v6 0/8] Add printf attribute to kselftest functions Maciej Wieczor-Retman
2023-10-13 11:36 ` [PATCH v6 1/8] selftests: Add printf attribute to kselftest prints Maciej Wieczor-Retman
2023-10-13 11:36 ` Maciej Wieczor-Retman [this message]
2023-10-13 11:36 ` [PATCH v6 3/8] selftests/openat2: Fix wrong format specifier Maciej Wieczor-Retman
2023-10-13 11:36 ` [PATCH v6 4/8] selftests/pidfd: Fix ksft print formats Maciej Wieczor-Retman
2023-10-13 11:36 ` [PATCH v6 5/8] selftests/sigaltstack: Fix wrong format specifier Maciej Wieczor-Retman
2023-10-13 11:36 ` [PATCH v6 6/8] selftests/kvm: Replace attribute with macro Maciej Wieczor-Retman
2023-10-13 11:36 ` [PATCH v6 7/8] selftests/mm: Substitute attribute with a macro Maciej Wieczor-Retman
2023-10-13 11:36 ` [PATCH v6 8/8] selftests/resctrl: Fix wrong format specifier Maciej Wieczor-Retman
2023-10-13 21:03 ` [PATCH v6 0/8] Add printf attribute to kselftest functions Shuah
2023-10-13 21:08   ` Reinette Chatre
2023-10-16  5:28   ` Maciej Wieczór-Retman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0988d25d89523ba21307f70a265cd5446ae15d4d.1697196663.git.maciej.wieczor-retman@intel.com \
    --to=maciej.wieczor-retman@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.