From patchwork Fri Feb 8 08:08:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 157806 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1663697jaa; Fri, 8 Feb 2019 00:09:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IaVviE98z/MDr3GOwHK089LHkb8zPigivhuqGg4ods8ID7itxy1Eu+LKMTRNyhprHAPAeDt X-Received: by 2002:a63:d34a:: with SMTP id u10mr9038497pgi.301.1549613382497; Fri, 08 Feb 2019 00:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549613382; cv=none; d=google.com; s=arc-20160816; b=seW5NPs++cGOAaUMc0OIu2agnFxr475wg+kHOTPgs4xYD4D7kBhlS7hLB/0KOL5tZq /kg8UW/p0nojtSvBDkpBuGtJvGvtZsUgRr5GPKFNu8gLNumfITE8GRJM58UNOHAz7Tib yTFZV96bxcUZR0+ZcR6I0bAfTeKloavN2nNy28mKoARbYJYdiXhgB1EP6dhapbSCYeFk MkenBB+zptop9fltMt3aeGC0zOv8sXqej1Fy+EtzXlOXMg/9JojuHwXlDn8UPlSJSNKk tQ9eYi8+JSLm4y3nyo6QbvPd36ywhBu/WtkIlQix5yQNTmkWlLJvXlppW/fOzSSJvPb0 8D7g== 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=EKZLckPP8MvHvFBF5d2M2y+z/3moPG3NDCPfQW1swOY=; b=DmOQaBoGEPF5TedXt7x6eBIfN2G+wdN7hP1ww8C7Zu6Cre0jEK003bEpvUvrd9ZgfC tVEFdLILatWkuhJzfp28JPNxX9/yQbhRqcUlfGnGiaugtZuSQoRzByKueVCVqfsJGgqG +BfuoroAHD+pU8AE3bMgywcD498DS+FtaYZfebcsv3qGlmZSWN0XzeCYtz4n3gy9+1wt a9ApDIzpPVEediosPkG6XxX2LDYwS8kLElxJYUAMMZLkuTUlhtVMDx+qoWGmP5JI8Rs5 FwssPDVo7MGKFAKeikuYJJz6FgdwV1oTapNUtDbddIhXth1irOzemO2rKsMKafa/Evc+ Xu2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="M/zoXX00"; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=WbYVO+gJ; 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 38si1563564pgx.460.2019.02.08.00.09.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Feb 2019 00:09:42 -0800 (PST) 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="M/zoXX00"; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=WbYVO+gJ; 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=EKZLckPP8MvHvFBF5d2M2y+z/3moPG3NDCPfQW1swOY=; b=M/zoXX00crwImKW3TJQlSSFFHu XG0d6W75oTBYHQDctDuOOtRzPbf/JDApcxMalxoYIP8HDvsMdSVRVBdn1gkgjXLrzgVGeopF0T2hr kfJtebZXos/YA4l2JIgCXDD69ENoz7GWadomHYSkryLvqq6XGf46fVl9e3Z711aNHV2viIGfQggHW PutK8u6NeYqPKI8sSkOcuOmHZ33RB6xqlmyuMRtKO04W0xFzO2Yc6jgP1NsLkV6MyhUHB/AKqxOzw cTXzuHxNy2TNzJMv+67GA295fvNYtDAywh/NZqvTha1JRc1de1DyakBZzZ6Q0ahGEFJujiNvqR01l 6w+WuNfQ==; 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 1gs1Dy-0006R1-GT; Fri, 08 Feb 2019 08:09:26 +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 1gs1Dt-0006P0-Tp for linux-mtd@lists.infradead.org; Fri, 08 Feb 2019 08:09:24 +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 x188902C007241; Fri, 8 Feb 2019 17:09:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x188902C007241 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1549613344; bh=rjWhvlUWNUpZmuZcusNgiBwXBwtkYUqY7KvE7yA/mk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WbYVO+gJs3fMimX9FNBAHfPQcXKowrUyv1LaHUTfJhBeZ/5Q5nTTOX9BoZ8dtBZJU XOmylJEXi3cDZcjJFnv0A/mZ+ldwOtrshdWG+df43EyRLrY114e1FGyNNe5DGt1h6m ECN6LZYip3YqkKO1Muh0yzjSwsooP+ES3l5KwAB7A5Rmm+yyg02IMT5spVfZz0PfVP EDrmyISB/Uapqag6Nea9f28CzfItxBgBOhCySA0omwKhkL2no2UCENt+Rw1JzqDyg2 e/6Bg2y9ev28UCSCboA2/PJ8u7yU6Ek2YA2bo4eqccOuryKNkoVRs5/uiYQFgLN1xf uWU/2utAV4qSg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH 03/11] mtd: rawnand: denali: remove unneeded casts in denali_{read, write}_pio Date: Fri, 8 Feb 2019 17:08:47 +0900 Message-Id: <1549613335-30319-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549613335-30319-1-git-send-email-yamada.masahiro@socionext.com> References: <1549613335-30319-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190208_000922_395140_B86030C7 X-CRM114-Status: GOOD ( 10.21 ) 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 http://www.dnswl.org/, no trust [210.131.2.74 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 --- 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 9287f4f..a2fe2ff 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);