All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: Andrew Morton <akpm@linux-foundation.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 v5 7/8] selftests/mm: Substitute attribute with a macro
Date: Wed, 11 Oct 2023 10:24:03 +0200	[thread overview]
Message-ID: <d16a1133184abc898797b70c7021a751406df81e.1697012398.git.maciej.wieczor-retman@intel.com> (raw)
In-Reply-To: <cover.1697012398.git.maciej.wieczor-retman@intel.com>

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 <maciej.wieczor-retman@intel.com>
---
Changelog v2:
- Added 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, ...)
 {
-- 
2.42.0


  parent reply	other threads:[~2023-10-11  8:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11  8:23 [PATCH v5 0/8] Add printf attribute to kselftest functions Maciej Wieczor-Retman
2023-10-11  8:23 ` [PATCH v5 1/8] selftests: Add printf attribute to kselftest prints Maciej Wieczor-Retman
2023-10-11 19:40   ` Shuah
2023-10-12  7:32     ` Maciej Wieczór-Retman
2023-10-12 13:06       ` Ilpo Järvinen
2023-10-12 14:30       ` Shuah Khan
2023-10-13 11:41         ` Maciej Wieczór-Retman
2023-10-11  8:23 ` [PATCH v5 2/8] selftests/cachestat: Fix print_cachestat format Maciej Wieczor-Retman
2023-10-11  8:23 ` [PATCH v5 3/8] selftests/openat2: Fix wrong format specifier Maciej Wieczor-Retman
2023-10-11  8:24 ` [PATCH v5 4/8] selftests/pidfd: Fix ksft print formats Maciej Wieczor-Retman
2023-10-11  8:24 ` [PATCH v5 5/8] selftests/sigaltstack: Fix wrong format specifier Maciej Wieczor-Retman
2023-10-11  8:24 ` [PATCH v5 6/8] selftests/kvm: Replace attribute with macro Maciej Wieczor-Retman
2023-10-11  8:24 ` Maciej Wieczor-Retman [this message]
2023-10-11  8:24 ` [PATCH v5 8/8] selftests/resctrl: Fix wrong format specifier Maciej Wieczor-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=d16a1133184abc898797b70c7021a751406df81e.1697012398.git.maciej.wieczor-retman@intel.com \
    --to=maciej.wieczor-retman@intel.com \
    --cc=akpm@linux-foundation.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=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.