From patchwork Tue Jan 22 07:42:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 156286 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp7267550jaa; Mon, 21 Jan 2019 23:43:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN4YU14Hb7ce9mvasbDgZhUWOYALbcGk8Z4gt4RJYtkJj1cMpnJvmV3F45h+O86wDTiE7cLG X-Received: by 2002:a17:902:292b:: with SMTP id g40mr33505385plb.82.1548143032125; Mon, 21 Jan 2019 23:43:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548143032; cv=none; d=google.com; s=arc-20160816; b=wKL01xtR2crojPcgvO8dVuamrLGQNNzvAqGzmR2zrorP/PIGNy9N6U2cBk0mXgtoN/ Sq8ZlePfEvVoHx9Zs6c8+1fQrhKwVa+2cVqVhHGHRXSagAG2iz1gjS+LtDLBYW+fnYzo fFNpoeZ3RG/WVClh+SWOL5omRQLZWCCWEyilbMoRq3bmk97oWhrBUQJp0HBZ/552P+vO 8B+qPZtrOFYW7byAFjPx5mzGr9PRTZPNRnWMFHfee8SUhPiT3XXakGoJe+IwQ7HSphAC T46m9KrMmpG9KcT0xAabFpN3nI6Z/p6KBZ4TXIF679ocjDnHh/eOLw+ODwBvcH+rngCS Xndg== 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:message-id:date:subject:to:from:dkim-signature :dkim-filter:dkim-signature; bh=caSBzXSoQO4JT36s1LCFqB0aALYjJY5xYiL56inMl7o=; b=IBHhBVk13n/J4sYWzCqTwQaJQYSTzUwkBm1dGLuut7HIMagWmrH5iaDiDr9+xAbpXT 9DNZUpwZh9trUzm/HdH43vDUNEkXky6RteI7VXuzXK9Xz24X7WeYYXBCdoBd54fO0523 41FAEZ34nQcqicOrFdAaoPy9MCryHNzsdIBTe8IKiVp6q/Ki7mBI2M1IMelA4phFXpxz ey/36FcmQbbra6ILo5fxQs+pI+dwhEpMPHjcWiPJhT3dO1TGdUvJZpHRkAIcu5qb1yuK tWEy5uyZwcJEPTkQ4gDyW7aTW5T3mHBFSe9hZIUkrHNi8NsFsbCeaNE3l0JSaPJ8Y5PR WZ+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=VRIixjqI; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=B5mtwSVL; 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 v16si15702359pgg.290.2019.01.21.23.43.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 23:43:52 -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=VRIixjqI; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=B5mtwSVL; 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: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:In-Reply-To: References:List-Owner; bh=caSBzXSoQO4JT36s1LCFqB0aALYjJY5xYiL56inMl7o=; b=VRI ixjqIiNC3jk3ha2psKaF8Ws5kIpADKYwCOsDsNTaykM9TNXDDQ4QhIRno7dpZeB+0QNWu0Rcf5nb9 YUagN9Om9HAog182+P3Xp9WDRrBh43O206sCr2kJMzl8BGPLaYgeaFXThokptJCqB/VqfaaW2Lff4 m3LLATV491hNsCu363IZAjN3sU/+01q1jukLu71OO1B593tmAbTXqJYaOg33pYiV46Gr974cELESf NVwSOJPm2tkxEa1FgM7nsV8BGTSPJ/caFTU2zZFfQ3YhjxGyY0e8NkNWK4Dq8ywDaMULtTaWlEuJO HcStCRhNzltVhgN6iKaOih6D22MkQ8A==; 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 1glqil-0001Fd-PF; Tue, 22 Jan 2019 07:43:43 +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 1glqig-00018s-9P for linux-mtd@lists.infradead.org; Tue, 22 Jan 2019 07:43:42 +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 x0M7h55U025355; Tue, 22 Jan 2019 16:43:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x0M7h55U025355 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1548142986; bh=/EAQzAfgjQMPjJopeHVd+BRs6kFnnDKEQM2Nkxq5rFc=; h=From:To:Cc:Subject:Date:From; b=B5mtwSVLLFEemzEsPQyIL2J4v+p+jam/DCKTQ4+t65wj9hFw3wf8CYFMeDfWBoDHU WQqc/HLApvjvrdsCB2cPlsZUu1t6kraXGN+YCr/AfD885qA/N/E3YWhiDa352RUc8W OfoVkFfvS5R17bbFpIlFX4GFVoQyHzXaYwgPFXSO6IuCwShch7QDhbE46Ahi5LvqOv YP0mXHLsIOXCIWwr92k1yfloT/p3aTa8IlVlfwveELhxIwm2Dtbphq+Vd7dda8Y47C j9ECGjU7b7kyGvkhv0+x+74lt9aaH1XACav8iqIp01QfseLH4NUQXudY83vjj1Cvq6 3VbVbU3UUZU8w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org, Boris Brezillon , Miquel Raynal Subject: [PATCH 0/2] mtd: nand: use unnamed union field Date: Tue, 22 Jan 2019 16:42:53 +0900 Message-Id: <1548142975-14219-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190121_234339_553602_AF66A433 X-CRM114-Status: UNSURE ( 8.05 ) X-CRM114-Notice: Please train this message. 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: Lucas Stach , Marek Vasut , Richard Weinberger , Linus Walleij , Boris Brezillon , Janusz Krzysztofik , linux-kernel@vger.kernel.org, Stefan Agner , Jonathan Hunter , Masahiro Yamada , Thierry Reding , linux-tegra@vger.kernel.org, Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The new exec_op() scheme takes advantage of union in order to store instruction private data, which is mutually exclusive. I felt a bit annoyed with the long accessors. At least, we can omit "ctx." by making the union anonymous. I converted nand_op_instr and nand_op_parser_pattern_elem. I still see more instances, e.g. struct nand_op_data_instr { unsigned int len; union { void *in; const void *out; } buf; bool force_8bit; }; We could convert this into: struct nand_op_data_instr { unsigned int len; union { void *ibuf; const void *obuf; }; bool force_8bit; }; Or, if we want to match the struct to NAND_OP_*_INSTR, we can split it into two structures. struct nand_op_data_in_instr { unsigned int len; void *buf; bool force_8bit; }; struct nand_op_data_out_instr { unsigned int len; const void *buf; bool force_8bit; }; Anyway, let's see if people are positive about this shortning. Masahiro Yamada (2): mtd: rawnand: use unnamed union in struct nand_op_instr mtd: rawnand: use unnamed union in struct nand_op_parser_pattern_elem drivers/mtd/nand/raw/ams-delta.c | 18 +++++------ drivers/mtd/nand/raw/fsmc_nand.c | 41 +++++++++++------------- drivers/mtd/nand/raw/marvell_nand.c | 16 +++++----- drivers/mtd/nand/raw/nand_base.c | 64 ++++++++++++++++++------------------- drivers/mtd/nand/raw/tegra_nand.c | 10 +++--- drivers/mtd/nand/raw/vf610_nfc.c | 14 ++++---- include/linux/mtd/rawnand.h | 36 ++++++++++----------- 7 files changed, 97 insertions(+), 102 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/