Skip to content

Commit d3772e7

Browse files
maciejwieczorretmanshuahkh
authored andcommitted
selftests/mm: Substitute attribute with a macro
Compiling mm selftest after adding a __printf() attribute to ksft_print_msg() exposes -Wformat warning in remap_region(). Fix the wrong format specifier causing the warning. 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. Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 07bd3c3 commit d3772e7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tools/testing/selftests/mm/mremap_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static long long remap_region(struct config c, unsigned int threshold_mb,
338338
char c = (char) rand();
339339

340340
if (((char *) dest_addr)[i] != c) {
341-
ksft_print_msg("Data after remap doesn't match at offset %d\n",
341+
ksft_print_msg("Data after remap doesn't match at offset %llu\n",
342342
i);
343343
ksft_print_msg("Expected: %#x\t Got: %#x\n", c & 0xff,
344344
((char *) dest_addr)[i] & 0xff);

tools/testing/selftests/mm/pkey-helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern int test_nr;
3434
extern int iteration_nr;
3535

3636
#ifdef __GNUC__
37-
__attribute__((format(printf, 1, 2)))
37+
__printf(1, 2)
3838
#endif
3939
static inline void sigsafe_printf(const char *format, ...)
4040
{

0 commit comments

Comments
 (0)