Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755395AbcCRRPN (ORCPT ); Fri, 18 Mar 2016 13:15:13 -0400 Received: from mga02.intel.com ([134.134.136.20]:60149 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755240AbcCRRPJ (ORCPT ); Fri, 18 Mar 2016 13:15:09 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,356,1455004800"; d="scan'208";a="940318517" From: "Jiang, Dave" To: "Allen.Hubbe@emc.com" , "computersforpeace@gmail.com" CC: "linux-kernel@vger.kernel.org" , "jdmason@kudzu.us" , "linux-ntb@googlegroups.com" Subject: Re: [PATCH] ntb: test: fix pointer size warning Thread-Topic: [PATCH] ntb: test: fix pointer size warning Thread-Index: AQHRgTk8EbQJvMWrE0SlhiSe5tXjyp9f5h4A Date: Fri, 18 Mar 2016 17:14:30 +0000 Message-ID: <1458321260.15376.85.camel@intel.com> References: <1458321080-42873-1-git-send-email-computersforpeace@gmail.com> In-Reply-To: <1458321080-42873-1-git-send-email-computersforpeace@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [143.182.137.38] Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u2IHFH02027353 Content-Length: 1815 Lines: 51 On Fri, 2016-03-18 at 10:11 -0700, Brian Norris wrote: > drivers/ntb/test/ntb_perf.c: In function ‘perf_copy’: > drivers/ntb/test/ntb_perf.c:213:10: warning: cast from pointer to > integer of different size [-Wpointer-to-int-cast] > drivers/ntb/test/ntb_perf.c:214:14: warning: cast from pointer to > integer of different size [-Wpointer-to-int-cast] > > On 32-bit systems, we are casting a 32-bit pointer to a 64-bit value. > This shouldn't cause functional problems, but we might as well fix > the > warning and allow 32-bit arithmetic for 32-bit systems. > > Signed-off-by: Brian Norris > Cc: Dave Jiang > Cc: Jon Mason > Cc: Allen Hubbe Acked-by: Dave Jiang > --- >  drivers/ntb/test/ntb_perf.c | 6 +++--- >  1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/ntb/test/ntb_perf.c > b/drivers/ntb/test/ntb_perf.c > index c8a37ba4b4f9..835e2686998d 100644 > --- a/drivers/ntb/test/ntb_perf.c > +++ b/drivers/ntb/test/ntb_perf.c > @@ -189,7 +189,7 @@ static ssize_t perf_copy(struct pthr_ctx *pctx, > char *dst, >   dma_cookie_t cookie; >   size_t src_off, dst_off; >   struct perf_mw *mw = &perf->mw; > - u64 vbase, dst_vaddr; > + uintptr_t vbase, dst_vaddr; >   dma_addr_t dst_phys; >   int retries = 0; >   > @@ -210,8 +210,8 @@ static ssize_t perf_copy(struct pthr_ctx *pctx, > char *dst, >   if (!is_dma_copy_aligned(device, src_off, dst_off, size)) >   return -ENODEV; >   > - vbase = (u64)(u64 *)mw->vbase; > - dst_vaddr = (u64)(u64 *)dst; > + vbase = (uintptr_t)(u64 *)mw->vbase; > + dst_vaddr = (uintptr_t)(u64 *)dst; >   dst_phys = mw->phys_addr + (dst_vaddr - vbase); >   >   unmap = dmaengine_get_unmap_data(device->dev, 1, > GFP_NOWAIT);