Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7093980imu; Mon, 21 Jan 2019 23:46:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN7DL3+aJ1LHlfvyeaNuYnVFZULwt/eqVfaLeYHVtXSO+JcQKIhL4iD6tvAjqwNOkotKgeZQ X-Received: by 2002:a63:b81a:: with SMTP id p26mr31465327pge.433.1548143166029; Mon, 21 Jan 2019 23:46:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548143166; cv=none; d=google.com; s=arc-20160816; b=L0etkmD/uDBR63jJBnAmq+EJ8JAmssbv3p0DzSQWThxbRZXvUGuk4qE1y+738KsJFb 0Fbkdt1typHBK/AqfcnWFUi46vMXjkDfu1ExZBzAKO4/tJ4loMwTaQz8GWaRc3gwra7p MQlZbX/FOSgtzWBF7TNSWl34x8dRZwmDM/FfNJEWVcHuz2Gwyxsi0O2iYFmTmhvOTfa3 8FgH5mhKrksWEthI7GvdO4DiUA2rIP+cL4MGc6Ax5vg3/q0E+t3w7SyKqePdUZ/FvidX mExi3z5dsZFpDnKQ+n8dXn6vBvtiumvcbZdbTXSrmyg2iDuJspBY6auv5NBSLjZVDYaV WR5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=hSF0u/EvB47CoB40nefIbVyNFXS6grvYzPOkYHR2Q+E=; b=PejvlcXT/88uwBMEAC2Sj13hxBgq2uI5eatVcw3EKNvsONLw+9cPKVEnGYjUOuH+OY Wqpdy7Uukk5ySOIm2DGoNFfKCF8NAgKbHSe2V8FQKI1WzxzqV8y68x0S0agPQEbGjMHD u8upHoMDrHpymJFiyLPs0dICVsTDJ8PPbSYh6xMVZRFge8Zu25KKqySbAINXCQiQHrk9 /KLKyZnbUBxnywIca/my+GAQa7XzmD8KXiDU8UNsNNDHi99jnmw7poG4sj+4X1AlCyMj jXFhw9ssw9dXkwMAywc0nEYXFn9MZHXPNNLWuHRLuk327qFg7ws7kf4tzMUdIntSFybI yhdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=y5SmZsIS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si14618193pfa.99.2019.01.21.23.45.50; Mon, 21 Jan 2019 23:46:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=y5SmZsIS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727308AbfAVHor (ORCPT + 99 others); Tue, 22 Jan 2019 02:44:47 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:61632 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbfAVHor (ORCPT ); Tue, 22 Jan 2019 02:44:47 -0500 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 Cc: Masahiro Yamada , Brian Norris , linux-kernel@vger.kernel.org, Marek Vasut , Richard Weinberger , David Woodhouse , Boris Brezillon 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) 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) \ -- 2.7.4