From patchwork Tue Oct 6 20:37:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7339981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CC28BEEA4 for ; Tue, 6 Oct 2015 20:40:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBCE720656 for ; Tue, 6 Oct 2015 20:40:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D12BB2064B for ; Tue, 6 Oct 2015 20:40:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZjYzY-0004oi-VQ; Tue, 06 Oct 2015 20:37:44 +0000 Received: from mout.kundenserver.de ([212.227.126.130]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZjYzV-0004kY-7p; Tue, 06 Oct 2015 20:37:41 +0000 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0MhJ69-1Zx5ch0h6n-00MIp4; Tue, 06 Oct 2015 22:37:14 +0200 From: Arnd Bergmann To: Matthew Wilcox Subject: [PATCH] nvme: fix 32-bit build warning Date: Tue, 06 Oct 2015 22:37:11 +0200 Message-ID: <5851501.PBMrs03XFb@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:KhHbh35Y0jxZH7q+2tq9FD2cmuanHRr7tRaQtkOffg8BXiQ4MqK jJh3bKFFyPZXWn/o+Fr3FGyow+s+4/vvxnMkpoJjVOz0UQyG5TmvQ6A69PtzZagvEAzhDU7 cc2AciJn4ESi11vOig5/O/GZmnqOKUv9XXX+698R+OD0VIZbNgx3uHJD1htr33zJOxSI++l FwhausHVPBJ0Mv40ov2+A== X-UI-Out-Filterresults: notjunk:1; V01:K0:xBrMAckoXsM=:mj+GPhkgNDGA4KKLR+lo99 wZsrj3YgN/t3d+GWgsOwN36vxD5vUr8+TGbI5jx4r7jZqAhN62aHH3xojSCF0tnJf9paCiXL8 BSCLzI0dc8UPC8QehjuLxkK4R5lwllXXPH0T8+PjOam/OcQCYJuEhN0D4vzqpFbwHCutt9+jA rm87x2HHAaw2PypAm2vp9uMJDIwp6S6JttbbvIobwlLWY40Rie6c6g+HjoRI8o/a13oemUIG8 ZFzmcfHYq6whXSbD2VbAt618sEhQO09a3mlWH8tQHFN/OPscWe3YqkAwN+NXrKKapMZG7O5S1 EQqbyOMIkHQYNr+uXl0VsXFoz58BAkhjynM4z0npQJsOxmNB7zO9kvwnF33gWFUm3lgOGuNjq jVXM+qsCobIY2gErZCjgZldqMJsp+flnNH0B9UfFhLc7Y1y8NiD371ZD6Ju5ABldN+sBf10LN rWObXwXjOcvZFGaFzhSVVZ8UZ50e41cztXmW1IpaP2S+5MJXZmEGwFwxgUMa2h6XVUtaxMHTY 4yTcMkxHikYfnDNPwfdFnjeC2eoXHIkejzo+CVgVAdQZw5tuG9odIOZ2ySRKweSe+Q+cug9BT 3Kyeqgr1L9wkTAvaqWhr4+UjfjoEqvn+t3Waw4mnT3zc6aGbJl5PgqO8LErySDbph5mQpe3Us Ot696mhM5AsLeSPN7f3/qur7s1c+db/XGOJWb02TpQlnIUMBYsPlRSq5APRQdWuInIweunLlH axD1EZQ2EyGHgPoW X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151006_133741_485580_282A8D47 X-CRM114-Status: GOOD ( 14.27 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, Christoph Hellwig Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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'. 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. Signed-off-by: Arnd Bergmann Fixes: d29ec8241c10e ("nvme: submit internal commands through the block layer") diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index e917cf304ad0..f9faf276ce74 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -1844,7 +1844,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio) 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 *)(unsigned long)io.addr, length, NULL, 0); unmap: if (meta) { if (status == NVME_SC_SUCCESS && !write) { @@ -1886,7 +1886,7 @@ static int nvme_user_cmd(struct nvme_dev *dev, struct nvme_ns *ns, 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 *)(unsigned long)cmd.addr, cmd.data_len, &cmd.result, timeout); if (status >= 0) { if (put_user(cmd.result, &ucmd->result))