UPSTREAM: binder: collapse print_binder_buffer() into caller

The code in print_binder_buffer() is quite small so it can be collapsed
into its single caller binder_alloc_print_allocated().

No functional change in this patch.

Signed-off-by: Carlos Llamas <cmllamas@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-25-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 254650075
(cherry picked from commit 8e905217c4543af9cf1754809846157a7dbbb261)
Change-Id: Ic3e2522b4702e60e09be3d5940f88ec8252ac793
Signed-off-by: Carlos Llamas <cmllamas@google.com>
This commit is contained in:
Carlos Llamas
2023-12-01 17:21:53 +00:00
parent baef4637fc
commit aacaa36eaa

View File

@@ -978,16 +978,6 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)
__func__, alloc->pid, buffers, page_count); __func__, alloc->pid, buffers, page_count);
} }
static void print_binder_buffer(struct seq_file *m, const char *prefix,
struct binder_buffer *buffer)
{
seq_printf(m, "%s %d: %lx size %zd:%zd:%zd %s\n",
prefix, buffer->debug_id, buffer->user_data,
buffer->data_size, buffer->offsets_size,
buffer->extra_buffers_size,
buffer->transaction ? "active" : "delivered");
}
/** /**
* binder_alloc_print_allocated() - print buffer info * binder_alloc_print_allocated() - print buffer info
* @m: seq_file for output via seq_printf() * @m: seq_file for output via seq_printf()
@@ -999,12 +989,18 @@ static void print_binder_buffer(struct seq_file *m, const char *prefix,
void binder_alloc_print_allocated(struct seq_file *m, void binder_alloc_print_allocated(struct seq_file *m,
struct binder_alloc *alloc) struct binder_alloc *alloc)
{ {
struct binder_buffer *buffer;
struct rb_node *n; struct rb_node *n;
mutex_lock(&alloc->mutex); mutex_lock(&alloc->mutex);
for (n = rb_first(&alloc->allocated_buffers); n != NULL; n = rb_next(n)) for (n = rb_first(&alloc->allocated_buffers); n; n = rb_next(n)) {
print_binder_buffer(m, " buffer", buffer = rb_entry(n, struct binder_buffer, rb_node);
rb_entry(n, struct binder_buffer, rb_node)); seq_printf(m, " buffer %d: %lx size %zd:%zd:%zd %s\n",
buffer->debug_id, buffer->user_data,
buffer->data_size, buffer->offsets_size,
buffer->extra_buffers_size,
buffer->transaction ? "active" : "delivered");
}
mutex_unlock(&alloc->mutex); mutex_unlock(&alloc->mutex);
} }