From patchwork Fri Mar 29 07:28:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 161397 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1696483jan; Fri, 29 Mar 2019 00:29:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsieLKBKKtp9DS+p59hM34zP3PXr/wD1Mbyb9/U5ZfQ2o9QRJQuIQrXaQhO01sCagAAzSK X-Received: by 2002:a63:8143:: with SMTP id t64mr45244979pgd.301.1553844552951; Fri, 29 Mar 2019 00:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553844552; cv=none; d=google.com; s=arc-20160816; b=CDjs9WwLJzkDoNYxLvmxACeQk2tZrGcn7SQ+y32YqWxHmZogFADohUni+hR65E9JQm NP8culqV8m18pz30OoH9PTCFrRnDlzp5bBId1t7WF6y6uqcWHmhEiHlApz64SFDq6w1j 8cRhPdq0aIdq9RJ/YqIvokutN6q25Iopcfc/ryajqGiNpV3+OiTnvHFNRApmdK0RXNY+ Mh5tACwXQfkC0SaHSLmtSbWDozuND+vR8k5+skI/GfZsm224QTpJm/WcQH5yKz7E6Gzp RCH87ciJcJDNoAs29lYEdCTcEItJ90DkJvbkEpMokx/SITqVUweq07wIGvd7vClfQE49 PX0w== 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=kOm+lqNtHM+mXoyhIdwMcKV+UHtke+KU9Rrcxe0cvqo=; b=dBSS4Mb6KV6YaaHxgmdKK9f4oZGMz1GYxQJ9JvtxemDkRcu7nHZHMtiNDcvqSNM+l1 Xzg8BRp5+BGock59P04e+rvPFFe3NTAMlm00H8Yj2trKz+MGxiQhwKm0uNfHNs6XaFZp rm6ijOt1pNHw1f4bAJVguY9VCVB002WZa4v9ge9iod8X/5INqLDNovcBzc1z0vHJn9k2 9PE4tIcLjFPSXmvKAWjGsDgs59ymfzweF0O7kKUoLT3aE4eGtNOL0hn7NxtDchuzwFE1 YOPjGJ8p08TR25EWSkgWxI8pUSaH6IbVrwaDij1a5fiHLphVt1fnE3ZXU2P5hqs5CQTw +F8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=uDMh3SX5; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=Eh3zpmHu; 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 k12si1229109pgo.429.2019.03.29.00.29.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 00:29:12 -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=uDMh3SX5; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=Eh3zpmHu; 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=kOm+lqNtHM+mXoyhIdwMcKV+UHtke+KU9Rrcxe0cvqo=; b=uDMh3SX57VPbhWctWz+BsbdzVT REzJfV4QmPja2phPnINi7rWtLW40/WAWtJEF5QrAVOlTjwhE7ZbbR9hy2G5q1uozvWGt+mf/0WIJ7 3oIoAZIkExaD+RzfWTA9IIZZ3g8mR+U0dqkkRwRe5wKhXGSqcSn8AFunB4QQI80QD29DvHByFysjm snOuoyH5Zj4OSh859ami2VLRE3SOBxXiFqXW0h9V8iMNrXAc82O/JodlfTuNAxRMh+zBvHiEqd2c9 5NO5pcu7mOfLhU9gvfuzb2uwk5MmJXuG40KJkTtE7CVrc3ifH/SDt/fltJhjolvHtnikaCfupDZe9 BSV2rmug==; 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 1h9lwj-0004cU-SV; Fri, 29 Mar 2019 07:29:01 +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-0004Py-3M for linux-mtd@lists.infradead.org; Fri, 29 Mar 2019 07:28:52 +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 x2T7SQa8002537; Fri, 29 Mar 2019 16:28:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x2T7SQa8002537 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553844508; bh=5RTtQmno1apwHHMAvzVvaTuhS9ieNMZ8gRdXw711EBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eh3zpmHuGOa5XC37HBRRF4KWGn1BZFpo7NA2j7IXHns1yyrdnNdqNJRp8yG3ojR1L ZC/qlhHmMlIgDEhVIgL+IrwzfmHEufubBh23JGHoZWHS+yakhcJNLue8SyGp1QTog3 eDwRoqjlKcwl24YP4x+6vKGiILFP0M62Bzm3R37vJ7n4wSZU1a95kxDA84KlRpzezB 3d8ca751UYG6gFRGpp+fzrFKrnY9z0HNd0pPfMlMdAsmUInvazZAtmoL/Zc/5xZEVh f7cJDuddYCbw6U0nnOO9LaHmxaQLVtB6KPvHew6aCai/Q8BzRjkK7C8eFd7rdCNz3b iXi4xnO2RyMaQ== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH v4 1/9] mtd: rawnand: denali: use nand_chip pointer more for internal functions Date: Fri, 29 Mar 2019 16:28:13 +0900 Message-Id: <1553844501-7119-2-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_366190_5973A8E0 X-CRM114-Status: GOOD ( 15.17 ) 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 With the recent refactoring, the NAND driver hooks now take a pointer to nand_chip. Add to_denali() in order to convert (struct nand_chip *) to (struct denali_nand_info *) directly. It is more useful than the current mtd_to_denali(). I changed some helper functions to take (struct nand_chip *). This will avoid pointer conversion back and forth, and ease further development. Signed-off-by: Masahiro Yamada --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/mtd/nand/raw/denali.c | 57 ++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 25 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 24aeafc..4ac1314 100644 --- a/drivers/mtd/nand/raw/denali.c +++ b/drivers/mtd/nand/raw/denali.c @@ -47,6 +47,11 @@ static inline struct denali_nand_info *mtd_to_denali(struct mtd_info *mtd) return container_of(mtd_to_nand(mtd), struct denali_nand_info, nand); } +static struct denali_nand_info *to_denali(struct nand_chip *chip) +{ + return container_of(chip, struct denali_nand_info, nand); +} + /* * Direct Addressing - the slave address forms the control information (command * type, bank, block, and page address). The slave data is the actual data to @@ -282,12 +287,12 @@ static void denali_cmd_ctrl(struct nand_chip *chip, int dat, unsigned int ctrl) denali->host_write(denali, DENALI_BANK(denali) | type, dat); } -static int denali_check_erased_page(struct mtd_info *mtd, - struct nand_chip *chip, uint8_t *buf, +static int denali_check_erased_page(struct nand_chip *chip, + struct denali_nand_info *denali, u8 *buf, unsigned long uncor_ecc_flags, unsigned int max_bitflips) { - struct denali_nand_info *denali = mtd_to_denali(mtd); + struct mtd_ecc_stats *ecc_stats = &nand_to_mtd(chip)->ecc_stats; uint8_t *ecc_code = chip->oob_poi + denali->oob_skip_bytes; int ecc_steps = chip->ecc.steps; int ecc_size = chip->ecc.size; @@ -303,9 +308,9 @@ static int denali_check_erased_page(struct mtd_info *mtd, NULL, 0, chip->ecc.strength); if (stat < 0) { - mtd->ecc_stats.failed++; + ecc_stats->failed++; } else { - mtd->ecc_stats.corrected += stat; + ecc_stats->corrected += stat; max_bitflips = max_t(unsigned int, max_bitflips, stat); } @@ -316,11 +321,11 @@ static int denali_check_erased_page(struct mtd_info *mtd, return max_bitflips; } -static int denali_hw_ecc_fixup(struct mtd_info *mtd, +static int denali_hw_ecc_fixup(struct nand_chip *chip, struct denali_nand_info *denali, unsigned long *uncor_ecc_flags) { - struct nand_chip *chip = mtd_to_nand(mtd); + struct mtd_ecc_stats *ecc_stats = &nand_to_mtd(chip)->ecc_stats; int bank = denali->active_bank; uint32_t ecc_cor; unsigned int max_bitflips; @@ -346,16 +351,17 @@ static int denali_hw_ecc_fixup(struct mtd_info *mtd, * Unfortunately, we can not know the total number of corrected bits in * the page. Increase the stats by max_bitflips. (compromised solution) */ - mtd->ecc_stats.corrected += max_bitflips; + ecc_stats->corrected += max_bitflips; return max_bitflips; } -static int denali_sw_ecc_fixup(struct mtd_info *mtd, +static int denali_sw_ecc_fixup(struct nand_chip *chip, struct denali_nand_info *denali, unsigned long *uncor_ecc_flags, uint8_t *buf) { - unsigned int ecc_size = denali->nand.ecc.size; + struct mtd_ecc_stats *ecc_stats = &nand_to_mtd(chip)->ecc_stats; + unsigned int ecc_size = chip->ecc.size; unsigned int bitflips = 0; unsigned int max_bitflips = 0; uint32_t err_addr, err_cor_info; @@ -404,7 +410,7 @@ static int denali_sw_ecc_fixup(struct mtd_info *mtd, /* correct the ECC error */ flips_in_byte = hweight8(buf[offset] ^ err_cor_value); buf[offset] ^= err_cor_value; - mtd->ecc_stats.corrected += flips_in_byte; + ecc_stats->corrected += flips_in_byte; bitflips += flips_in_byte; max_bitflips = max(max_bitflips, bitflips); @@ -587,9 +593,11 @@ static int denali_dma_xfer(struct denali_nand_info *denali, void *buf, return ret; } -static int denali_data_xfer(struct denali_nand_info *denali, void *buf, - size_t size, int page, int raw, int write) +static int denali_data_xfer(struct nand_chip *chip, void *buf, size_t size, + int page, int raw, int write) { + struct denali_nand_info *denali = to_denali(chip); + iowrite32(raw ? 0 : ECC_ENABLE__FLAG, denali->reg + ECC_ENABLE); iowrite32(raw ? TRANSFER_SPARE_REG__FLAG : 0, denali->reg + TRANSFER_SPARE_REG); @@ -678,7 +686,7 @@ static int denali_read_page_raw(struct nand_chip *chip, uint8_t *buf, size_t size = writesize + oobsize; int ret, i, pos, len; - ret = denali_data_xfer(denali, tmp_buf, size, page, 1, 0); + ret = denali_data_xfer(chip, tmp_buf, size, page, 1, 0); if (ret) return ret; @@ -766,14 +774,14 @@ static int denali_read_page(struct nand_chip *chip, uint8_t *buf, int stat = 0; int ret; - ret = denali_data_xfer(denali, buf, mtd->writesize, page, 0, 0); + ret = denali_data_xfer(chip, buf, mtd->writesize, page, 0, 0); if (ret && ret != -EBADMSG) return ret; if (denali->caps & DENALI_CAP_HW_ECC_FIXUP) - stat = denali_hw_ecc_fixup(mtd, denali, &uncor_ecc_flags); + stat = denali_hw_ecc_fixup(chip, denali, &uncor_ecc_flags); else if (ret == -EBADMSG) - stat = denali_sw_ecc_fixup(mtd, denali, &uncor_ecc_flags, buf); + stat = denali_sw_ecc_fixup(chip, denali, &uncor_ecc_flags, buf); if (stat < 0) return stat; @@ -783,7 +791,7 @@ static int denali_read_page(struct nand_chip *chip, uint8_t *buf, if (ret) return ret; - stat = denali_check_erased_page(mtd, chip, buf, + stat = denali_check_erased_page(chip, denali, buf, uncor_ecc_flags, stat); } @@ -866,17 +874,16 @@ static int denali_write_page_raw(struct nand_chip *chip, const uint8_t *buf, memcpy(tmp_buf + size - len, oob, len); } - return denali_data_xfer(denali, tmp_buf, size, page, 1, 1); + return denali_data_xfer(chip, tmp_buf, size, page, 1, 1); } static int denali_write_page(struct nand_chip *chip, const uint8_t *buf, int oob_required, int page) { struct mtd_info *mtd = nand_to_mtd(chip); - struct denali_nand_info *denali = mtd_to_denali(mtd); - return denali_data_xfer(denali, (void *)buf, mtd->writesize, - page, 0, 1); + return denali_data_xfer(chip, (void *)buf, mtd->writesize, page, + 0, 1); } static void denali_select_chip(struct nand_chip *chip, int cs) @@ -1092,9 +1099,9 @@ static const struct mtd_ooblayout_ops denali_ooblayout_ops = { .free = denali_ooblayout_free, }; -static int denali_multidev_fixup(struct denali_nand_info *denali) +static int denali_multidev_fixup(struct nand_chip *chip) { - struct nand_chip *chip = &denali->nand; + struct denali_nand_info *denali = to_denali(chip); struct mtd_info *mtd = nand_to_mtd(chip); /* @@ -1222,7 +1229,7 @@ static int denali_attach_chip(struct nand_chip *chip) chip->ecc.read_oob = denali_read_oob; chip->ecc.write_oob = denali_write_oob; - ret = denali_multidev_fixup(denali); + ret = denali_multidev_fixup(chip); if (ret) return ret; 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); From patchwork Fri Mar 29 07:28:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 161401 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1696879jan; Fri, 29 Mar 2019 00:29:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9GzmkayuhKX729PPqmxgjESeikUwBg0hwXyXUMp1XA7wI878enGHC3sUFZThXpRVyRPw6 X-Received: by 2002:a63:ff26:: with SMTP id k38mr11697827pgi.123.1553844585756; Fri, 29 Mar 2019 00:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553844585; cv=none; d=google.com; s=arc-20160816; b=CQc+A4btWeGoDCkIn2dQKg/wxdq6VNNv9FmOPkiBWSW4gNn9z98m69WIDDh75RtTvf r8LcYChkVI7DiI693Uqxlfe11bv66DhWA/5tV1D2Pv1rdHFg9xer/kWZgs9PlGHkKbbL Xf1UP5hqk+uNHsFVmPj78UHD/2u0W/PTmM1qC+5Q9Vr/a+DVmJgizVNhyYcxMUv1n9LU FDaywKsGl9tMUpU+4whoAOFFb0wQgrMUcH5oYmAzytgRuuiH2X7MOrQ+UAEMHFFyLq4i z31TN387UPOwbC90sOdmJd4eSq1mxL5FK6aG6cMM3u9Iw8OHeziAoV033uFdFgJdy6Zk 3YDA== 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=RmGJOZRYikEg8/rWOmHjDLkAFbfpLh4WopfpI+zWIDM=; b=nMN1ZIkzUX5mmkebatyZkj8b2nOCwpmBvh7APsCM8rZpUJlsFk/86Txh/Mqv3shM31 4eY88hFdPcuXhwYTsjJyYWwHjvR8ArfOqA925LehmVUeO2BvBXjkZpTwGz1nOPg07OsD 0rb4Sxgi7Sp0hGVqNZMoHdNoXJf9tHnhAVfSXag5JKoqW/Bzrh0CtfrG4rruVDhT8GU/ 5bsvCVlsjCjITpK9B+e+txWkopj608HFckPjnCb2meSNU06qfNdbC3G69jzZZOQiJaGT zcmhb/yKhlaMNZ78z3JCqx2m0BnCtiako+8dr5/qUWXxqlj6NtrmtiTzQWwh+t641X4q UD1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=W2cDxNvn; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=iX81zQJy; 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 c7si1249791plo.274.2019.03.29.00.29.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 00:29:45 -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=W2cDxNvn; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=iX81zQJy; 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=RmGJOZRYikEg8/rWOmHjDLkAFbfpLh4WopfpI+zWIDM=; b=W2cDxNvneaeyZBfDpTjskJ0G4C MpWqVG/b9r+U6Sxm/xG+9D14CjGQBgdWEKJamSkrIY826Cy/icFphmoNLsqau8fvpkr9MQbGehEmy vqjjwQzILaxJ6ktbLWqBkzDuoOirj/IkNYYzJG75O53asM41A5A3U8YDqdx0Kl7nLBwTJWSplYS4q c4NDHGuSD+kMV1Czhoh+end8Qc0sf0TGmyifK4uNFC2Y6JZoCPobX+D/sDH/hnlKCsAhT93HKOlhS nq5R04CGobDStEg1awmLp4W1OA/WJJvg39+QZ/92jSDVenkDWvlc6D4gNP9K+OAXqypSX84LNohIV UJQ4oE4A==; 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 1h9lxE-0005LP-9U; Fri, 29 Mar 2019 07:29:32 +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-0004Px-3S 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 x2T7SQaC002537; Fri, 29 Mar 2019 16:28:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x2T7SQaC002537 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553844511; bh=ObWYNlhTH6M+J2I7k37z3SSdQ0S63F11O7FJsYOO3Ok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iX81zQJykAQ4FVxCiaZbPvv6Al5soNjXDGpYRP0OamciYacsMCYJCjDr0TiC2jWpP MLANEOblmfifleb7xPNEeagNdf9P861v+BoVYNQ2qpwgdrUBh4XSMy4AN1EtT42aNS 6ufx547UocSQQyqLiTVT20bLJ6G/Ljb7SxOMve8SVCuXLL1uZ0jEAfFPXCEBgwuQqK E0SOt6ggijEPfmqxVqR5Ho9XkHdSpcdPiiS5o8/KRl4m3m2ekXEFtUlWAAXZWZzT+M iZrrcz9spnGRR28JuUI5x5IrPg3UwH4ggZHUngPgk7LlytvYqEb7z5WqerZ29hzq97 zf+Ny0zU+8mog== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH v4 5/9] mtd: rawnand: denali: use bool type instead of int where appropriate Date: Fri, 29 Mar 2019 16:28:17 +0900 Message-Id: <1553844501-7119-6-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_444592_56E63D2D X-CRM114-Status: GOOD ( 14.16 ) 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 Use 'bool' type for the following boolean parameters. - write (write or read?) - dma_avail (DMA engine available or not?) Signed-off-by: Masahiro Yamada --- Changes in v4: None Changes in v3: None Changes in v2: - Use bool for dma_avail as well drivers/mtd/nand/raw/denali.c | 23 ++++++++++++----------- drivers/mtd/nand/raw/denali.h | 4 ++-- 2 files changed, 14 insertions(+), 13 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 eaf4a36..7c106c1 100644 --- a/drivers/mtd/nand/raw/denali.c +++ b/drivers/mtd/nand/raw/denali.c @@ -533,7 +533,7 @@ static int denali_sw_ecc_fixup(struct nand_chip *chip, } static void denali_setup_dma64(struct denali_nand_info *denali, - dma_addr_t dma_addr, int page, int write) + dma_addr_t dma_addr, int page, bool write) { uint32_t mode; const int page_count = 1; @@ -547,7 +547,8 @@ static void denali_setup_dma64(struct denali_nand_info *denali, * burst len = 64 bytes, the number of pages */ denali->host_write(denali, mode, - 0x01002000 | (64 << 16) | (write << 8) | page_count); + 0x01002000 | (64 << 16) | + (write ? BIT(8) : 0) | page_count); /* 2. set memory low address */ denali->host_write(denali, mode, lower_32_bits(dma_addr)); @@ -557,7 +558,7 @@ static void denali_setup_dma64(struct denali_nand_info *denali, } static void denali_setup_dma32(struct denali_nand_info *denali, - dma_addr_t dma_addr, int page, int write) + dma_addr_t dma_addr, int page, bool write) { uint32_t mode; const int page_count = 1; @@ -568,7 +569,7 @@ static void denali_setup_dma32(struct denali_nand_info *denali, /* 1. setup transfer type and # of pages */ denali->host_write(denali, mode | page, - 0x2000 | (write << 8) | page_count); + 0x2000 | (write ? BIT(8) : 0) | page_count); /* 2. set memory high address bits 23:8 */ denali->host_write(denali, mode | ((dma_addr >> 16) << 8), 0x2200); @@ -628,7 +629,7 @@ static int denali_pio_write(struct denali_nand_info *denali, const u32 *buf, } static int denali_pio_xfer(struct denali_nand_info *denali, void *buf, - size_t size, int page, int write) + size_t size, int page, bool write) { if (write) return denali_pio_write(denali, buf, size, page); @@ -637,7 +638,7 @@ static int denali_pio_xfer(struct denali_nand_info *denali, void *buf, } static int denali_dma_xfer(struct denali_nand_info *denali, void *buf, - size_t size, int page, int write) + size_t size, int page, bool write) { dma_addr_t dma_addr; uint32_t irq_mask, irq_status, ecc_err_mask; @@ -694,7 +695,7 @@ static int denali_dma_xfer(struct denali_nand_info *denali, void *buf, } static int denali_page_xfer(struct nand_chip *chip, void *buf, size_t size, - int page, int write) + int page, bool write) { struct denali_nand_info *denali = to_denali(chip); @@ -715,7 +716,7 @@ static int denali_read_page(struct nand_chip *chip, uint8_t *buf, int stat = 0; int ret; - ret = denali_page_xfer(chip, buf, mtd->writesize, page, 0); + ret = denali_page_xfer(chip, buf, mtd->writesize, page, false); if (ret && ret != -EBADMSG) return ret; @@ -744,7 +745,7 @@ static int denali_write_page(struct nand_chip *chip, const uint8_t *buf, { struct mtd_info *mtd = nand_to_mtd(chip); - return denali_page_xfer(chip, (void *)buf, mtd->writesize, page, 1); + return denali_page_xfer(chip, (void *)buf, mtd->writesize, page, true); } static int denali_setup_data_interface(struct nand_chip *chip, int chipnr, @@ -1001,7 +1002,7 @@ static int denali_attach_chip(struct nand_chip *chip) int ret; if (ioread32(denali->reg + FEATURES) & FEATURES__DMA) - denali->dma_avail = 1; + denali->dma_avail = true; if (denali->dma_avail) { int dma_bit = denali->caps & DENALI_CAP_DMA_64BIT ? 64 : 32; @@ -1010,7 +1011,7 @@ static int denali_attach_chip(struct nand_chip *chip) if (ret) { dev_info(denali->dev, "Failed to set DMA mask. Disabling DMA.\n"); - denali->dma_avail = 0; + denali->dma_avail = false; } } diff --git a/drivers/mtd/nand/raw/denali.h b/drivers/mtd/nand/raw/denali.h index 4447184..d2603c6 100644 --- a/drivers/mtd/nand/raw/denali.h +++ b/drivers/mtd/nand/raw/denali.h @@ -303,7 +303,7 @@ struct denali_nand_info { u32 irq_mask; /* interrupts we are waiting for */ u32 irq_status; /* interrupts that have happened */ int irq; - int dma_avail; /* can support DMA? */ + bool dma_avail; /* can support DMA? */ int devs_per_cs; /* devices connected in parallel */ int oob_skip_bytes; /* number of bytes reserved for BBM */ int max_banks; @@ -313,7 +313,7 @@ struct denali_nand_info { u32 (*host_read)(struct denali_nand_info *denali, u32 addr); void (*host_write)(struct denali_nand_info *denali, u32 addr, u32 data); void (*setup_dma)(struct denali_nand_info *denali, dma_addr_t dma_addr, - int page, int write); + int page, bool write); }; #define DENALI_CAP_HW_ECC_FIXUP BIT(0) From patchwork Fri Mar 29 07:28:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 161398 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1696556jan; Fri, 29 Mar 2019 00:29:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuAqq23Y9iMEGv74dom1SXnxf2e3qOtA5gbMfZgtAIIy8WfwZUJ3fXxlYtUpr//WnZObsH X-Received: by 2002:aa7:8a87:: with SMTP id a7mr46998478pfc.252.1553844561447; Fri, 29 Mar 2019 00:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553844561; cv=none; d=google.com; s=arc-20160816; b=cQdx0py9tL+lFFhimBG0nGCwqNaCJBYi2pSxsbBMm3eWdu8XpcTbizo6KwMJ1qQO2X rh0HlZfNZpd4AOqD4ZEp+JHXIS5kfCoBImNFeKltetNlcf6g7cYl3qSEDACHp3kCEGc6 VVUrKiVslJTfx97TpOznklKnAPC3DdPFciEisuECVzKynW5K0ou+iATgsTul3N80SoBh FRnIJby7KSVPZO+A5gTrw/OvfaIdnc9LyBZInKYkqX3xpUVAUbJBTv2GR4goe1KGxAl8 0DnsfZtYOVLhngP+TkOk7NCQmi8XnRMt2Wg42CVcj4IWs7d3HH0yqOzq/fVFtu+tsoEj /L5Q== 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=BNakdtxPN5x2PHU7C3oYi0hw42xsLoQpurppNH1Z0oc=; b=n+DqGaTjs/1wJa8iZtqbNYn9ILH65VrM4ZIKfSnFTA6GSir+RPfUJMI4be+4rHDfSH xykhb6N8Z270v3RA98uH9zZZYz0+7z1w8DxY6PYYcGYnWvYjHZ/pGxGgvcVr16c1ZcPq cgAFgCc6eXUwEK8XH2E+5UmGL538eauAraNOF0tDEHbt/imfUGhokcPXfpWJmT8+TNMR vnZ92Sp/3scb7vSc4ce6xciqz4+F/zqn/fpP8Pajmz4KEuBH98Q7QLE+j5A1+byKYYZt VzYSpXU13f4GsvpEHkdRt8YAxNSxVnZVdEAIxpm3hhN/1FQhT7FVmbWNIXIwSHUnXtez x0iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=tFldy1l0; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=x0unXnVM; 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 h66si1299583pgc.537.2019.03.29.00.29.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 00:29:21 -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=tFldy1l0; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=x0unXnVM; 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=BNakdtxPN5x2PHU7C3oYi0hw42xsLoQpurppNH1Z0oc=; b=tFldy1l0begDLVmyygMxrsvlmv m1438Nj8mBKjVZIcd5ONExYQodUzDUfi7hDFkQKpjDk9JN1NNddiVC0GRJoCkRb7j33db8g5SmrZL hJxR1MaKQy7bKY1I7ErqWBerWYB3BZ5oVY7WVaj3XoVvYuADfRzItUZruMhw+xaUw5KeGyepfpKvK dryDXQ1OQi1e/xRsAKz3ughhmEAKl/nG4rWqxtjSk8pIu67063KilJh66U6sL3RBDI7Jicx4PAKl+ dQ99OPq3s8m9a/R/ltVF3JK42XOurDgnecyvsYT4DcUMLB4yEqk2F6BazlamBTZtzc3S+g+JrFxzt D2uJyqXA==; 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 1h9lwt-0004uA-6Y; Fri, 29 Mar 2019 07:29:11 +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-0004Q0-3O 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 x2T7SQaD002537; Fri, 29 Mar 2019 16:28:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x2T7SQaD002537 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553844513; bh=BRBvSJ4W65C/fPjveY5umdo5eBXm18HEgOWm+EkOD7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x0unXnVMr9Cy58s7P8cByEoY3byAv10ixm490Y5dvO8ih/ozmRirL2QF/oTQKM5Ms yiCyTKLBwt/RgaUPrYJbyogiPfd8lmHNEkRwN7CvJydf6hyNFRBgT7jcY7K6Nc7kQk 47wf+GJvPnqrJrqM8wlxKtC+Q18rZOkRgsUevqS3TOr2o6ydUcPzNlEv8qvKwsbrYK 7KlR9PKmn4i5NDFz9YzMD6blb6XuXAgqRIOe+CVrsuSYGQOu0c0IQ9+e0Qr9/i/uYj QNEFIucpBCTBPaQqkVV3IGI3z5kBGebdzMowmlensaxkH6+bt12ewPUz2onM+Pa/gy mO+RBY/fgEPoA== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH v4 6/9] mtd: rawnand: denali_pci: rename goto labels Date: Fri, 29 Mar 2019 16:28:18 +0900 Message-Id: <1553844501-7119-7-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_460931_06115016 X-CRM114-Status: GOOD ( 10.73 ) 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 As Documentation/process/coding-style.rst says, choose label names which say what the goto does. The out_ label style is already used in denali_dt.c. Rename likewise for denali_pci.c Signed-off-by: Masahiro Yamada --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/mtd/nand/raw/denali_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 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_pci.c b/drivers/mtd/nand/raw/denali_pci.c index 48e9ac5..02eb599 100644 --- a/drivers/mtd/nand/raw/denali_pci.c +++ b/drivers/mtd/nand/raw/denali_pci.c @@ -84,20 +84,20 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) if (!denali->host) { dev_err(&dev->dev, "Spectra: ioremap_nocache failed!"); ret = -ENOMEM; - goto failed_remap_reg; + goto out_unmap_reg; } ret = denali_init(denali); if (ret) - goto failed_remap_mem; + goto out_unmap_host; pci_set_drvdata(dev, denali); return 0; -failed_remap_mem: +out_unmap_host: iounmap(denali->host); -failed_remap_reg: +out_unmap_reg: iounmap(denali->reg); return ret; } From patchwork Fri Mar 29 07:28:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 161396 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1696369jan; Fri, 29 Mar 2019 00:29:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzu5+tdfWQCmJU+lxIoZVXq75FEOQUoF/zZ/Bv7koQpArQ4Li21j8kQ7H+tYAnRwWffaLEV X-Received: by 2002:aa7:9211:: with SMTP id 17mr45342953pfo.220.1553844545522; Fri, 29 Mar 2019 00:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553844545; cv=none; d=google.com; s=arc-20160816; b=m3fLUXo2Xg0riAZtbRHsHlbGIr79M34gZnZPw8oW3JHo2F5OrCVwdpsQeKY86Ktm+X rT0vPH+k5vkIMulMigwyo0XQcExNkAsGC4XoJBZNoT0XWLRfVLuCKtpeC7OB0UrXie9i jYyDbDRxOeBmf9OG2dGpWp8pim85SatkYkRnxpfBkrVEWoA3d5lnMPpZ6xfJP7fV0WxM mrYVEKNMMEasIxEcDneKRbxED8WfXgGSe+TIRd5OZ3hGEZ1z+hOJbW4kanSzjXnKH4Cp Hasum4K7jXYQvb561cBxDZRjuuhmZ+PAm6qWN+z0wlUp0jmJDXlydnoSEMaJSol+mtzR k7yw== 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=Rba8lziz4wyTHCRmPohWBX9w7VMq9yjc8vChPYioEqg=; b=jV/aa3sb3gJ+K3a1Xmre6sBtt0OsZzlntALBj6Uae87DR6itUizfEDY5Im76X7pS8T zndDCc6KWAUw7wnrlJ0KFhi4bfBBGMZ72TNu+ZkPlIMZ0C8hj24TArZcDCipkUEjypJD 04EdP+/poXlIBy0cP2xc9M20iZ3Yu8YKMPxbKi4zvBIKy9FZ6e/O5bTlYTFIlZKkWz2r XpcUoYTcPzEQc+cprEAOrhRRNKNzAUi0AnCe+Sji/2wR1sOvxfeMIhKQrztP2J+lpiyA V7FJGyvZbX+29sKh+0DjhynTnvAQNtNTe1y1507ZhWNF2XduJLi7iq68JDJvCJ4tZbj1 XVeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=quKsbt+F; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=th8r1i2+; 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 q6si1214738pgv.344.2019.03.29.00.29.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 00:29:05 -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=quKsbt+F; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=th8r1i2+; 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=Rba8lziz4wyTHCRmPohWBX9w7VMq9yjc8vChPYioEqg=; b=quKsbt+FddIoSeWi6Q5HoLbmnE kOFHbEM3gM4SU4RABSq8DEm3N+1zpjatZ3IGWnFIR2kx7QZ0D9Oxr3Yh+z5/1pujvhVy5OFGa8cPS CQDEjzoT7gbg6g8UVhxMuxPf8wlK2QOMqVb0jIW4uITtX2cz6rolRZEgXL0GeolxZIyVsVtGMGnBf NLdOm+ofD4A0RlP4D3QufcDnRbH+T7029W5EyVZlTWYHk8Xv2ETw5mfBRS55Za1OpzclygIe3ocFC 6E7xK5MKLOYU2WCdPQu/gMYNVmQLEdLhMxJVk4bThhspm+Lnk30KDbZ0kQHAPhRPHXW0SdgM9aWfV RvZEDbpQ==; 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 1h9lwb-0004SG-If; Fri, 29 Mar 2019 07:28:53 +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-0004Q3-3Q for linux-mtd@lists.infradead.org; Fri, 29 Mar 2019 07:28:51 +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 x2T7SQaF002537; Fri, 29 Mar 2019 16:28:35 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x2T7SQaF002537 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553844516; bh=P6nAEpSTptxVwF6npdz1nlZ/dvqEunlZJ0obGeCKvZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=th8r1i2+a2zln0j9kTQYqaeuf4y0Z1EB5HdND9w8CxVyYXnX/MRnjLuukzhQhyVaJ Tywo013QZOiJjFaokK7B8U/dFcWE0TqO90yJmcw1qSTsYRtK4MWcPGratgKJL5Cc5T sO6cxmLNWL5vXTPKsE+mnXGiy63XHtv7HWwmo2HPY1xGwLcFt7BFg1Lr9TO7TDz/fR Th9PEMpzum3noSK2q3A/zIcYfb01138vdRNJ46zMl2YPzzyI62iP8U4lihkOp9RO+n g76iALn9B8ReI1QbCw8jey5BlW/h6v7Wt6hXwZADS02grSJ4bVrX4UJd0GeccDWgHt 1chK/wGUKn6kQ== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH v4 8/9] mtd: rawnand: denali: remove DENALI_NR_BANKS macro Date: Fri, 29 Mar 2019 16:28:20 +0900 Message-Id: <1553844501-7119-9-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_449255_81FCD24F X-CRM114-Status: GOOD ( 10.22 ) 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 Use the runtime-detected denali->nbanks instead of hard-coded DENALI_NR_BANKS (=4). The actual number of banks depends on the IP configuration, and can be less than DENALI_NR_BANKS. It is pointless to touch registers of unsupported banks. Signed-off-by: Masahiro Yamada --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/mtd/nand/raw/denali.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 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 687feab..6d0ee5e 100644 --- a/drivers/mtd/nand/raw/denali.c +++ b/drivers/mtd/nand/raw/denali.c @@ -40,7 +40,6 @@ #define DENALI_BANK(denali) ((denali)->active_bank << 24) #define DENALI_INVALID_BANK -1 -#define DENALI_NR_BANKS 4 static struct denali_chip *to_denali_chip(struct nand_chip *chip) { @@ -92,7 +91,7 @@ static void denali_enable_irq(struct denali_controller *denali) { int i; - for (i = 0; i < DENALI_NR_BANKS; i++) + for (i = 0; i < denali->nbanks; i++) iowrite32(U32_MAX, denali->reg + INTR_EN(i)); iowrite32(GLOBAL_INT_EN_FLAG, denali->reg + GLOBAL_INT_ENABLE); } @@ -101,7 +100,7 @@ static void denali_disable_irq(struct denali_controller *denali) { int i; - for (i = 0; i < DENALI_NR_BANKS; i++) + for (i = 0; i < denali->nbanks; i++) iowrite32(0, denali->reg + INTR_EN(i)); iowrite32(0, denali->reg + GLOBAL_INT_ENABLE); } @@ -117,7 +116,7 @@ static void denali_clear_irq_all(struct denali_controller *denali) { int i; - for (i = 0; i < DENALI_NR_BANKS; i++) + for (i = 0; i < denali->nbanks; i++) denali_clear_irq(denali, i, U32_MAX); } @@ -130,7 +129,7 @@ static irqreturn_t denali_isr(int irq, void *dev_id) spin_lock(&denali->irq_lock); - for (i = 0; i < DENALI_NR_BANKS; i++) { + for (i = 0; i < denali->nbanks; i++) { irq_status = ioread32(denali->reg + INTR_STATUS(i)); if (irq_status) ret = IRQ_HANDLED; From patchwork Fri Mar 29 07:28:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 161404 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1697114jan; Fri, 29 Mar 2019 00:30:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHk1ecJ9h3iOngdGB0+u/EfM1eSw100Y9qRfGa6keYoSMFx989Ad9MVqpGSh9akTY2K84B X-Received: by 2002:a17:902:7481:: with SMTP id h1mr6545666pll.206.1553844605080; Fri, 29 Mar 2019 00:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553844605; cv=none; d=google.com; s=arc-20160816; b=bEQm3CJwUTbf3P9mDbyV7XRRUii01mFrIa2tpIDD5OjNIKfdTODi/ptUP6jMAe1qx6 l2e876/4UC+NtXZBLuR1wK+cpLciH47Dv9YK4Oe355QcguzfHeqkobTZ9h+DPMfcMOyE 2c0akxCZUDSXLxVCjvvmqKm3OLcHzxgpQaqwp5YkdUXOWsVKD9cvGAgqBYrbAXSNWgVZ B39Il+4d/n11azAvM1XwjT/C0/Z9ZrLdq91MtPHmqnIkcaog3cPCXJx3Qy9+SdPPQXPj uw5t+37OX5iKBPMVjlvkRUcbnCKjPD34eNWdXzC1k40paOTjFZWPn8tTf5IHP0BtfqQV PJuA== 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=uxNU+bq9Lr4A5D3I15u3aGEKaoi26JN4a64KxDW/uQc=; b=T6lWM1kPftfYnp0P+DzmCMaojddnZ03dy0k2wD4fR4jDHqCKbRriXd29dYrdNfZ7aL dsvnxLsM2a+ImHwtNkKOkz32Y4g2fjyLb3QK/uLXfMllcW1sqL5kdMq5jL8dN39WrkJy ztNLf0Ew+RsPFY+HMtZqRomw4CLAzaDuH0mgxySJJiO+Ce74LIwA4VQ19YHtfZ/6g2Jr YOZqSa2fgzh/8esorw1Ckl23l/zoQocBEUK5AoVCjrMDPahP941yQL486l+jb+88sdZg niLYmjMcXXPups5Z97dX0V9iIvpgh+oWMiYbhPd2oO4sI/ph7x+muN2wVOmjBP3VphyM nQ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="e4V436U/"; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=wj4c4C9J; 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 s9si1256665plr.319.2019.03.29.00.30.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 00:30:05 -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="e4V436U/"; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=wj4c4C9J; 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=uxNU+bq9Lr4A5D3I15u3aGEKaoi26JN4a64KxDW/uQc=; b=e4V436U/c9gVVcUSxC3gOHIr6i TEISB07WUOpXjZCL0275ykW4bEcT2QeVeGepElWXUGjgfH2qz7eL0x10Qlqz55iv5slukizvjhjiJ FXbt4IQJNGBQYseBTGqLvK/GBvrS67OyekfUkYT+ikRkwZ7Epo9fZohiPo7aEn6j2WCpCSsbUzjAK V1DbcmMpBVf5WR0k+dpG3K+3XIdzmzg7fLjRKN5YyWQyqF6kC5TljnIztQw8H9aCp09tVFz0M04Lq umTEp8PcoeArRmSdSKeCotteNhJi7ejshS5gHIjPt7wLJNbgP0cZjFhaoco1IQQ6a3WGhGjUYA5HF BakNwX8Q==; 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 1h9lxa-0005or-LD; Fri, 29 Mar 2019 07:29:54 +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-0004Pz-3U for linux-mtd@lists.infradead.org; Fri, 29 Mar 2019 07:28:54 +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 x2T7SQaG002537; Fri, 29 Mar 2019 16:28:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x2T7SQaG002537 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553844517; bh=LxmFXmOZ+IYS1jfeDT1SQreLqh9TurbdVbRxs0TdcuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wj4c4C9JloAn44CeX9SClupIP/aIkcQW8vk9GZDv0H3kaS4onR0VvFDAKHZu9Sk+N xkap+TZr0n8CLR80zNJiAq3R4uSJAnPPiH090ozN8GxgOoIUHXH2JfMSGXWtvX+q6P DqGWngsn8/T82svufPel2G11nJKkw/RegTa9fkH+9SbMbLmzqD1SjX8DrN4ebf6RF9 XYVJHuY5OcXMgz0hDh2XaG87VSuzuqtisP5+YfQBASmFn8GXplkWQIbnuYh28H8E/B W3O69xvhLBuf+V27FMY6WzTXHbF4tr0z/2bnaiFpGz6AWDhl+ZpjbnzS3WEgbsHQNN i2b0NnbrN21Lg== X-Nifty-SrcIP: [218.220.227.105] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Miquel Raynal Subject: [PATCH v4 9/9] mtd: rawnand: denali: clean up coding style Date: Fri, 29 Mar 2019 16:28:21 +0900 Message-Id: <1553844501-7119-10-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_460934_B547CDD8 X-CRM114-Status: GOOD ( 13.31 ) 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 Eliminate the following reports from 'scripts/checkpatch.pl --strict'. CHECK: Prefer kernel type 'u8' over 'uint8_t' CHECK: Prefer kernel type 'u32' over 'uint32_t' CHECK: Alignment should match open parenthesis I slightly changed denali_check_erased_page() to shorten it. Signed-off-by: Masahiro Yamada --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/mtd/nand/raw/denali.c | 54 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 28 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 6d0ee5e..9abc0ea 100644 --- a/drivers/mtd/nand/raw/denali.c +++ b/drivers/mtd/nand/raw/denali.c @@ -106,7 +106,7 @@ static void denali_disable_irq(struct denali_controller *denali) } static void denali_clear_irq(struct denali_controller *denali, - int bank, uint32_t irq_status) + int bank, u32 irq_status) { /* write one to clear bits */ iowrite32(irq_status, denali->reg + INTR_STATUS(bank)); @@ -124,7 +124,7 @@ static irqreturn_t denali_isr(int irq, void *dev_id) { struct denali_controller *denali = dev_id; irqreturn_t ret = IRQ_NONE; - uint32_t irq_status; + u32 irq_status; int i; spin_lock(&denali->irq_lock); @@ -163,7 +163,7 @@ static void denali_reset_irq(struct denali_controller *denali) static u32 denali_wait_for_irq(struct denali_controller *denali, u32 irq_mask) { unsigned long time_left, flags; - uint32_t irq_status; + u32 irq_status; spin_lock_irqsave(&denali->irq_lock, flags); @@ -411,20 +411,17 @@ static int denali_check_erased_page(struct nand_chip *chip, unsigned int max_bitflips) { struct mtd_ecc_stats *ecc_stats = &nand_to_mtd(chip)->ecc_stats; - uint8_t *ecc_code = chip->oob_poi + denali->oob_skip_bytes; - int ecc_steps = chip->ecc.steps; - int ecc_size = chip->ecc.size; - int ecc_bytes = chip->ecc.bytes; + struct nand_ecc_ctrl *ecc = &chip->ecc; + u8 *ecc_code = chip->oob_poi + denali->oob_skip_bytes; int i, stat; - for (i = 0; i < ecc_steps; i++) { + for (i = 0; i < ecc->steps; i++) { if (!(uncor_ecc_flags & BIT(i))) continue; - stat = nand_check_erased_ecc_chunk(buf, ecc_size, - ecc_code, ecc_bytes, - NULL, 0, - chip->ecc.strength); + stat = nand_check_erased_ecc_chunk(buf, ecc->size, ecc_code, + ecc->bytes, NULL, 0, + ecc->strength); if (stat < 0) { ecc_stats->failed++; } else { @@ -432,8 +429,8 @@ static int denali_check_erased_page(struct nand_chip *chip, max_bitflips = max_t(unsigned int, max_bitflips, stat); } - buf += ecc_size; - ecc_code += ecc_bytes; + buf += ecc->size; + ecc_code += ecc->bytes; } return max_bitflips; @@ -445,7 +442,7 @@ static int denali_hw_ecc_fixup(struct nand_chip *chip, { struct mtd_ecc_stats *ecc_stats = &nand_to_mtd(chip)->ecc_stats; int bank = denali->active_bank; - uint32_t ecc_cor; + u32 ecc_cor; unsigned int max_bitflips; ecc_cor = ioread32(denali->reg + ECC_COR_INFO(bank)); @@ -476,17 +473,17 @@ static int denali_hw_ecc_fixup(struct nand_chip *chip, static int denali_sw_ecc_fixup(struct nand_chip *chip, struct denali_controller *denali, - unsigned long *uncor_ecc_flags, uint8_t *buf) + unsigned long *uncor_ecc_flags, u8 *buf) { struct mtd_ecc_stats *ecc_stats = &nand_to_mtd(chip)->ecc_stats; unsigned int ecc_size = chip->ecc.size; unsigned int bitflips = 0; unsigned int max_bitflips = 0; - uint32_t err_addr, err_cor_info; + u32 err_addr, err_cor_info; unsigned int err_byte, err_sector, err_device; - uint8_t err_cor_value; + u8 err_cor_value; unsigned int prev_sector = 0; - uint32_t irq_status; + u32 irq_status; denali_reset_irq(denali); @@ -551,7 +548,7 @@ static int denali_sw_ecc_fixup(struct nand_chip *chip, static void denali_setup_dma64(struct denali_controller *denali, dma_addr_t dma_addr, int page, bool write) { - uint32_t mode; + u32 mode; const int page_count = 1; mode = DENALI_MAP10 | DENALI_BANK(denali) | page; @@ -576,7 +573,7 @@ static void denali_setup_dma64(struct denali_controller *denali, static void denali_setup_dma32(struct denali_controller *denali, dma_addr_t dma_addr, int page, bool write) { - uint32_t mode; + u32 mode; const int page_count = 1; mode = DENALI_MAP10 | DENALI_BANK(denali); @@ -601,7 +598,7 @@ static int denali_pio_read(struct denali_controller *denali, u32 *buf, size_t size, int page) { u32 addr = DENALI_MAP01 | DENALI_BANK(denali) | page; - uint32_t irq_status, ecc_err_mask; + u32 irq_status, ecc_err_mask; int i; if (denali->caps & DENALI_CAP_HW_ECC_FIXUP) @@ -628,7 +625,7 @@ static int denali_pio_write(struct denali_controller *denali, const u32 *buf, size_t size, int page) { u32 addr = DENALI_MAP01 | DENALI_BANK(denali) | page; - uint32_t irq_status; + u32 irq_status; int i; denali_reset_irq(denali); @@ -637,7 +634,8 @@ static int denali_pio_write(struct denali_controller *denali, const u32 *buf, denali->host_write(denali, addr, buf[i]); irq_status = denali_wait_for_irq(denali, - INTR__PROGRAM_COMP | INTR__PROGRAM_FAIL); + INTR__PROGRAM_COMP | + INTR__PROGRAM_FAIL); if (!(irq_status & INTR__PROGRAM_COMP)) return -EIO; @@ -657,7 +655,7 @@ static int denali_dma_xfer(struct denali_controller *denali, void *buf, size_t size, int page, bool write) { dma_addr_t dma_addr; - uint32_t irq_mask, irq_status, ecc_err_mask; + u32 irq_mask, irq_status, ecc_err_mask; enum dma_data_direction dir = write ? DMA_TO_DEVICE : DMA_FROM_DEVICE; int ret = 0; @@ -723,7 +721,7 @@ static int denali_page_xfer(struct nand_chip *chip, void *buf, size_t size, return denali_pio_xfer(denali, buf, size, page, write); } -static int denali_read_page(struct nand_chip *chip, uint8_t *buf, +static int denali_read_page(struct nand_chip *chip, u8 *buf, int oob_required, int page) { struct denali_controller *denali = to_denali_controller(chip); @@ -756,7 +754,7 @@ static int denali_read_page(struct nand_chip *chip, uint8_t *buf, return stat; } -static int denali_write_page(struct nand_chip *chip, const uint8_t *buf, +static int denali_write_page(struct nand_chip *chip, const u8 *buf, int oob_required, int page) { struct mtd_info *mtd = nand_to_mtd(chip); @@ -774,7 +772,7 @@ static int denali_setup_data_interface(struct nand_chip *chip, int chipnr, int acc_clks, re_2_we, re_2_re, we_2_re, addr_2_data; int rdwr_en_lo, rdwr_en_hi, rdwr_en_lo_hi, cs_setup; int addr_2_data_mask; - uint32_t tmp; + u32 tmp; timings = nand_get_sdr_timings(conf); if (IS_ERR(timings))