From patchwork Tue Jan 22 07:42:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 156285 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp7267500jaa; Mon, 21 Jan 2019 23:43:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN6VKbdxZjMYi9fK2RQHnru87Lq8rGDq0AnbSTkH0WQxICIA7677JhoFvZkDd7VgBwKK+OZS X-Received: by 2002:a63:8043:: with SMTP id j64mr31605065pgd.405.1548143027761; Mon, 21 Jan 2019 23:43:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548143027; cv=none; d=google.com; s=arc-20160816; b=wIVxwGKZvN0xheet55zogqiPDBOQOtd6RT5F5R0BKPHjrQU3MrcQP6WbqdLF+bwKCo eR9z5VLksk+t+NBbf7nl7pXoTzt6YbWjvZpodpkhVC/rI0qQvEq3duCgKKAPp3l7pLke pryPmMYThRkZUeBwOGzH0XOFTPOP9NFEgaIC4W7Tu0jsu7DrrcBGQO6bfYSM+RMZjsNY xRwOOKRPQNLmFGnD95tD9iFBCP+VRLi/XOHXE5Vin7D/R3a3FoEnN2q4xOCb3dLwvFLS QUQ7nZcluNl/OtkdCLDzpD3k3fmF/0X18z9ulCyrFbGhBTIAkL2I4/BeP9WjMXEhmtGs wFRg== 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=mXAVPis0oInBbz5Q7xg956XnY2jW2iGT6j87QkhKRaw=; b=oiwwLo9afO7KBSs72R02lQGwYNzPgq6Fwb9PvZETUK4mdLJeUQJw+Z5FyeP+SHcqhV 6uj3Bwj4mLDzvOcbWZOIvtF1ekneG2KpmljoanBMWaKbYIaTsQ/0TPGaV5dnh/ajuj66 O6ZcFRacoMHKmx0N3V1UalYvYxHVsBGYO3jRCDo0aboPAJEix/KLEvN8XZ8q9UMJjbR6 6yq6RDSYPjD4mf6q7GC9KOGHvqbry0Wcf8/ULfM2dBbzQfKuwiooOXme/4vl0P9mqgr4 ayaq40/ov+ZKYjXGmd/S+665RaC28aXw8+++boc69/uun6l6KVy3ew2MfAYMeGaw65F6 uVTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b="OKZN/J8/"; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=y5SmZsIS; 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 h8si14383672plr.343.2019.01.21.23.43.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 23:43:47 -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="OKZN/J8/"; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=y5SmZsIS; 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=mXAVPis0oInBbz5Q7xg956XnY2jW2iGT6j87QkhKRaw=; b=OKZN/J8/kZw/gpCxoxDx9dhw29 d285a8IZswD2T7WzfSoXzPpcsH7UaV309Vq8a3K+QQklpZfXMPWcK2GbO2dYvRRwlVNjr61/IRuPH JKkoUby0D3MEE7xVhWMl8rhALHctmDtnXEHJJ0YHnaF37IVrxOuE3xI+STi2E2V0CyQhnhGl36DpD 92UZBI6rtvyD/ai24q+5S0zTglpjcdN9qUpouiMCjfF4spV9kWpKsXhvr5rGZ2QuYjkEIbdWRrNY+ T+PUYbB69cZZv1Qh3YOunUXBpyjVIKcHnzpM3FKhDagu5K16Q1I5l/TfZfa2Whnn63o9eqhHSf9wg fUtAcm5A==; 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 1glqia-00014R-La; Tue, 22 Jan 2019 07:43:32 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1glqiX-00013w-Io for linux-mtd@lists.infradead.org; Tue, 22 Jan 2019 07:43:31 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x0M7h55W025355; Tue, 22 Jan 2019 16:43:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x0M7h55W025355 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1548142988; bh=hSF0u/EvB47CoB40nefIbVyNFXS6grvYzPOkYHR2Q+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y5SmZsISzZLplMiSomjH9Yjc2eOX/fPfxjdr1RHgDWnCSgeR/iGTM0Q5hIWq79/Zr yyYY688gcSbKs16em+zc8mMhTSX4U8gY1vgHDqOdGP80S0n5iFNteoOhiMr24ks6Ca NXrfVdo5yZM7un63VqukLWhq+GNKUSTXd2k4CFDlaIKoenI6ZG+5hNC9ZiAQNVrtgW 7v3bvb52wzFWiMOXISOwheYHZo63gOqtYM3Quy2AtBppNyLLeg65mE/qJT6Ul4u6tn OjasLIE9PR0+B/WFS33c5DmhqeG+xRnjEJfJLdw2m7DbV0pCd4P6eW8puYJyeAsXMi KLIrAa7JN6Y5Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon , Miquel Raynal Subject: [PATCH 2/2] mtd: rawnand: use unnamed union in struct nand_op_parser_pattern_elem Date: Tue, 22 Jan 2019 16:42:55 +0900 Message-Id: <1548142975-14219-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548142975-14219-1-git-send-email-yamada.masahiro@socionext.com> References: <1548142975-14219-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190121_234329_975014_6A89A975 X-CRM114-Status: GOOD ( 11.24 ) 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.79 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 Although drivers do not directly get access to the private data of instruction patterns, let's use unnamed union field to be consistent with nand_op_instr. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/raw/nand_base.c | 12 ++++++------ include/linux/mtd/rawnand.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 3b620cd..d29de69 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -1995,24 +1995,24 @@ nand_op_parser_must_split_instr(const struct nand_op_parser_pattern_elem *pat, { switch (pat->type) { case NAND_OP_ADDR_INSTR: - if (!pat->ctx.addr.maxcycles) + if (!pat->addr.maxcycles) break; if (instr->addr.naddrs - *start_offset > - pat->ctx.addr.maxcycles) { - *start_offset += pat->ctx.addr.maxcycles; + pat->addr.maxcycles) { + *start_offset += pat->addr.maxcycles; return true; } break; case NAND_OP_DATA_IN_INSTR: case NAND_OP_DATA_OUT_INSTR: - if (!pat->ctx.data.maxlen) + if (!pat->data.maxlen) break; if (instr->data.len - *start_offset > - pat->ctx.data.maxlen) { - *start_offset += pat->ctx.data.maxlen; + pat->data.maxlen) { + *start_offset += pat->data.maxlen; return true; } break; diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index b606ed3..7abb605 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -741,7 +741,7 @@ struct nand_op_parser_pattern_elem { union { struct nand_op_parser_addr_constraints addr; struct nand_op_parser_data_constraints data; - } ctx; + }; }; #define NAND_OP_PARSER_PAT_CMD_ELEM(_opt) \ @@ -754,21 +754,21 @@ struct nand_op_parser_pattern_elem { { \ .type = NAND_OP_ADDR_INSTR, \ .optional = _opt, \ - .ctx.addr.maxcycles = _maxcycles, \ + .addr.maxcycles = _maxcycles, \ } #define NAND_OP_PARSER_PAT_DATA_IN_ELEM(_opt, _maxlen) \ { \ .type = NAND_OP_DATA_IN_INSTR, \ .optional = _opt, \ - .ctx.data.maxlen = _maxlen, \ + .data.maxlen = _maxlen, \ } #define NAND_OP_PARSER_PAT_DATA_OUT_ELEM(_opt, _maxlen) \ { \ .type = NAND_OP_DATA_OUT_INSTR, \ .optional = _opt, \ - .ctx.data.maxlen = _maxlen, \ + .data.maxlen = _maxlen, \ } #define NAND_OP_PARSER_PAT_WAITRDY_ELEM(_opt) \