From patchwork Tue Apr 2 04:03:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 161598 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1257151jan; Mon, 1 Apr 2019 21:04:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYXqsFDCJfb/2Hw7YJ1tlVpkIhbBU+OTRS/nga2Bh5CeWIy58JSxKkVQI+8sihJu96aJ5R X-Received: by 2002:a17:902:7081:: with SMTP id z1mr26832753plk.252.1554177855904; Mon, 01 Apr 2019 21:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554177855; cv=none; d=google.com; s=arc-20160816; b=wGoTImiV1AFBZxUbx3dzkDaGOuHcSSSdcIOzKrR1N+SEEDK9grKSPGE5btwHpcxw5L NynqnjjGMQ41k+5/7ptZcboh0TUQYKD0y6xXw77OWwHDUj1CRsRXIEJzMdC6lwTO5gIm VBjf+6HVW3wbVALqQhmG4chHxyjV5D+1Urx6DjNJQjDUCXsJHfHg68nwCickJvEZ8Nb1 5iU1QgDfvoF2efoKvWcFLCJHrNB5u399raSsnoNchlsLtdhyee2bFolAsZtHns/BbLhD 9WRK24NjU0+gqtSlwIgL3HzgaqiTnQwQbvomuw2rjejoQcrIrFUxD3Mzml6D8U7iN+R2 ANbg== 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=XBSTWyAeWicoVafmtaozkF1ybH5QU0Yf796gKPi2fGI=; b=OSYf8vBAXKC3ytRK6ZmSmQFAtDPA2gi5NPtW3n6MmPo+aEtrwQU5S4jew04MzBc3J/ gmyD2LXrqSgnhuje67rfeCfSevqlTclTnfOZeCZPhgLYc0HQ+bEMTamu0EoZmgq54sZA veP+22GskuX5c/ekn/Lri7D7P2rU6CU9fNyslNBsW8GpeZcD46cZYgbWVNB7qpBVvKdz ps3mRqxg3wYUke7/qVhez0VY4ZjD+rK9W63Ul3anU4K8yuw5N55jg4dz01OMxN8qNbR/ TanJhZwmJt3LY99kfD0Sp0AQn5drqWt3a8YGs9Wdb8JMHzuWi7S5bPrz/fUj0qDf68Pb rWMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=kYJHKise; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=zKFkzbQf; 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 x30si10670163pgl.477.2019.04.01.21.04.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Apr 2019 21:04:15 -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=kYJHKise; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=zKFkzbQf; 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=XBSTWyAeWicoVafmtaozkF1ybH5QU0Yf796gKPi2fGI=; b=kYJHKise45xH/D2vnmq6wpGLFp VRtrTmgLJIU/F/Je6rqhhnvwHn2lGWRSs2OjFiM0FbgNTUP/7hTvNFdJiDisqXXK6zV9DREv3W/Bn r+A/esqxcyeJ00ALbjrRIj+v/OPtnPwKlKQ/VE4r81CZRTdD5MLzpuqo35wcEih1DyFkmkytHx5f4 gPzDs/WqdOQrCmxEX9EGp3cdSyHdW2T8IUnDBL7wEHiTxrFmNPp3piVuHbdn3ImIF8krRulmnsJ95 rG3AAHUg+ZH5urnZVxf1A54xf/SRSC8MR4HmoF39/hB/6FrZ7lph/n1dXY4Q/J8Avv3w5WOwDSArR lVtU7Nnw==; 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 1hBAea-0000Aq-II; Tue, 02 Apr 2019 04:04:04 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBAeG-0008Cx-1H for linux-mtd@lists.infradead.org; Tue, 02 Apr 2019 04:03:46 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x3243HaW021871; Tue, 2 Apr 2019 13:03:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x3243HaW021871 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1554177801; bh=hwp7B4epm8xIJuNf4RNloi2tLVuAeJkYxTUaLmMTjAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zKFkzbQf973zNpAcNfC6xUrmOYIx6eX8Lyp3shiPnIc6TRgl6dFbiBeLjbtBQJp63 oDMP3VVXLDLUeI4GrBIVMjE9cFqGXuseluPq4Ocgd2cuSEQCK10lh8I2zFdpsnFXcz VCox/AXG1ZmcSjHDrooB37l5QkaFvouS6K/YAwpsG2T3/+HWr2zozZgQWkWMBgGBkG rHeqRgtuWsOzBlUdabAws4HyPHZWvqnusnukThIlLDMWwpgodZzp2LSqcIIhGtRUgj kY0k/HTTxgT75vpZ6T23kJ4MepkDRsq72ycDfP2DpljX6nRFyLhd1LHyjiMbZZ0T4c PrG12Qp+stCiA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH v5 3/9] mtd: rawnand: denali: remove unneeded casts in denali_{read, write}_pio Date: Tue, 2 Apr 2019 13:03:03 +0900 Message-Id: <1554177789-15414-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554177789-15414-1-git-send-email-yamada.masahiro@socionext.com> References: <1554177789-15414-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190401_210344_374661_E5E458E5 X-CRM114-Status: GOOD ( 10.89 ) 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.74 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [210.131.2.74 listed in wl.mailspike.net] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 v5: None Changes in v4: None 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 6a3520f..1422015 100644 --- a/drivers/mtd/nand/raw/denali.c +++ b/drivers/mtd/nand/raw/denali.c @@ -654,11 +654,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; @@ -670,7 +669,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)) @@ -682,18 +681,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);