From patchwork Mon Jul 9 15:57:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 941405 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="m3G6H7qw"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41PVVs49Scz9rvt for ; Tue, 10 Jul 2018 02:03:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=d+MOQ9oDh2kXkc4TJpxyGZ5eNlLNNqJQ2tWYHWnnOzE=; b=m3G 6H7qw1SliBk1SlQG0+sI2CXIZ4daut5g3PKyOj8tDb5FCjrz04rDYQA5aYqMjbKGpudhWwrJTuLro 1Y8cqgF0hQBXLW3A0S1rDI9vEtUs7h0V4eE2Nu1JifrJWEjIoWen0iclFigwfycVwSVIQQd1N8r1i AGesXE+kfoN0U1P/DvnEjvWYoUk1grNFE8zh1oIFwSG8pU2N0/u43tftImpB6soASGmYgTpkFitsD SMrfkQMDd3kFuzo0Sp1Hug5ryLhicVY1ngsFGr9uGckde59ucQBCjFY+jDyUqHqg4MLm2Ydgh6RHu LfvgLa8AqpZsqrt97IkTDKlWO2koemg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcYdL-00030i-2h; Mon, 09 Jul 2018 16:03:27 +0000 Received: from mout.kundenserver.de ([217.72.192.73]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcYdH-0002xB-T9 for linux-mtd@lists.infradead.org; Mon, 09 Jul 2018 16:03:25 +0000 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MG9Yd-1fq4vj0x5L-00FBBc; Mon, 09 Jul 2018 17:57:32 +0200 From: Arnd Bergmann To: Boris Brezillon Subject: [PATCH 1/3] mtd: rawnand: davinci: fix build testing on 64-bit Date: Mon, 9 Jul 2018 17:57:02 +0200 Message-Id: <20180709155730.2422841-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K1:rl4qp5+DspI/dyd5dNruM8CwTJZFogiKcSYOIUTSUXMmRCJjKO1 fLkAzWcvmYKCERS6jVHym0aM224eyGjvc1g/72BjlPoNQVV8qcvxJRzaZOlfYsKzEUR8nK7 k3L5GQnsgtdq4hGAKbzajcEG3pFCqb1Dwy8B1yleefQfYjNaLu7HfQYbrzF38e+zaONXavr 4IfD+jmyjz4u40lDl6BKw== X-UI-Out-Filterresults: notjunk:1; V01:K0:WMur2cY+Kq4=:rKtcNvc53PA3wgnB6PLt8p CFM9xL6PaQ2O7lQeE1wY/6lyPEqGHwk1Zik7YdtTR8gn7YGEKoxhnN5ih3EuMEm+VJPvNXGJ1 BSWQmS9K32MJJhlfEkEPXiuShMUI/kFC8w/r2SEorL/ke7IiuxxM3QNcDl+Dcigg9ckzsOqe/ zDKdY5gpQFqWtfOSaoxF2fHDK1GCcSpClba2eN8fHC+0bIdCOxB8/cXPshJm24VqiNaeiQ6V8 Y/IBD0NIvCBDv2EbgBbcNSX2I4AZxt+Jv0dOiU4ck/VmZM3I4YsH+drbIxP9d2d/1nhZ2IUkh XHe4LRaV0OC3AIhLYr4nsyD7Ld5uo4rmF1Vctl2ytuJ/iL3BHcRC10jcxOw/eswj6kr2vyQ2j Ix5Vle9LQq1wE++eAPpIDJw8kLLACpAJfuAKxLISyeGw4oxodAm59JoxHEvgsrhkWpW5vp5Gy guHuB7g9vAo3TFsrTt3Rsm14DHY78j7kABNbPS+piyRWXMoiNYa3dFb4Ql1CC78Ks7MBU0Ugu U6+tT01mfWo2R7c2k/tM0UKnkqjCROQVwYbg1xf1BrwDB+QRWJJ3tRIdESanfGApvM5+5vtJf wV7+WRp1qmlYN0HGKQGqR6mCQwyuw8qRclADM5pqhE7RtjNe+ESrJuW6KQ0ve0z3cjgPmJRdH w4s+mUSurWHtA1Pbxl7GERsdpBTGuf6xZ6XDitCP844vHB8jebhNTK1rwTnjwIZigc/E= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180709_090324_240261_BCDAAE36 X-CRM114-Status: GOOD ( 13.91 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.73 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Bartosz Golaszewski , Richard Weinberger , Gregory CLEMENT , Sekhar Nori , linux-kernel@vger.kernel.org, Alexander Sverdlin , Marek Vasut , linux-mtd@lists.infradead.org, Miquel Raynal , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now that we can build this driver everywhere, we run into a couple of warnings like: drivers/mtd/nand/raw/davinci_nand.c: In function 'nand_davinci_correct_4bit': drivers/mtd/nand/raw/davinci_nand.c:322:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] In all cases, this is harmless and we just need to cast to an uintptr_t rather than an unsigned 32-bit integer. Fixes: 347af8918e8a ("mtd: rawnand: davinci: Allow selection of this driver when COMPILE_TEST=y") Signed-off-by: Arnd Bergmann Reviewed-by: Alexander Sverdlin --- drivers/mtd/nand/raw/davinci_nand.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c index cd12e5abafde..c638bd60eb0b 100644 --- a/drivers/mtd/nand/raw/davinci_nand.c +++ b/drivers/mtd/nand/raw/davinci_nand.c @@ -102,7 +102,7 @@ static void nand_davinci_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) { struct davinci_nand_info *info = to_davinci_nand(mtd); - uint32_t addr = info->current_cs; + uintptr_t addr = info->current_cs; struct nand_chip *nand = mtd_to_nand(mtd); /* Did the control lines change? */ @@ -122,7 +122,7 @@ static void nand_davinci_hwcontrol(struct mtd_info *mtd, int cmd, static void nand_davinci_select_chip(struct mtd_info *mtd, int chip) { struct davinci_nand_info *info = to_davinci_nand(mtd); - uint32_t addr = info->ioaddr; + uintptr_t addr = info->ioaddr; /* maybe kick in a second chipselect */ if (chip > 0) @@ -319,7 +319,7 @@ static int nand_davinci_correct_4bit(struct mtd_info *mtd, /* Unpack ten bytes into eight 10 bit values. We know we're * little-endian, and use type punning for less shifting/masking. */ - if (WARN_ON(0x01 & (unsigned) ecc_code)) + if (WARN_ON(0x01 & (uintptr_t)ecc_code)) return -EINVAL; ecc16 = (unsigned short *)ecc_code; @@ -441,9 +441,9 @@ static void nand_davinci_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) { struct nand_chip *chip = mtd_to_nand(mtd); - if ((0x03 & ((unsigned)buf)) == 0 && (0x03 & len) == 0) + if ((0x03 & ((uintptr_t)buf)) == 0 && (0x03 & len) == 0) ioread32_rep(chip->IO_ADDR_R, buf, len >> 2); - else if ((0x01 & ((unsigned)buf)) == 0 && (0x01 & len) == 0) + else if ((0x01 & ((uintptr_t)buf)) == 0 && (0x01 & len) == 0) ioread16_rep(chip->IO_ADDR_R, buf, len >> 1); else ioread8_rep(chip->IO_ADDR_R, buf, len); @@ -454,9 +454,9 @@ static void nand_davinci_write_buf(struct mtd_info *mtd, { struct nand_chip *chip = mtd_to_nand(mtd); - if ((0x03 & ((unsigned)buf)) == 0 && (0x03 & len) == 0) + if ((0x03 & ((uintptr_t)buf)) == 0 && (0x03 & len) == 0) iowrite32_rep(chip->IO_ADDR_R, buf, len >> 2); - else if ((0x01 & ((unsigned)buf)) == 0 && (0x01 & len) == 0) + else if ((0x01 & ((uintptr_t)buf)) == 0 && (0x01 & len) == 0) iowrite16_rep(chip->IO_ADDR_R, buf, len >> 1); else iowrite8_rep(chip->IO_ADDR_R, buf, len); @@ -680,7 +680,7 @@ static int nand_davinci_probe(struct platform_device *pdev) info->chip.bbt_md = pdata->bbt_md; info->timing = pdata->timing; - info->ioaddr = (uint32_t __force) vaddr; + info->ioaddr = (uintptr_t __force) vaddr; info->current_cs = info->ioaddr; info->core_chipsel = pdata->core_chipsel; From patchwork Mon Jul 9 15:57:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 941402 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NF0SYM2U"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41PVPy1LpMz9rvt for ; Tue, 10 Jul 2018 01:59:18 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QxoASPEyrIWJ6gRFAMaadv10VGweecLss/irzhJNHSs=; b=NF0SYM2UiOPifYv1ouarSP/e/P Eg/2JkIBhQ+cn0humlCXRpvkEhGjNmjAbdz/dOHaJbDpD/FVhbVxI1AU6igp0TGQtlIjn9JPC4QbF n7qN8KdMTGyXE2DLummVqKNQG38FzLuPtBJ7OJOoAdaCEaeHAxMuX2m/P9Vps1JaOja+v6JfXL2u3 xuPzY5B54t7PZSSOPp032SWpWlSSRr5Wv8b9uGPVJWpU5mo5uai8oIMRJnqol3+3P5bfHtccU332O d0hOarNxQpG2+0cJM6H2bHx3nWbVUmpXtQuhq3UyirXD3i6UK858rOyTDOEz/eGhcgdhgJXSbbHfs kMUJVdig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcYZ8-0007zw-7X; Mon, 09 Jul 2018 15:59:06 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcYYa-0006us-NN; Mon, 09 Jul 2018 15:58:50 +0000 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LhNMu-1gOrsJ3LlI-00maWp; Mon, 09 Jul 2018 17:58:04 +0200 From: Arnd Bergmann To: Boris Brezillon Subject: [PATCH 2/3] mtd: atmel nand: fix build warning on 64-bit Date: Mon, 9 Jul 2018 17:57:03 +0200 Message-Id: <20180709155730.2422841-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180709155730.2422841-1-arnd@arndb.de> References: <20180709155730.2422841-1-arnd@arndb.de> X-Provags-ID: V03:K1:c+dyJrgBfWh82vW2V2LsrYOJDpfCWcJnKt7zsAaCGvu5HDWD4UZ 4Wpdd7nX+So7cJLlksTteChSOs+kLr8WUcKUIo5zRjWMgiyjwBNseoZ3mGQav2UMeJrDCox fQj7nIJqBllgbW8Mw5BEVdotBxaygHHJW/tHBhJfIbr08viTfntFCZxOxQH/Y5V7AWLtbVg OmlGwuLWqxVaLbW0/kxlQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:tN3BDP4gkMo=:gxpR7gzPxnst2CeETPdXhc 3Z1+rDyiqthkDyuWxCjSSMmfDYqW14SijW0wbrG/Ndk/CUAaE3BnG0OcArX0Foi/Px4GgAqhf CfR7AmGwelVFlF4RJjafyrHCuCHjPMidp6Yei8nR/4fqbK2HaLT1ZvsRXh6k07+YxUCorT+Ze kpfTkONYv5lxTjU0EpF1viO/PUZksrLBtEQ8d8Fy1PA47jo7CkVizkcQx54C+jVfuvGZK7Ct7 1sV31Zpf0QsWeuiomGJxvwmBqNd2hnWQj32kxgdKenJKuqBFE0+XUyNk0Cm1OesJK9zm7HnML unLVbJ3jEO/q5X7anHSSHXt54f8mKoBe6FSqqkZkVE7fnXOqQWsIFZi+4QutxbNZ/8n/voXFI nd85sa+o7a4LfSuao1bzkB1sL6MN09X2tWZdiVbTvk/HlTsuMmcZkbhuBJmqaXS5XhjEF0FiL XMnNdFpyo9UqrgT2Er4IcmSJzG3bG9qHeq/i0p3GW1QVLHhF0fj7AkGkwT6X+VbIsTv9lWaxg Nf0LK5eMphS/55R8HPzM6AnAJuufJly+bJZR8TzA05RYzsP3gN9C3UwBXAFtgc0V4X6zkkF1C uydq3ul9gILTZh3eG5qaIYv0zngoy4I0E1hj30yjco0hTAT6ayzZ0r0FHndwoFuvuKr30FXbr bZP6BUKBeumldwpSJsXTC/rv+OGW6DENyBHeaGdQiQn7xNXPasi2Q4TVMozh+34VCkU0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180709_085833_579776_A39EC17E X-CRM114-Status: GOOD ( 14.36 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [217.72.192.75 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Arnd Bergmann , Wenyou Yang , Masahiro Yamada , Richard Weinberger , Gregory CLEMENT , Miquel Raynal , Nicolas Ferre , linux-kernel@vger.kernel.org, Marek Vasut , linux-mtd@lists.infradead.org, Josh Wu , Romain Izard , Brian Norris , David Woodhouse , Peter Rosin , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Build-testing this driver on a 64-bit architecture produces a harmless warning: drivers/mtd/nand/raw/atmel/nand-controller.c: In function 'atmel_smc_nand_controller_init': drivers/mtd/nand/raw/atmel/nand-controller.c:2053:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] To cast the pointer correctly, the destination type should be uintptr_t rather than a 32-bit int. Fixes: c2f3d0b913a5 ("mtd: rawnand: atmel: Allow selection of this driver when COMPILE_TEST=y") Signed-off-by: Arnd Bergmann --- drivers/mtd/nand/raw/atmel/nand-controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c index e686fe73159e..e8f7549d0354 100644 --- a/drivers/mtd/nand/raw/atmel/nand-controller.c +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c @@ -2050,7 +2050,7 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc) return ret; } - nc->ebi_csa_offs = (unsigned int)match->data; + nc->ebi_csa_offs = (uintptr_t)match->data; /* * The at91sam9263 has 2 EBIs, if the NAND controller is under EBI1 From patchwork Mon Jul 9 15:57:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 941403 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="e1p8bjhW"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41PVQV4dgCz9s19 for ; Tue, 10 Jul 2018 01:59:46 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XftfYGTHlZe2Z8L0muOMumPccSWb12Xfk80pc8I8zJ0=; b=e1p8bjhWUw3MPAuN24h5m4mxBc PgRGTt4YczaBYyp5jedx/CEw2y9U/hSNcRr5p+UssLpN6OlxVBmKvskIFhht0SyrYBD+s9pSZHEF9 Q0jR+4bpP7LB9n4flV4llg3W6Xxf/t0eXUNAHX8iLlbCh8CRx4oNJsPzMa6bpjvqh/a7XgtffYXTw nSFMVWsgiYBeA4z3uBD+IqoXJEV0wsbaacixNmCAoCnJ0tPOYES7WInPjenusO+TPXrZs3GdAW6L2 MyY2SobV+W+r5oNbQI5/rUtI8B3fAvIEciDVkPpal7KW5RcnW+puKEpZFZzTeHBO4P9gQGS2jXQ4M eP4Zk7Ww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcYZg-0000Ej-Rc; Mon, 09 Jul 2018 15:59:40 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fcYYw-0007NU-JS; Mon, 09 Jul 2018 15:59:26 +0000 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MFKbs-1fqu1w2NG8-00EMEx; Mon, 09 Jul 2018 17:58:20 +0200 From: Arnd Bergmann To: Boris Brezillon Subject: [PATCH 3/3] mtd: sunxi_nand: fix build warning Date: Mon, 9 Jul 2018 17:57:04 +0200 Message-Id: <20180709155730.2422841-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180709155730.2422841-1-arnd@arndb.de> References: <20180709155730.2422841-1-arnd@arndb.de> X-Provags-ID: V03:K1:rs37fhogpXsDddcc/Tg/tg9RyRGZES2mpCS2k8fM/bageXDxj0G Uvplqtd0sa94pn4FviKHPFaKDCplZ8MGTjZdvi0I5ZvbZ1kruA299+TzpLQUTycdWKCBQ0x YmGgJhg6fq071b4+gp32U+1sfQw3DXWQ1ly2+4WYMvgK3kvicleQ0ANI9iCGQDlKBTisw3h TmIR5xdtwbnbFkFJJZ46A== X-UI-Out-Filterresults: notjunk:1; V01:K0:j+AbLGmx0kQ=:Gz4zVvVpyB1kYk+nRQlNCB clCz+JHxRzHCtuFEwEoROzXKQ3GMC9e6WYVmg40CqBuTnPV0ogLlCghP4ZxBO0MXv4QiFfzPH 2UwPrKGLzDLewq6QlDQ9fPNfI+CvHivZ99OzYIoTQ2IH+xw31DV/UcS4BDy0aUqNxNPo/+rfa cTBOAymHEW5YzfTujnFlKTjULkIzv1vSCxTZw3RTgqE6vCtTec5av+zW9R4OPeXQ1kmvnPjoz 6khRakSrMmxAqWvyoKZbcTY4rvm+wbBvDhTaTUm2D+a1LVT6EyuVk5drRAyFc1mcCnQh4ZtWj 8cfFAei+KiJxMNibi1nHdooF5McC284JEejNJXAS+S5HF1un6PkdtUwjmhhf4NovoT03xXwGJ WAnAEVuk2EH9lqQCUwlraJqQ3CVrx4P06JG8Ca/YAwV7d98YSOKAx/n9BHcmus8tFnTk2h5YT yAT6c8DWprWrEAemKGUxs05owlJlDUItciTpXsdbvffXxzegdSL2GtEylcpABMR78IpGE/Op5 bqGnaRiN3WV2RNYEhN8xGVTONsq/6Fd9rnBs0YS9HxuSSdOlWDmnF8u5mw7V2IuN8W1pIvtX3 hIX1r6sCbhZcMoAzvszLTTNlV4dyDpFoDDWWE63bFLb5QT745I7B0Y6Cs1IFvt2dllajRJnVn wfpkuY48s9Lh3rK9iipgpOAoaxcb2xBi/2nKYdj2em2pFiylVX9YEkvxZHLxosWnYx+A= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180709_085855_093221_7BF28F26 X-CRM114-Status: GOOD ( 13.44 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.24 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Masahiro Yamada , Maxime Ripard , Richard Weinberger , linux-kernel@vger.kernel.org, Vladimir Zapolskiy , Marek Vasut , Chen-Yu Tsai , linux-mtd@lists.infradead.org, H Hartley Sweeten , Philipp Zabel , Miquel Raynal , Bryan O'Donoghue , Brian Norris , David Woodhouse , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org build-testing this driver on x86 shows a new warning: Fixes: b3d926a3d6e0 ("mtd: rawnand: sunxi: Allow selection of this driver when COMPILE_TEST=y") drivers/mtd/nand/raw/sunxi_nand.c: In function 'sunxi_nfc_hw_ecc_read_chunks_dma': drivers/mtd/nand/raw/sunxi_nand.c:130:22: error: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744071631273984' to '2216689664' [-Werror=overflow] #define NFC_PAGE_OP (2 << 30) drivers/mtd/nand/raw/sunxi_nand.c:1040:9: note: in expansion of macro 'NFC_PAGE_OP' writel(NFC_PAGE_OP | NFC_DATA_SWAP_METHOD | NFC_DATA_TRANS, ^~~~~~~~~~~ drivers/mtd/nand/raw/sunxi_nand.c: In function 'sunxi_nfc_hw_ecc_write_page_dma': drivers/mtd/nand/raw/sunxi_nand.c:130:22: error: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744071632322560' to '2217738240' [-Werror=overflow] #define NFC_PAGE_OP (2 << 30) drivers/mtd/nand/raw/sunxi_nand.c:1406:9: note: in expansion of macro 'NFC_PAGE_OP' writel(NFC_PAGE_OP | NFC_DATA_SWAP_METHOD | This is easy to avoid by ensuring that the constants are 'unsigned'. Fixes: b3d926a3d6e0 ("mtd: rawnand: sunxi: Allow selection of this driver when COMPILE_TEST=y") Signed-off-by: Arnd Bergmann --- drivers/mtd/nand/raw/sunxi_nand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c index d831a141a196..fa5c48502fa8 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -125,9 +125,9 @@ #define NFC_SEND_CMD3 BIT(28) #define NFC_SEND_CMD4 BIT(29) #define NFC_CMD_TYPE_MSK GENMASK(31, 30) -#define NFC_NORMAL_OP (0 << 30) -#define NFC_ECC_OP (1 << 30) -#define NFC_PAGE_OP (2 << 30) +#define NFC_NORMAL_OP (0u << 30) +#define NFC_ECC_OP (1u << 30) +#define NFC_PAGE_OP (2u << 30) /* define bit use in NFC_RCMD_SET */ #define NFC_READ_CMD_MSK GENMASK(7, 0)