From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756005AbbDIXTQ (ORCPT ); Thu, 9 Apr 2015 19:19:16 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58959 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754339AbbDIXTO (ORCPT ); Thu, 9 Apr 2015 19:19:14 -0400 From: Mitchel Humpherys To: Greg Kroah-Hartman Cc: devel@linuxdriverproject.org, Android Kernel Team , Colin Cross , John Stultz , linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: ion: chunk_heap: use %pa for printing dma_addr_t's References: <1428618674-1370-1-git-send-email-mitchelh@codeaurora.org> <20150409223839.GA24054@kroah.com> Date: Thu, 09 Apr 2015 16:19:13 -0700 In-Reply-To: <20150409223839.GA24054@kroah.com> (Greg Kroah-Hartman's message of "Fri, 10 Apr 2015 00:38:39 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 09 2015 at 03:38:39 PM, Greg Kroah-Hartman wrote: > 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 >> --- >> 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? Yeah that'd probably be better. I'll send a patch. -Mitch -- Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project