ion: fix printk warnings
authorColin Cross <ccross@android.com>
Thu, 19 Sep 2013 14:20:23 +0000 (09:20 -0500)
committerColin Cross <ccross@android.com>
Thu, 12 Dec 2013 23:27:05 +0000 (15:27 -0800)
Use %z for size_t and %pa for dma_addr_t to avoid warnings in printks.

Change-Id: I2c72874acd0b69cb35fca691928783817deb9394
Signed-off-by: Colin Cross <ccross@android.com>
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/ion_chunk_heap.c
drivers/staging/android/ion/ion_cma_heap.c
drivers/staging/android/ion/ion_heap.c

index 80c79455c36e598ff31042317aad178c0128afc3..371b04f80a24b43023246b15767b0aba123f4518 100644 (file)
@@ -471,7 +471,7 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len,
        struct ion_heap *heap;
        int ret;
 
-       pr_debug("%s: len %d align %d heap_id_mask %u flags %x\n", __func__,
+       pr_debug("%s: len %zu align %zu heap_id_mask %u flags %x\n", __func__,
                 len, align, heap_id_mask, flags);
        /*
         * traverse the list of heaps available in this system in priority
@@ -688,7 +688,7 @@ static int ion_debug_client_show(struct seq_file *s, void *unused)
        for (i = 0; i < ION_NUM_HEAP_IDS; i++) {
                if (!names[i])
                        continue;
-               seq_printf(s, "%16.16s: %16u\n", names[i], sizes[i]);
+               seq_printf(s, "%16.16s: %16zu\n", names[i], sizes[i]);
        }
        return 0;
 }
@@ -1336,10 +1336,10 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
                        char task_comm[TASK_COMM_LEN];
 
                        get_task_comm(task_comm, client->task);
-                       seq_printf(s, "%16.s %16u %16u\n", task_comm,
+                       seq_printf(s, "%16.s %16u %16zu\n", task_comm,
                                   client->pid, size);
                } else {
-                       seq_printf(s, "%16.s %16u %16u\n", client->name,
+                       seq_printf(s, "%16.s %16u %16zu\n", client->name,
                                   client->pid, size);
                }
        }
@@ -1354,19 +1354,20 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
                        continue;
                total_size += buffer->size;
                if (!buffer->handle_count) {
-                       seq_printf(s, "%16.s %16u %16u %d %d\n", buffer->task_comm,
-                                  buffer->pid, buffer->size, buffer->kmap_cnt,
+                       seq_printf(s, "%16.s %16u %16zu %d %d\n",
+                                  buffer->task_comm, buffer->pid,
+                                  buffer->size, buffer->kmap_cnt,
                                   atomic_read(&buffer->ref.refcount));
                        total_orphaned_size += buffer->size;
                }
        }
        mutex_unlock(&dev->buffer_lock);
        seq_printf(s, "----------------------------------------------------\n");
-       seq_printf(s, "%16.s %16u\n", "total orphaned",
+       seq_printf(s, "%16.s %16zu\n", "total orphaned",
                   total_orphaned_size);
-       seq_printf(s, "%16.s %16u\n", "total ", total_size);
+       seq_printf(s, "%16.s %16zu\n", "total ", total_size);
        if (heap->flags & ION_HEAP_FLAG_DEFER_FREE)
-               seq_printf(s, "%16.s %16u\n", "deferred free",
+               seq_printf(s, "%16.s %16zu\n", "deferred free",
                                heap->free_list_size);
        seq_printf(s, "----------------------------------------------------\n");
 
@@ -1522,11 +1523,11 @@ void __init ion_reserve(struct ion_platform_data *data)
                        int ret = memblock_reserve(data->heaps[i].base,
                                               data->heaps[i].size);
                        if (ret)
-                               pr_err("memblock reserve of %x@%lx failed\n",
+                               pr_err("memblock reserve of %zx@%lx failed\n",
                                       data->heaps[i].size,
                                       data->heaps[i].base);
                }
-               pr_info("%s: %s reserved base %lx size %d\n", __func__,
+               pr_info("%s: %s reserved base %lx size %zu\n", __func__,
                        data->heaps[i].name,
                        data->heaps[i].base,
                        data->heaps[i].size);
index e17b6016db54d7fcf00cb2c9ca455e4d8a6193a1..60952a8aa795eb15b7daa9e5038949117a4ac932 100644 (file)
@@ -186,7 +186,7 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data)
        chunk_heap->heap.ops = &chunk_heap_ops;
        chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK;
        chunk_heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE;
-       pr_info("%s: base %lu size %u align %ld\n", __func__, chunk_heap->base,
+       pr_info("%s: base %lu size %zu align %ld\n", __func__, chunk_heap->base,
                heap_data->size, heap_data->align);
 
        return &chunk_heap->heap;
index 55d6003f546c6fa7ed9567ebc6b4d0cbdd42da8a..f8a8090bf89a35ad2055d3b3ee26db47df36e435 100644 (file)
@@ -128,8 +128,8 @@ static int ion_cma_phys(struct ion_heap *heap, struct ion_buffer *buffer,
        struct device *dev = cma_heap->dev;
        struct ion_cma_buffer_info *info = buffer->priv_virt;
 
-       dev_dbg(dev, "Return buffer %p physical address 0x%x\n", buffer,
-               info->handle);
+       dev_dbg(dev, "Return buffer %p physical address 0x%pa\n", buffer,
+               &info->handle);
 
        *addr = info->handle;
        *len = buffer->size;
index f32f4e69765a34e231ad4a2fe1eee1d1a8792562..5a93a0273faac048839d39724cf7a9de5339ac9c 100644 (file)
@@ -281,7 +281,7 @@ struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data)
        }
 
        if (IS_ERR_OR_NULL(heap)) {
-               pr_err("%s: error creating heap %s type %d base %lu size %u\n",
+               pr_err("%s: error creating heap %s type %d base %lu size %zu\n",
                       __func__, heap_data->name, heap_data->type,
                       heap_data->base, heap_data->size);
                return ERR_PTR(-EINVAL);