]> www.infradead.org Git - users/jedix/linux-maple.git/commit
nvme: fix 32-bit build warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 6 Oct 2015 20:29:48 +0000 (22:29 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 6 Jul 2016 23:32:03 +0000 (16:32 -0700)
commitc1a4bac3c7334268dc2ba7dc1a2b19c1fb385c9b
tree34f29277a354a7391586fec8c2d99ae9a680c18d
parentcfcc32e8419d93cab166562fe9405e0dd4d967cc
nvme: fix 32-bit build warning

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 'uintptr_t'.

I had previously submitted a patch to fix this problem in the
nvme driver, but it was accepted on the same day that two new
warnings got added.

For clarification, I also change the third instance of this cast
to use uintptr_t instead of unsigned long now.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: d29ec8241c10e ("nvme: submit internal commands through the block layer")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 3d42e67fe5ebc1e5c3aae9b1037e38ec99a362cc)

Orabug: 22620486
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
Conflicts:
drivers/nvme/host/pci.c
drivers/nvme/host/pci.c