binder: Replace "%p" with "%pK" for stable
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Wed, 29 May 2019 17:02:44 +0000 (18:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2019 10:22:44 +0000 (12:22 +0200)
This was done as part of upstream commits fdfb4a99b6ab "8inder:
separate binder allocator structure from binder proc", 19c987241ca1
"binder: separate out binder_alloc functions", and 7a4408c6bd3e
"binder: make sure accesses to proc/thread are safe".  However, those
commits made lots of other changes that are not suitable for stable.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c

index 80499f421a296b3e743e8135e427e78570d32487..b8ce035836bedcffa1eb79a994ad2ab19e36975a 100644 (file)
@@ -488,7 +488,7 @@ static void binder_insert_free_buffer(struct binder_proc *proc,
        new_buffer_size = binder_buffer_size(proc, new_buffer);
 
        binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                    "%d: add free buffer, size %zd, at %p\n",
+                    "%d: add free buffer, size %zd, at %pK\n",
                      proc->pid, new_buffer_size, new_buffer);
 
        while (*p) {
@@ -566,7 +566,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate,
        struct mm_struct *mm;
 
        binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                    "%d: %s pages %p-%p\n", proc->pid,
+                    "%d: %s pages %pK-%pK\n", proc->pid,
                     allocate ? "allocate" : "free", start, end);
 
        if (end <= start)
@@ -606,7 +606,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate,
                BUG_ON(*page);
                *page = alloc_page(GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO);
                if (*page == NULL) {
-                       pr_err("%d: binder_alloc_buf failed for page at %p\n",
+                       pr_err("%d: binder_alloc_buf failed for page at %pK\n",
                                proc->pid, page_addr);
                        goto err_alloc_page_failed;
                }
@@ -615,7 +615,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate,
                flush_cache_vmap((unsigned long)page_addr,
                                (unsigned long)page_addr + PAGE_SIZE);
                if (ret != 1) {
-                       pr_err("%d: binder_alloc_buf failed to map page at %p in kernel\n",
+                       pr_err("%d: binder_alloc_buf failed to map page at %pK in kernel\n",
                               proc->pid, page_addr);
                        goto err_map_kernel_failed;
                }
@@ -719,7 +719,7 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
        }
 
        binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                    "%d: binder_alloc_buf size %zd got buffer %p size %zd\n",
+                    "%d: binder_alloc_buf size %zd got buffer %pK size %zd\n",
                      proc->pid, size, buffer, buffer_size);
 
        has_page_addr =
@@ -749,7 +749,7 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
                binder_insert_free_buffer(proc, new_buffer);
        }
        binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                    "%d: binder_alloc_buf size %zd got %p\n",
+                    "%d: binder_alloc_buf size %zd got %pK\n",
                      proc->pid, size, buffer);
        buffer->data_size = data_size;
        buffer->offsets_size = offsets_size;
@@ -789,7 +789,7 @@ static void binder_delete_free_buffer(struct binder_proc *proc,
                if (buffer_end_page(prev) == buffer_end_page(buffer))
                        free_page_end = 0;
                binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                            "%d: merge free, buffer %p share page with %p\n",
+                            "%d: merge free, buffer %pK share page with %pK\n",
                              proc->pid, buffer, prev);
        }
 
@@ -802,14 +802,14 @@ static void binder_delete_free_buffer(struct binder_proc *proc,
                            buffer_start_page(buffer))
                                free_page_start = 0;
                        binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                                    "%d: merge free, buffer %p share page with %p\n",
+                                    "%d: merge free, buffer %pK share page with %pK\n",
                                      proc->pid, buffer, prev);
                }
        }
        list_del(&buffer->entry);
        if (free_page_start || free_page_end) {
                binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                            "%d: merge free, buffer %p do not share page%s%s with %p or %p\n",
+                            "%d: merge free, buffer %pK do not share page%s%s with %pK or %pK\n",
                             proc->pid, buffer, free_page_start ? "" : " end",
                             free_page_end ? "" : " start", prev, next);
                binder_update_page_range(proc, 0, free_page_start ?
@@ -830,7 +830,7 @@ static void binder_free_buf(struct binder_proc *proc,
                ALIGN(buffer->offsets_size, sizeof(void *));
 
        binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                    "%d: binder_free_buf %p size %zd buffer_size %zd\n",
+                    "%d: binder_free_buf %pK size %zd buffer_size %zd\n",
                      proc->pid, buffer, size, buffer_size);
 
        BUG_ON(buffer->free);
@@ -2930,7 +2930,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
 #ifdef CONFIG_CPU_CACHE_VIPT
        if (cache_is_vipt_aliasing()) {
                while (CACHE_COLOUR((vma->vm_start ^ (uint32_t)proc->buffer))) {
-                       pr_info("binder_mmap: %d %lx-%lx maps %p bad alignment\n", proc->pid, vma->vm_start, vma->vm_end, proc->buffer);
+                       pr_info("binder_mmap: %d %lx-%lx maps %pK bad alignment\n", proc->pid, vma->vm_start, vma->vm_end, proc->buffer);
                        vma->vm_start += PAGE_SIZE;
                }
        }
@@ -3191,7 +3191,7 @@ static void binder_deferred_release(struct binder_proc *proc)
 
                        page_addr = proc->buffer + i * PAGE_SIZE;
                        binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
-                                    "%s: %d: page %d at %p not freed\n",
+                                    "%s: %d: page %d at %pK not freed\n",
                                     __func__, proc->pid, i, page_addr);
                        unmap_kernel_range((unsigned long)page_addr, PAGE_SIZE);
                        __free_page(proc->pages[i]);
@@ -3294,7 +3294,7 @@ static void print_binder_transaction(struct seq_file *m, const char *prefix,
 static void print_binder_buffer(struct seq_file *m, const char *prefix,
                                struct binder_buffer *buffer)
 {
-       seq_printf(m, "%s %d: %p size %zd:%zd %s\n",
+       seq_printf(m, "%s %d: %pK size %zd:%zd %s\n",
                   prefix, buffer->debug_id, buffer->data,
                   buffer->data_size, buffer->offsets_size,
                   buffer->transaction ? "active" : "delivered");
@@ -3397,7 +3397,7 @@ static void print_binder_node(struct seq_file *m, struct binder_node *node)
 
 static void print_binder_ref(struct seq_file *m, struct binder_ref *ref)
 {
-       seq_printf(m, "  ref %d: desc %d %snode %d s %d w %d d %p\n",
+       seq_printf(m, "  ref %d: desc %d %snode %d s %d w %d d %pK\n",
                   ref->debug_id, ref->desc, ref->node->proc ? "" : "dead ",
                   ref->node->debug_id, ref->strong, ref->weak, ref->death);
 }