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: 141460 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2829294ljj; Mon, 9 Jul 2018 08:58:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdqMWd4Qubr4QhNUnjA6wGoA6gkDksR0gdzd3NKPr+pd6SrL8aAr2gqloMGpDPvgmxkgJxr X-Received: by 2002:a17:902:e187:: with SMTP id cd7-v6mr21289479plb.166.1531151927525; Mon, 09 Jul 2018 08:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531151927; cv=none; d=google.com; s=arc-20160816; b=y/crsZSoIXJRoCHZk9ohzxx/RJixpIAHeN3BEcMoV6DL1HslJSzmuoFfu8rClgGNA4 xrfitB5uCE4wV+pkDb3EYdhrEcGzcydmTTNCiAaLgsmbFpiFtNPOBaDawyBxJQ6ZDrV0 LSq/zCdKjIJgDcF4I7ATFG5Xs3BgGT1sQzrJIb/AVo8FSjEoBVD5KN55W0FNnUFyKjA8 GkEQEQmWxM47TtYYkQDmo82XB/5FKSByVFs65QJiaoNFO4OmEn7b9vzClL5QvYzEp+xF P5EcxGn5t5/GiyHSDrlaP2cv+72fwB2pK3pOB9S6OV0xljUpC4CdfTLK+ySdweDqJlQP S0eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=KlJwW10ST4bqpcNnPXtBSObIvcyUxiG16ReDAltybtQ=; b=RiSh6THtZL6HcpiYG6ZUDbci9fzJbu304W6md/0RaSPeyGT+7BK/Wq0bnUkvOqXdP7 13xgfEiLbgrjStIqd94VznruqM8Sb+MJJ6Urvk8kqGTg6C+5TEOXtxyuw4UgxRO9x8yt 99QEGEIoY2ZtwxYqz7b1t8lcgpKTtxi43/Et7gexQVLfQ1qykcMyLtewo/J/NR3Otxxd m+Y93Avs1UOqw0RXxa4QTlPxjsC2OUEzUDcf9pKfRxOevFXBlDnYqXkH0bAyIvmROoEb +dsW2NmntuKq36jfb3m8K5v7muYEWcEDCJcxssDggmbsUZhT+DefA3VP4puG1WGQMXZ/ 2HvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si14808305plx.351.2018.07.09.08.58.47; Mon, 09 Jul 2018 08:58:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933582AbeGIP6p (ORCPT + 29 others); Mon, 9 Jul 2018 11:58:45 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:45283 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932848AbeGIP55 (ORCPT ); Mon, 9 Jul 2018 11:57:57 -0400 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 Cc: Arnd Bergmann , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Sekhar Nori , Gregory CLEMENT , Alexander Sverdlin , Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org 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:gnJUTlPUSHc=:LU7wxRoAQn2gIVlOwWYwC8 nVLGM0KrInbpmR7oTQ7gzluXUAAX0LrXYzFr7+OYSyOUe79ZFGeucOhak1NbyltzjVgMsF90T JohiioiLW8O3zuVIVIPCEetdpk5QfvChI/6v+pZf3RBZUjmy7FQNxgNFKlhKl4uErtc7Ah07x 3A/H55AOoOCfnpQP2DrHH0+/qIvc18G388LBQ83tP4psOkR6qjmjCun+gHR+y2zqppEggNqZ4 tiqxin6/f8GIlERHIgtCZk18vXzddxFconpl4BuH+c7QJwaJsSSkNXq85xQ2cMTAIFbov6M7a IjlCWSeYvV4gT6KpUKCUOS6tdCTMuU89PiOJxWpn1FIkB8jPbAh6xAZKK6vSnOiP+tkJZh+cV HMts1UKfFkQ8OhgTo9QTIGBwpqd81tavWBLR7sJkoK8euJoNvJMQYw+f/qODjCiHLDrTtLK7/ PbqoDBxWe/q0XHtUHQ8u5u1mL+EQL5JGUJzP734LYcQcnfao2MPGTo3QPmuU+FdYieHdplrnb yvvyFIYZokaazX3KpzGpP1pErcTL7SxT1dcauPk05Ce1akTY+CQ5OE5xNcYs9WMEE7hZHjAAj hxtFXbqSyvLE6na8tZLhmdZVi+dT7vci4NOEJILM2PAUqQiZh9UXtDejVI0wa8MIiSVBF8T3e pCfJODYu+4VQ1iOsRch6n23w8cVYVo3A/n8pAIV+AWKrlOs8gq4KahgVIWOcusslHoD4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- drivers/mtd/nand/raw/davinci_nand.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 2.9.0 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: 141461 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2829727ljj; Mon, 9 Jul 2018 08:59:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdTq8qM4s8NEYLu2DM12tZh5hD7h2Nyr6AtqKmJ3z66fOPDIZOIZ3ArOdGuvrAnpF9wWQNj X-Received: by 2002:aa7:87d0:: with SMTP id i16-v6mr21823215pfo.82.1531151951482; Mon, 09 Jul 2018 08:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531151951; cv=none; d=google.com; s=arc-20160816; b=nO/OjoLAw9Y6K8KSiMblShwnQPm+jMZd26mDnksUAuyvlYUWkSCa3OFIoNcsU+HDSH chMRFIgFoWAj+6LNH1CFLUM1KWc7mUJujacc76ma+oVSkSPlNwZ+I0w4ZY7sSMYUm9j+ 2tDG1nb/5NeedIBQYHZR/g/z1YHH1VjLU0f5Rbp+BKq7gSj6brVVzieudfF4AGoUyq9c M6VLrZn8fQJKCL+8L6Ah6dj2f913csBLSp6rK2oMWXctmTDa0+9aoBGFGTTBjtWR9x4P x/rv91Jaf8irGFNDjadjjTwxi97hjiNly3/h56xKy2kqvy7Pa+iUMGPl/kHe3Mrk/Gm0 sZMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XsyZlqHV8CYgXLh7WgaYV24I+ZXyQ5Nj1+W2IVCvtmE=; b=zhpzRj4DvVnntJZYJW2nlhICc5bBmHh8gf5Y7PKfQ1NmWybzJGd9dLwbwnesDtDq29 A2diRTqopdXg/z8PTki4mm6SHyMl1VR9dkrLg3YjcjvwSAK8lEnyRE3wU85ycGaBZPol bVRWa/5T73jfwZyHcSt50wqMb+w6jsXwGJkHGBJk2nT9g+CME3F75bfsPbbsWCmOlbVm lI2SqhqmBuqbQy0GRU7CZwztVcHIzm2GOK46CVdVcawcwzPIYpOUjkJpEsPJvx2JdpVB Zwatr9cD78F+ilHM2nzCLFcOBqqfaoku1XZKpkc2GJTf4C4cOUm9w0F4U1woTxVIDZ2i pa4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si14808305plx.351.2018.07.09.08.59.11; Mon, 09 Jul 2018 08:59:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934048AbeGIP7K (ORCPT + 29 others); Mon, 9 Jul 2018 11:59:10 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:35877 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933025AbeGIP7E (ORCPT ); Mon, 9 Jul 2018 11:59:04 -0400 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 Cc: Arnd Bergmann , Wenyou Yang , Josh Wu , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Nicolas Ferre , Alexandre Belloni , Masahiro Yamada , Gregory CLEMENT , Peter Rosin , Romain Izard , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.9.0 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: 141462 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2830244ljj; Mon, 9 Jul 2018 08:59:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc1kSltIcYZQ28m4jR8v4oZ3jYDVtw6qoTxByz4tMPz/FJMMlfav7poKscUiKHrSWcY0Wwt X-Received: by 2002:a17:902:8b8c:: with SMTP id ay12-v6mr21078404plb.74.1531151985517; Mon, 09 Jul 2018 08:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531151985; cv=none; d=google.com; s=arc-20160816; b=mUDR8MWwgqQysWnSrZYLmcH/mxUQr6b6OQAWTmkrRBU52pcMwqyZB7LZG3z0upKwIE 0YV0sT53T4xS9lHCIAqgJ9u7U0VmCDTrtCsGFCtROYXjJkFSI6XHdZVjAJwzZEwICj57 +K7VvvVHMn98HIMXbSSq7BPerur7GiT4Gt+S2f54tCtjFkVTD1NV+InLPeL+oyN0VEMP f6ZY1lG7rgW+mUIlyTEtYNZo15n4lPOsC6OoSXtnMb3i1MTepqeDvs8pbS4pFKdTDbiA bDviBEn9ulgcaPSaaSSTeVwXMyjnaTIHZquVUmBeIgLch9jqRdz2GbDgajFolrJhFkcJ hpGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Pni9DQs90C3b3QCbn/c0xnGH2HfshfCvbxOvEn4yACI=; b=i+pTpljurT3tOPXi/HKTw5ZheezMW1JtkVEwg2pWvbscbKCXAHzyAqdwXLI3pZIkVj N4vIjEiMjFYpDSEqbn/qUGmpROBrDsVEZo+QVKqCvBxS2P3L6mWWm6MJlaIY3lmZzkZO uxLltw5Q3bTL6LEH4DV16BLUZXif3LOvg6pctNZUVKKG4DDdqyJlLBIA4xlWGsqLAz5N GhnTvPYi+ZWkWdBWuUrg7tnuizMKuPZulttaEQe+17IPKfgiIUSco0uKiW5NxTlYAF+C 2RCHiGW04v9cuNnC6d6Giq0ZjV1Ck+UTr467VrX4M+I9YxHTKqv8tgQ7yRgSjeCF33/N rQVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x62-v6si16638260pfd.124.2018.07.09.08.59.45; Mon, 09 Jul 2018 08:59:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934083AbeGIP7n (ORCPT + 29 others); Mon, 9 Jul 2018 11:59:43 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:42377 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933565AbeGIP7k (ORCPT ); Mon, 9 Jul 2018 11:59:40 -0400 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 Cc: Arnd Bergmann , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Maxime Ripard , Chen-Yu Tsai , Masahiro Yamada , Vladimir Zapolskiy , H Hartley Sweeten , "Bryan O'Donoghue" , Philipp Zabel , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.9.0 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)