Skip to content

Commit 4716f71

Browse files
Andre-ARMctmarinas
authored andcommitted
kselftest/arm64: mte: fix printf type warnings about pointers
When printing the value of a pointer, we should not use an integer format specifier, but the dedicated "%p" instead. Signed-off-by: Andre Przywara <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 7e893dc commit 4716f71

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/testing/selftests/arm64/mte/check_buffer_fill.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static int check_buffer_underflow_by_byte(int mem_type, int mode,
9191
for (j = 0; j < sizes[i]; j++) {
9292
if (ptr[j] != '1') {
9393
err = true;
94-
ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%lx\n",
94+
ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%p\n",
9595
j, ptr);
9696
break;
9797
}
@@ -189,7 +189,7 @@ static int check_buffer_overflow_by_byte(int mem_type, int mode,
189189
for (j = 0; j < sizes[i]; j++) {
190190
if (ptr[j] != '1') {
191191
err = true;
192-
ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%lx\n",
192+
ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%p\n",
193193
j, ptr);
194194
break;
195195
}

tools/testing/selftests/arm64/mte/mte_common_util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void *mte_insert_tags(void *ptr, size_t size)
100100
int align_size;
101101

102102
if (!ptr || (unsigned long)(ptr) & MT_ALIGN_GRANULE) {
103-
ksft_print_msg("FAIL: Addr=%lx: invalid\n", ptr);
103+
ksft_print_msg("FAIL: Addr=%p: invalid\n", ptr);
104104
return NULL;
105105
}
106106
align_size = MT_ALIGN_UP(size);
@@ -112,7 +112,7 @@ void *mte_insert_tags(void *ptr, size_t size)
112112
void mte_clear_tags(void *ptr, size_t size)
113113
{
114114
if (!ptr || (unsigned long)(ptr) & MT_ALIGN_GRANULE) {
115-
ksft_print_msg("FAIL: Addr=%lx: invalid\n", ptr);
115+
ksft_print_msg("FAIL: Addr=%p: invalid\n", ptr);
116116
return;
117117
}
118118
size = MT_ALIGN_UP(size);

0 commit comments

Comments
 (0)