From patchwork Fri Mar 29 07:28:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 161399 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1696712jan; Fri, 29 Mar 2019 00:29:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6lJZ407rC69CMuElwY+wtPBjYjDsSpF35A+nwF/sWvRAosIPAf2AI5CLVsTzVnYT9bEbg X-Received: by 2002:a62:69c2:: with SMTP id e185mr4223501pfc.119.1553844573378; Fri, 29 Mar 2019 00:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553844573; cv=none; d=google.com; s=arc-20160816; b=eVYlJwoPKAx+GfGTGufudjuYXBXn0b/uMLVhz1lCbvM1V8ciXVxiE1yZ0TmqxVUXff WozR6tAQZbQFS1M/XzINcESti2VwvQGDHh5qEFSd0A4KfWAjqIrFVL6B85vLfPOPMFyR iNkslv0pqygE8nFlm0yCiYVwc42xOwrPaQukEyJ26pFeguTjlQGuVSA3H4fBCYRg1ow4 BRLOSDiJqNX3+1XrnrhAZnpk+Ws1BvfDoYjvzCu945mcXnium2HDDAKrx7ip/w7VQegT TTdxV0RFT+xroolLzFIcoCyL4nFj8+5x8L0wLw0LYHf5UyTD+IA2i8jMpId/ceaUmW7b UKtQ== 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=sS/QjJvXVly7pAfGPvDAcvAFDmkbv/jt3yOOPWqP3+E=; b=ppDqOJoIvg9JOF4MjSz1ksoFnIJ0Uj6xIj6wgkhqteLHriuBqQ9oVoNWSHePh1BedG 9uN2h4olDn4P7ef9JOb2wchwbw0m2qgzL1iyUl50RRxqnJa/C6Dnes9cCgHOC5C3Tgrd bIoqFsP3z+8vDWGU6jbbOOE23oUHJN6KHuXcr41vbONJxaLZi/FQ6Ak0RceJ9EXrrSNI uaio+tlAZbICRyKVYo5nY0SM5SRnCbLdBaKKXmSxAfKd1ZhRzXJJwqe1Lu+Qu/oOOl7s Kf0q4S78dUA1fUrpCOhTkWV5l9z98pArd7vRnSvEtXHEE5wFF1QJe90JJXdbPdtE6hJ4 OaOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=EKqal7LI; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=LQmIpF40; 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 o18si1259350pgh.403.2019.03.29.00.29.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 00:29:33 -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=EKqal7LI; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=LQmIpF40; 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=sS/QjJvXVly7pAfGPvDAcvAFDmkbv/jt3yOOPWqP3+E=; b=EKqal7LIGSgyn8sETNGnnmH/wO TUECXDHX2ClgVeHU10zfBI02tTAVcYF2xLTLab66cJCZZzjv3kmgyOoYBJpuIeaNVd+a4a222pxRy WL5kg/FaiMCM4HH1xaSdshY3dfbx16yetjq4TjTQek7prVr1Q1WJcNQuPEJA5+J/fwzMXQxzs0TEF tQCC8nKVxpoEHa1KmW1mTGr0jatJr1ScqunOHDIkQDXOaroHVzrmlDiT86LY3K88mIG0tjPeJR1Jw V+lTOIshC2BOoYnJJUBC1DS9UqkK9/dVq4U5+Z0UTnMvQyeQMJNxzt2WtQ0RA5qdNiovKozv1O2Y3 uIhcngFA==; 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 1h9lx4-00057x-V4; Fri, 29 Mar 2019 07:29:22 +0000 Received: from conuserg-10.nifty.com ([210.131.2.77]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9lwY-0004Q2-3P for linux-mtd@lists.infradead.org; Fri, 29 Mar 2019 07:28:53 +0000 Received: from grover.tkatk1.zaq.ne.jp (zaqdadce369.zaq.ne.jp [218.220.227.105]) (authenticated) by conuserg-10.nifty.com with ESMTP id x2T7SQaA002537; Fri, 29 Mar 2019 16:28:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x2T7SQaA002537 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553844509; bh=A+tZ7XYQykbIjw5JmlgD8POyw4cnR+gEsgER2RW0Jms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LQmIpF40uifpUy/TRK/8ysQgKQf6z59bbQFLTOrV7UgH7HYydBuxRUcEBn1B/DeVE MVBdOuGrWMk92VCyE4xIi7BreFiL1QDz00JSdHeDnsAUEdMuHvXPG9hdCBKeXVgFbB ae2XF2GBSVNiDAiVFLzUKn+krK2MUc47iFHedF3JuQBVBMwEZV/ybuhiTjPMR/2Yco DALfaTtk9rSiO2cZ1Qfp44wcgY0+jUOL+o/5QnjZKEta4k1p5RHwnXRi5kqlHc/uOt gPTyWo1Jfl07cDH6HKvAYv6ISqDY/N20v/hTKu+GhyDfmFtXFwQ3tfMxji1Xo2WVxu R5CfPoPoVLq3g== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH v4 3/9] mtd: rawnand: denali: remove unneeded casts in denali_{read, write}_pio Date: Fri, 29 Mar 2019 16:28:15 +0900 Message-Id: <1553844501-7119-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1553844501-7119-1-git-send-email-yamada.masahiro@socionext.com> References: <1553844501-7119-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190329_002850_458633_7B5FE39E X-CRM114-Status: GOOD ( 10.34 ) 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.77 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: Marek Vasut , Richard Weinberger , Boris Brezillon , linux-kernel@vger.kernel.org, Masahiro Yamada , 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 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 9b27338..bf968cc 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);