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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401100511.A4BKMwoq-lkp@intel.com/
Change-Id: Iaa87433897b507c47fe8601464445cb6de4b61db
Signed-off-by: Carlos Llamas <cmllamas@google.com>
This commit is contained in:
Carlos Llamas 2024-05-17 17:06:20 +00:00
parent d30de4c7b0
commit 1c5fb0ebd8
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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,