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, 18 Mar 2016 17:14:30 +0000
From:	"Jiang, Dave" <dave.jiang@...el.com>
To:	"Allen.Hubbe@....com" <Allen.Hubbe@....com>,
	"computersforpeace@...il.com" <computersforpeace@...il.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"jdmason@...zu.us" <jdmason@...zu.us>,
	"linux-ntb@...glegroups.com" <linux-ntb@...glegroups.com>
Subject: Re: [PATCH] ntb: test: fix pointer size warning

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 <computersforpeace@...il.com>
> Cc: Dave Jiang <dave.jiang@...el.com>
> Cc: Jon Mason <jdmason@...zu.us>
> Cc: Allen Hubbe <Allen.Hubbe@....com>

Acked-by: Dave Jiang <dave.jiang@...el.com>

> ---
>  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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ