lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Apr 2015 00:38:39 +0200
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Mitchel Humpherys <mitchelh@...eaurora.org>
Cc:	devel@...uxdriverproject.org,
	Android Kernel Team <kernel-team@...roid.com>,
	Colin Cross <ccross@...roid.com>,
	John Stultz <john.stultz@...aro.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: ion: chunk_heap: use %pa for printing
 dma_addr_t's

On Thu, Apr 09, 2015 at 03:31:14PM -0700, Mitchel Humpherys wrote:
> We're currently using %lu and %ld to print some variables of type
> dma_addr_t, which results in the following warning when dma_addr_t is
> 64-bits wide:
> 
>     drivers/staging/android/ion/ion_chunk_heap.c: In function 'ion_chunk_heap_create':
>     drivers/staging/android/ion/ion_chunk_heap.c:176:2: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'dma_addr_t' [-Wformat=]
>       pr_info("%s: base %lu size %zu align %ld\n", __func__, chunk_heap->base,
>       ^
>     drivers/staging/android/ion/ion_chunk_heap.c:176:2: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'dma_addr_t' [-Wformat=]
> 
> Fix this by using %pa as instructed in printk-formats.txt.
> 
> Signed-off-by: Mitchel Humpherys <mitchelh@...eaurora.org>
> ---
>  drivers/staging/android/ion/ion_chunk_heap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c
> index 3e6ec2ee6802..f0b7c8e68422 100644
> --- a/drivers/staging/android/ion/ion_chunk_heap.c
> +++ b/drivers/staging/android/ion/ion_chunk_heap.c
> @@ -173,8 +173,8 @@ 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 %zu align %ld\n", __func__, chunk_heap->base,
> -		heap_data->size, heap_data->align);
> +	pr_info("%s: base %pa size %zu align %pa\n", __func__,
> +		&chunk_heap->base, heap_data->size, &heap_data->align);

Shouldn't this be a debug message, and not printed out for everyone to
see all the time?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ