From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755903AbbJIOmZ (ORCPT ); Fri, 9 Oct 2015 10:42:25 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:58755 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbbJIOmY (ORCPT ); Fri, 9 Oct 2015 10:42:24 -0400 Date: Fri, 9 Oct 2015 07:42:21 -0700 From: Christoph Hellwig To: Arnd Bergmann Cc: Matthew Wilcox , Jens Axboe , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Christoph Hellwig Subject: Re: [PATCH] nvme: fix 32-bit build warning Message-ID: <20151009144221.GA12760@infradead.org> References: <5851501.PBMrs03XFb@wuerfel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5851501.PBMrs03XFb@wuerfel> User-Agent: Mutt/1.5.23 (2014-03-12) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2015 at 10:37:11PM +0200, Arnd Bergmann wrote: > Compiling the nvme driver on 32-bit warns about a cast from a __u64 > variable to a pointer: > > drivers/block/nvme-core.c: In function 'nvme_submit_io': > drivers/block/nvme-core.c:1847:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > (void __user *)io.addr, length, NULL, 0); > > The cast here is intentional and safe, so we can shut up the > gcc warning by adding an intermediate cast to 'unsigned long'. It really should be a uintptr_t, which would also avoid the > 80 character lines. I wonder if we need a u64_to_ptr helper given these ioctl ABIs that pass pointers as a u64 seems to be everywhere these days.