mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: John Stultz <john.stultz@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Android Kernel Team <kernel-team@android.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Jesse Barker <jesse.barker@arm.com>,
	Colin Cross <ccross@android.com>
Subject: Re: [PATCH 094/115] ion: fix printk warnings
Date: Fri, 13 Dec 2013 20:27:35 -0800	[thread overview]
Message-ID: <1386995255.2276.1.camel@joe-AO722> (raw)
In-Reply-To: <1386991595-6251-2-git-send-email-john.stultz@linaro.org>

On Fri, 2013-12-13 at 19:26 -0800, John Stultz wrote:
> From: Colin Cross <ccross@android.com>
> 
> Use %z for size_t and %pa for dma_addr_t to avoid warnings in printks.

dma_addr_t is not a phys_addr_t and should _not_ be emitted
with %pa.

Until %pad is in -next, use %lx, (unsigned long long)dma_addr_t.

> Signed-off-by: Colin Cross <ccross@android.com>
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
>  drivers/staging/android/ion/ion.c            | 23 ++++++++++++-----------
>  drivers/staging/android/ion/ion_chunk_heap.c |  2 +-
>  drivers/staging/android/ion/ion_cma_heap.c   |  4 ++--
>  drivers/staging/android/ion/ion_heap.c       |  2 +-
>  4 files changed, 16 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index 199ab9a..57698e6 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -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);
> diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c
> index fb1a7b9..4eacf52 100644
> --- a/drivers/staging/android/ion/ion_chunk_heap.c
> +++ b/drivers/staging/android/ion/ion_chunk_heap.c
> @@ -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;
> diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c
> index 86b6cf5..1e308a0 100644
> --- a/drivers/staging/android/ion/ion_cma_heap.c
> +++ b/drivers/staging/android/ion/ion_cma_heap.c
> @@ -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;
> diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c
> index a5a7c572..deaab7c 100644
> --- a/drivers/staging/android/ion/ion_heap.c
> +++ b/drivers/staging/android/ion/ion_heap.c
> @@ -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);




  reply	other threads:[~2013-12-14  4:27 UTC|newest]

Thread overview: 134+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 22:23 [PATCH 000/115] Android ION for drivers/staging John Stultz
2013-12-13 22:23 ` [PATCH 001/115] gpu: ion: Add ION Memory Manager John Stultz
2013-12-13 23:50   ` Greg KH
2013-12-13 23:54     ` John Stultz
2013-12-14  0:53       ` John Stultz
2013-12-14  1:18     ` John Stultz
2013-12-14 17:06       ` Greg KH
2013-12-14 19:43         ` John Stultz
2013-12-14 19:53           ` John Stultz
2013-12-14 20:06         ` [PATCH 1/2] ion: Don't allow building ION as a module John Stultz
2013-12-14 20:06           ` [PATCH 2/2] ion: Reenable the build John Stultz
2013-12-14 21:48           ` [PATCH 1/2] ion: Don't allow building ION as a module Greg KH
2013-12-14 22:19             ` John Stultz
2013-12-14 23:15               ` Colin Cross
2013-12-14 16:52   ` [PATCH 001/115] gpu: ion: Add ION Memory Manager Greg KH
2013-12-14 21:10     ` Colin Cross
2013-12-14 21:44       ` Greg KH
2013-12-14 22:21         ` Colin Cross
2013-12-14 23:14           ` Greg KH
2013-12-13 22:23 ` [PATCH 002/115] gpu: ion: ion_carveout_heap: fix for 3.4 John Stultz
2013-12-13 22:23 ` [PATCH 003/115] ion: Switch map/unmap dma api to sg_tables John Stultz
2013-12-13 22:23 ` [PATCH 004/115] ion: Add reserve function to ion John Stultz
2013-12-13 22:23 ` [PATCH 005/115] gpu: ion: several bugfixes and enhancements of ION John Stultz
2013-12-13 22:23 ` [PATCH 006/115] ion: Switch ion to use dma-buf John Stultz
2013-12-13 22:23 ` [PATCH 007/115] gpu: ion: Use alloc_pages instead of vmalloc from the system heap John Stultz
2013-12-13 22:23 ` [PATCH 008/115] gpu: ion: support begin/end and kmap/kunmap dma_buf ops John Stultz
2013-12-13 22:23 ` [PATCH 009/115] gpu: ion: Allocate the sg_table at creation time rather than dynamically John Stultz
2013-12-13 22:23 ` [PATCH 010/115] gpu: ion: Get an sg_table from an ion handle John Stultz
2013-12-13 22:23 ` [PATCH 011/115] gpu: ion: fill in buffer->{dev,size} before mapping new buffers John Stultz
2013-12-13 22:23 ` [PATCH 012/115] gpu: ion: Set the dma_address of the sg list at alloc time John Stultz
2013-12-13 22:23 ` [PATCH 013/115] gpu: ion: ion_system_heap: Change allocations to GFP_HIGHUSER John Stultz
2013-12-13 22:23 ` [PATCH 014/115] gpu: ion: Loop on the handle count when destroying John Stultz
2013-12-13 22:23 ` [PATCH 015/115] gpu: ion: Map only the vma size given John Stultz
2013-12-13 22:23 ` [PATCH 016/115] gpu: ion: Add cache maintenance to ion John Stultz
2013-12-13 22:23 ` [PATCH 017/115] gpu: ion: Modify the system heap to try to allocate large/huge pages John Stultz
2013-12-13 22:23 ` [PATCH 018/115] gpu: ion: Add explicit sync ioctl John Stultz
2013-12-13 22:23 ` [PATCH 019/115] gpu: ion: do not ask for compound pages in system heap John Stultz
2013-12-13 22:23 ` [PATCH 020/115] gpu: ion: Add missing argument to WARN call John Stultz
2013-12-13 22:23 ` [PATCH 021/115] gpu: ion: Add EXPORT_SYMBOL to functions John Stultz
2013-12-13 22:23 ` [PATCH 022/115] gpu: ion: IOCTL return success when error occurs John Stultz
2013-12-13 22:23 ` [PATCH 023/115] gpu: ion: Don't call ion_buffer_put on error path John Stultz
2013-12-13 22:23 ` [PATCH 024/115] gpu: ion: Only map as much of the vma as the user requested John Stultz
2013-12-13 22:23 ` [PATCH 025/115] gpu: ion: Switch to using kmalloc rather than kmap during allocation John Stultz
2013-12-13 22:24 ` [PATCH 026/115] gpu: ion: fix page offset in dma_buf_kmap() John Stultz
2013-12-13 22:24 ` [PATCH 027/115] gpu: ion: Fix race between ion_import and ion_free John Stultz
2013-12-13 22:24 ` [PATCH 028/115] gpu: ion: Fix bug in ion_free John Stultz
2013-12-13 22:24 ` [PATCH 029/115] gpu: ion: Add debug information for orphaned handles John Stultz
2013-12-13 22:24 ` [PATCH 030/115] gpu: ion: Fix memory leak of dirty bits John Stultz
2013-12-13 22:24 ` [PATCH 031/115] gpu: ion: Add support for cached mappings that don't fault John Stultz
2013-12-13 22:24 ` [PATCH 032/115] gpu: ion: optimize system heap for non fault buffers John Stultz
2013-12-13 22:24 ` [PATCH 033/115] gpu: ion: Stop trying to allocate from an order on first failure John Stultz
2013-12-13 22:24 ` [PATCH 034/115] gpu: ion: ion_system_heap: Fix bug preventing compilation John Stultz
2013-12-13 22:24 ` [PATCH 035/115] gpu: ion: use vmalloc to allocate page array to map kernel John Stultz
2013-12-13 22:24 ` [PATCH 036/115] gpu: ion: Add ion_page_pool John Stultz
2013-12-13 22:24 ` [PATCH 037/115] gpu: ion: Use the ion_page_pool from the system heap John Stultz
2013-12-13 22:24 ` [PATCH 038/115] gpu: ion: Modify gfp flags in ion_system_heap John Stultz
2013-12-13 22:24 ` [PATCH 039/115] gpu: ion: Fix several issues with page pool John Stultz
2013-12-13 22:24 ` [PATCH 040/115] gpu: ion: Fix lockdep issue in ion_page_pool John Stultz
2013-12-13 22:24 ` [PATCH 041/115] gpu: ion: Switch to using a single shrink function John Stultz
2013-12-13 22:24 ` [PATCH 042/115] gpu: ion: Refactor locking John Stultz
2013-12-13 22:24 ` [PATCH 043/115] gpu: ion: Clear GFP_WAIT flag on high order allocations John Stultz
2013-12-13 22:24 ` [PATCH 044/115] gpu: ion: Don't flush allocatoins that come from the page pools John Stultz
2013-12-13 22:24 ` [PATCH 045/115] gpu: ion: Fix bug in ion_system_heap map_user John Stultz
2013-12-13 22:24 ` [PATCH 046/115] gpu: ion: Fix bug in zeroing pages in system heap John Stultz
2013-12-13 22:24 ` [PATCH 047/115] gpu: ion: fix carveout ops John Stultz
2013-12-13 22:24 ` [PATCH 048/115] gpu: ion: fix compilation warning John Stultz
2013-12-13 22:24 ` [PATCH 049/115] gpu: ion: Modify reserve function for carveouts with no start address John Stultz
2013-12-13 22:24 ` [PATCH 050/115] gpu: ion: Fix bug where MAP ioctl was no longer supported John Stultz
2013-12-13 22:24 ` [PATCH 051/115] gpu: ion: Switch heap rbtree to a prio list John Stultz
2013-12-13 22:24 ` [PATCH 052/115] gpu: ion: Refactor common mapping functions out of system heap John Stultz
2013-12-13 22:24 ` [PATCH 053/115] gpu: ion: Add chunk heap John Stultz
2013-12-13 22:24 ` [PATCH 054/115] gpu: ion: Clarify variable names and comments around heap ids v types John Stultz
2013-12-13 22:24 ` [PATCH 055/115] gpu: ion: Export ion_client_create John Stultz
2013-12-13 22:24 ` [PATCH 056/115] gpu: ion: Remove heapmask from client John Stultz
2013-12-13 22:24 ` [PATCH 057/115] gpu: ion: Modify zeroing code so it only allocates address space once John Stultz
2013-12-13 22:24 ` [PATCH 058/115] gpu: ion: Refactor the code to zero buffers John Stultz
2013-12-13 22:24 ` [PATCH 059/115] gpu: ion: Only flush buffers in the chunk heap if they were used cached John Stultz
2013-12-13 22:24 ` [PATCH 060/115] gpu: ion: Add support for sharing buffers with dma buf kernel handles John Stultz
2013-12-13 22:24 ` [PATCH 061/115] gpu: ion: Make ion_free asynchronous John Stultz
2013-12-13 22:24 ` [PATCH 062/115] gpu: ion: fix kfree/list_del order John Stultz
2013-12-13 22:24 ` [PATCH 063/115] gpu: ion: ion_chunk_heap: Zero chunk heap memory at creation time John Stultz
2013-12-13 22:24 ` [PATCH 064/115] gpu: ion: Fix bug in ion shrinker John Stultz
2013-12-13 22:24 ` [PATCH 065/115] gpu: ion: Also shrink memory cached in the deferred free list John Stultz
2013-12-13 22:24 ` [PATCH 066/115] gpu: ion: __dma_page_cpu_to_dev -> arm_dma_ops.sync_single_for_device hack John Stultz
2013-12-13 22:24 ` [PATCH 067/115] gpu: ion: Remove __GFP_NO_KSWAPD John Stultz
2013-12-13 22:24 ` [PATCH 068/115] ion: Add Kconfig dependency to ARM John Stultz
2013-12-13 22:24 ` [PATCH 069/115] gpu: ion: fix ion_platform_data definition John Stultz
2013-12-13 22:24 ` [PATCH 070/115] gpu: ion: add CMA heap John Stultz
2013-12-13 22:24 ` [PATCH 071/115] gpu: ion: Fix performance issue in faulting code John Stultz
2013-12-13 22:24 ` [PATCH 072/115] ion: chunk_heap: fix leak in allocated counter John Stultz
2013-12-13 22:24 ` [PATCH 073/115] ion: add free list size to heap debug files John Stultz
2013-12-13 22:24 ` [PATCH 074/115] ion: convert map_kernel to return ERR_PTR John Stultz
2013-12-13 22:24 ` [PATCH 075/115] ion: remove IS_ERR_OR_NULL John Stultz
2013-12-13 22:24 ` [PATCH 076/115] ion: replace userspace handle cookies with idr John Stultz
2013-12-13 22:24 ` [PATCH 077/115] ion: index client->handles rbtree by buffer John Stultz
2013-12-13 22:24 ` [PATCH 078/115] ion: don't use id 0 for handle cookie John Stultz
2013-12-13 22:24 ` [PATCH 079/115] ion: add new ion_user_handle_t type for the user-space token John Stultz
2013-12-13 22:24 ` [PATCH 080/115] ion: change ion_user_handle_t definition to int John Stultz
2013-12-13 22:24 ` [PATCH 081/115] ion: add compat_ioctl John Stultz
2013-12-13 22:24 ` [PATCH 082/115] gpu: ion: delete ion_system_mapper.c John Stultz
2013-12-13 22:24 ` [PATCH 083/115] ion: move userspace api into uapi/ion.h John Stultz
2013-12-13 22:24 ` [PATCH 084/115] ion: Fix compat support to use proper compat ioctl numbers John Stultz
2013-12-13 22:24 ` [PATCH 085/115] ion: hold reference to handle after ion_uhandle_get John Stultz
2013-12-13 22:25 ` [PATCH 086/115] ion: fix crash when alloc len is -1 John Stultz
2013-12-13 22:25 ` [PATCH 087/115] ion: fix dma APIs John Stultz
2013-12-13 22:25 ` [PATCH 088/115] ion: convert sg_dma_len(sg) to sg->length John Stultz
2013-12-13 22:25 ` [PATCH 089/115] ion: check invalid values in ion_system_heap John Stultz
2013-12-13 22:25 ` [PATCH 090/115] ion: add test device for unit tests to interact with dma_bufs John Stultz
2013-12-13 22:25 ` [PATCH 091/115] ion: update idr to avoid deprecated apis John Stultz
2013-12-13 22:25 ` [PATCH 092/115] ion: don't use __arm_ioremap to map pages John Stultz
2013-12-14  3:26 ` [PATCH 093/115] ion: don't use phys_to_page or __phys_to_pfn John Stultz
2013-12-14  3:26   ` [PATCH 094/115] ion: fix printk warnings John Stultz
2013-12-14  4:27     ` Joe Perches [this message]
2013-12-14  3:26   ` [PATCH 095/115] gpu: ion: remove unnecessary function from system heap John Stultz
2013-12-14  3:26   ` [PATCH 096/115] ion: clean up ioctls John Stultz
2013-12-14  3:26   ` [PATCH 097/115] gpu: ion: fix use-after-free in ion_heap_freelist_drain John Stultz
2013-12-14  3:26   ` [PATCH 098/115] ion: Fix two small issues in system_heap allocation John Stultz
2013-12-14  3:26   ` [PATCH 099/115] ion: drop dependency on ARM John Stultz
2013-12-14  3:26   ` [PATCH 100/115] ion: add alignment check to carveout heap John Stultz
2013-12-14  3:26   ` [PATCH 101/115] ion: optimize ion_heap_buffer_zero John Stultz
2013-12-14  3:26   ` [PATCH 102/115] ion: free low memory from page pools first John Stultz
2013-12-14  3:26   ` [PATCH 103/115] ion: check return value from remap_pfn_range John Stultz
2013-12-14  3:26   ` [PATCH 104/115] ion: use vm_insert_pfn for faulted pages John Stultz
2013-12-14  3:26   ` [PATCH 105/115] ion: remove ion_heap_alloc_pages John Stultz
2013-12-14  3:26   ` [PATCH 106/115] ion: allow cached mappings of chunk and system heap buffers John Stultz
2013-12-14  3:26   ` [PATCH 107/115] ion: use alloc_pages in system contig heap John Stultz
2013-12-14  3:26   ` [PATCH 108/115] ion: fix sparse warnings John Stultz
2013-12-14  3:26   ` [PATCH 109/115] ion: carveout heap: zero buffers on free, fix memory leak John Stultz
2013-12-14  3:26   ` [PATCH 110/115] ion: add helper to zero contiguous region of pages John Stultz
2013-12-14  3:26   ` [PATCH 111/115] ion: add alignment check to chunk heap John Stultz
2013-12-14  3:26   ` [PATCH 112/115] ion: fix bugs in cma heap John Stultz
2013-12-14  3:26   ` [PATCH 113/115] ion: Cleanup whitespace issues and other checkpatch problems John Stultz
2013-12-14  3:26   ` [PATCH 114/115] ion: Improve ION config description John Stultz
2013-12-14  3:26   ` [PATCH 115/115] ion: Update system heap shrinker to use the new count/scan interface John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386995255.2276.1.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=ccross@android.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jesse.barker@arm.com \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®