* Patch "nvme: fix 32-bit build warning" has been added to the 4.2-stable tree
@ 2015-11-06 6:26 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-11-06 6:26 UTC (permalink / raw)
To: arnd, axboe, gregkh, hch; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
nvme: fix 32-bit build warning
to the 4.2-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
nvme-fix-32-bit-build-warning.patch
and it can be found in the queue-4.2 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 835da3f99d329b1160a1f7fc82c7ac81163d63d0 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 6 Oct 2015 22:29:48 +0200
Subject: nvme: fix 32-bit build warning
From: Arnd Bergmann <arnd@arndb.de>
commit 835da3f99d329b1160a1f7fc82c7ac81163d63d0 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/block/nvme-core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -1764,7 +1764,7 @@ static int nvme_submit_io(struct nvme_ns
length = (io.nblocks + 1) << ns->lba_shift;
meta_len = (io.nblocks + 1) * ns->ms;
- metadata = (void __user *)(unsigned long)io.metadata;
+ metadata = (void __user *)(uintptr_t)io.metadata;
write = io.opcode & 1;
if (ns->ext) {
@@ -1804,7 +1804,7 @@ static int nvme_submit_io(struct nvme_ns
c.rw.metadata = cpu_to_le64(meta_dma);
status = __nvme_submit_sync_cmd(ns->queue, &c, NULL,
- (void __user *)io.addr, length, NULL, 0);
+ (void __user *)(uintptr_t)io.addr, length, NULL, 0);
unmap:
if (meta) {
if (status == NVME_SC_SUCCESS && !write) {
@@ -1846,7 +1846,7 @@ static int nvme_user_cmd(struct nvme_dev
timeout = msecs_to_jiffies(cmd.timeout_ms);
status = __nvme_submit_sync_cmd(ns ? ns->queue : dev->admin_q, &c,
- NULL, (void __user *)cmd.addr, cmd.data_len,
+ NULL, (void __user *)(uintptr_t)cmd.addr, cmd.data_len,
&cmd.result, timeout);
if (status >= 0) {
if (put_user(cmd.result, &ucmd->result))
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.2/kvm-arm-use-gic-support-unconditionally.patch
queue-4.2/nvme-fix-32-bit-build-warning.patch
queue-4.2/arm-ux500-modify-initial-levelshifter-status.patch
queue-4.2/bus-arm-ccn-fix-irq-affinity-setting-on-cpu-migration.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-06 6:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-06 6:26 Patch "nvme: fix 32-bit build warning" has been added to the 4.2-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).