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;