From patchwork Tue Mar 12 08:44:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 160063 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp12851410jad; Tue, 12 Mar 2019 01:46:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSKn+YQMO78IRT0A+5x8OsxWH63Ptkjzu2yK8cfp1roJmwZSQsiCSNSMEHCmAvXE6IiGjk X-Received: by 2002:a63:fb16:: with SMTP id o22mr33266365pgh.209.1552380382988; Tue, 12 Mar 2019 01:46:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552380382; cv=none; d=google.com; s=arc-20160816; b=hvj5lmrDNPYuAXlPu10LqDoX6U/A5CWkw42AjlU9cm4dYHz4C8VlAYHS2YX0a2Onz/ l4zrkX6ry0zxY8moT+B87i8BC2Y3kYtG/C7/1e8gJMalDufJdA4Eksj5kRlxOz3a81ue rRS44PMDPnfo5LbavGa7MSnvLAltOXT8YUKc9dzOK06nXIlamaQDIS/Mng2xYRw1a/Xi vegeLNBTMCYftEK1ibg8e+ZD+QHSQ/25WYVxriOBjyv6PT+OZMKGnfKB7CKiswArWuHi WuroxqnnWzWTQ0DqgMgeB5xtpgyEU6jcaaLgjIjVcuz2Zh4EclC9FQp+jvjUVfd6Zakz ir+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter:dkim-signature; bh=qj2vC+02pCPgm9enQANKf11hLz/ynK7J54G/44siBtY=; b=g+ZDJRLgAGQrio5F1YQLzrHczCjfRV9CLxIahEiBCmnGWmaxSf9x4EGSeueMiAu9wb AydWZLf7vgGnjY/T5pG0oBscHEuywJ3Cw23B24MhAbfI5Mibtm7/4E5jYDbkLN2Dognj tYMPJTgW6J65EJKRJZuRu5Pn0dJNDlHonuGlvuiPq67ZqIvV3Tz0RanTk/z1X+5+qSXE svw4jcKcBC8jVzja/BNgtxXW+1psW3GaZk8ir665y8LMXgpXZ5D9ZPXGAJZ5qbdz6gTE 7eD7adgDZ7lZaEv14i3e80fq55+fhsnv+gu8bUPQfC5/ajz/PSwnieUDlxQXWzh8zeLa +RwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=WOyIp8xk; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b="NORy5/8b"; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id x61si7734730plb.197.2019.03.12.01.46.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2019 01:46:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=WOyIp8xk; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b="NORy5/8b"; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org" 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=qj2vC+02pCPgm9enQANKf11hLz/ynK7J54G/44siBtY=; b=WOyIp8xk4rfjYQOG1LH6Iz37jD fUvq/BperaBc2toM0uWT4NuA2P4bxlam2L9dTC6ynR6dVLbTUM62MuVsnY6e/WCkWV3SeFcI+jtXG KCG7Svg21BxusqRh17HkDHMzGtzuPsiYiEuq2tM/mfFQfwxsURdol0KjPxD2Rg4EFuoH3LPBGUb7x zBUpB+wbh3sEnrQMHw0uQY3b4N42owzozy3WpK2v3EcqI9FKvusd0cgCzltDrKUhfSUv2Bu7fU3zZ X08CdV9G85KCbZxptTQ3tokwcNJMSlI3geaO+PmkckUj+PocGnhwh6XEWEmPS4zGvwRkTYDwZ5IA3 gwIgigYg==; 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 1h3d39-0000no-O6; Tue, 12 Mar 2019 08:46:15 +0000 Received: from conuserg-09.nifty.com ([210.131.2.76]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3d2e-000074-IW for linux-mtd@lists.infradead.org; Tue, 12 Mar 2019 08:45:47 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x2C8j6Zd004092; Tue, 12 Mar 2019 17:45:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x2C8j6Zd004092 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1552380318; bh=qWRjILUJ5jjZY9FFH+5ZJYFjW1Di+opuV2JZeSRLmxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NORy5/8bdn8Lkj/xBxzJVLbdu4wKQmDJUa7pWwu9BQgl5fN6jzQLlUeEsV4rGrTnv nqDHbOH/aXTOuFsl1GePMvdWrJeRoHTEAlUrIlE1wC5BE87hVSH61Nz8krg0rf1Y+R WxNnAjLL5G7REQ/OpZYjmIcmgEQ8pr2FVTi50rMCQbdDbxuJ6nRJZCYVqgnrTkgsX+ CRMJoAt0XC0BTImMtYETULmyaa2f8jrGiRrTINzyj6dp9nNRrGSr99ummQCkEhiUbF 6CJ0jbOTovxDo2mmcPo43S6IrzA6JJaMvWxzVhVKDCqnYRcRD0ks2C1dWhcA7vYtyA o2fROoHmL4rSQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH v3 3/9] mtd: rawnand: denali: remove unneeded casts in denali_{read, write}_pio Date: Tue, 12 Mar 2019 17:44:44 +0900 Message-Id: <1552380290-19951-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1552380290-19951-1-git-send-email-yamada.masahiro@socionext.com> References: <1552380290-19951-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190312_014544_932059_E1740D86 X-CRM114-Status: GOOD ( 11.02 ) X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [210.131.2.76 listed in list.dnswl.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: Masahiro Yamada , Richard Weinberger , Boris Brezillon , linux-kernel@vger.kernel.org, Marek Vasut , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Since (u32 *) can accept an opaque pointer, the explicit casting from (void *) to (u32 *) is redundant. Change the function argument type to remove the casts. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None drivers/mtd/nand/raw/denali.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c index ebeedbd..d2040b7 100644 --- a/drivers/mtd/nand/raw/denali.c +++ b/drivers/mtd/nand/raw/denali.c @@ -478,11 +478,10 @@ static void denali_setup_dma32(struct denali_nand_info *denali, denali->host_write(denali, mode | 0x14000, 0x2400); } -static int denali_pio_read(struct denali_nand_info *denali, void *buf, +static int denali_pio_read(struct denali_nand_info *denali, u32 *buf, size_t size, int page) { u32 addr = DENALI_MAP01 | DENALI_BANK(denali) | page; - uint32_t *buf32 = (uint32_t *)buf; uint32_t irq_status, ecc_err_mask; int i; @@ -494,7 +493,7 @@ static int denali_pio_read(struct denali_nand_info *denali, void *buf, denali_reset_irq(denali); for (i = 0; i < size / 4; i++) - *buf32++ = denali->host_read(denali, addr); + buf[i] = denali->host_read(denali, addr); irq_status = denali_wait_for_irq(denali, INTR__PAGE_XFER_INC); if (!(irq_status & INTR__PAGE_XFER_INC)) @@ -506,18 +505,17 @@ static int denali_pio_read(struct denali_nand_info *denali, void *buf, return irq_status & ecc_err_mask ? -EBADMSG : 0; } -static int denali_pio_write(struct denali_nand_info *denali, - const void *buf, size_t size, int page) +static int denali_pio_write(struct denali_nand_info *denali, const u32 *buf, + size_t size, int page) { u32 addr = DENALI_MAP01 | DENALI_BANK(denali) | page; - const uint32_t *buf32 = (uint32_t *)buf; uint32_t irq_status; int i; denali_reset_irq(denali); for (i = 0; i < size / 4; i++) - denali->host_write(denali, addr, *buf32++); + denali->host_write(denali, addr, buf[i]); irq_status = denali_wait_for_irq(denali, INTR__PROGRAM_COMP | INTR__PROGRAM_FAIL);