]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kselftest/arm64: mte: fix printf type warnings about pointers
authorAndre Przywara <andre.przywara@arm.com>
Fri, 16 Aug 2024 15:32:50 +0000 (16:32 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 17 Oct 2024 17:54:17 +0000 (18:54 +0100)
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 <andre.przywara@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240816153251.2833702-8-andre.przywara@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/mte/check_buffer_fill.c
tools/testing/selftests/arm64/mte/mte_common_util.c

index 1dbbbd47dd501958dae58e4bc850422df87dcdff..2ee7f114d7fa87a592ced1da108747c35af3676e 100644 (file)
@@ -91,7 +91,7 @@ static int check_buffer_underflow_by_byte(int mem_type, int mode,
                for (j = 0; j < sizes[i]; j++) {
                        if (ptr[j] != '1') {
                                err = true;
-                               ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%lx\n",
+                               ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%p\n",
                                                j, ptr);
                                break;
                        }
@@ -189,7 +189,7 @@ static int check_buffer_overflow_by_byte(int mem_type, int mode,
                for (j = 0; j < sizes[i]; j++) {
                        if (ptr[j] != '1') {
                                err = true;
-                               ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%lx\n",
+                               ksft_print_msg("Buffer is not filled at index:%d of ptr:0x%p\n",
                                                j, ptr);
                                break;
                        }
index 9380edca29c7d9e8241f924e793e6004da7f4f4b..17fbe5cfe4724a2f6ea0c1b0d2cb32bd6766c1d9 100644 (file)
@@ -100,7 +100,7 @@ void *mte_insert_tags(void *ptr, size_t size)
        int align_size;
 
        if (!ptr || (unsigned long)(ptr) & MT_ALIGN_GRANULE) {
-               ksft_print_msg("FAIL: Addr=%lx: invalid\n", ptr);
+               ksft_print_msg("FAIL: Addr=%p: invalid\n", ptr);
                return NULL;
        }
        align_size = MT_ALIGN_UP(size);
@@ -112,7 +112,7 @@ void *mte_insert_tags(void *ptr, size_t size)
 void mte_clear_tags(void *ptr, size_t size)
 {
        if (!ptr || (unsigned long)(ptr) & MT_ALIGN_GRANULE) {
-               ksft_print_msg("FAIL: Addr=%lx: invalid\n", ptr);
+               ksft_print_msg("FAIL: Addr=%p: invalid\n", ptr);
                return;
        }
        size = MT_ALIGN_UP(size);