From 1c5fb0ebd8f3c4f669c768860438d2e1f176531a Mon Sep 17 00:00:00 2001 From: Carlos Llamas Date: Fri, 17 May 2024 17:06:20 +0000 Subject: [PATCH] ANDROID: binder: fix ptrdiff_t printk-format issue The correct printk format specifier when calculating buffer offsets should be "%tx" as it is a pointer difference (a.k.a ptrdiff_t). This fixes some W=1 build warnings reported by the kernel test robot. Bug: 329799092 Fixes: 63f7ddea2e48 ("ANDROID: binder: fix KMI-break due to address type change") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202401100511.A4BKMwoq-lkp@intel.com/ Change-Id: Iaa87433897b507c47fe8601464445cb6de4b61db Signed-off-by: Carlos Llamas --- drivers/android/binder.c | 2 +- drivers/android/binder_alloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 783d4e49cf6f..0f6b48dc5036 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -6256,7 +6256,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m, } if (buffer->target_node) seq_printf(m, " node %d", buffer->target_node->debug_id); - seq_printf(m, " size %zd:%zd offset %lx\n", + seq_printf(m, " size %zd:%zd offset %tx\n", buffer->data_size, buffer->offsets_size, proc->alloc.buffer - buffer->user_data); } diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index f42f5d62b72c..0efab3a35c38 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -983,7 +983,7 @@ void binder_alloc_print_allocated(struct seq_file *m, spin_lock(&alloc->lock); for (n = rb_first(&alloc->allocated_buffers); n; n = rb_next(n)) { buffer = rb_entry(n, struct binder_buffer, rb_node); - seq_printf(m, " buffer %d: %lx size %zd:%zd:%zd %s\n", + seq_printf(m, " buffer %d: %tx size %zd:%zd:%zd %s\n", buffer->debug_id, buffer->user_data - alloc->buffer, buffer->data_size, buffer->offsets_size,