Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7094239imu; Mon, 21 Jan 2019 23:46:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN7DAgByjYlPxrP+Y2PiTo4nQS0C00n2DUQIMmA0AQtRwxciCCT9GgarH8Ew7hnV7r/offg8 X-Received: by 2002:a63:4384:: with SMTP id q126mr30726104pga.160.1548143190580; Mon, 21 Jan 2019 23:46:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548143190; cv=none; d=google.com; s=arc-20160816; b=b5OHj0P89nHdBNVsAUQ8awwZ9VtFD52ZRvNCbpPLou0YV+fRpdTzT0dIOvplCdUXUp j+t4xz/+UABstTfgc1+6Y7KbzypHrYjPSeTMBob1EGbJklkBvpp9vkHjXkdbc1KqF3v0 idi3CC594W1OeCT4d7je9BzthK4mmkvxjnAQPkEcjDeJR7BMtkocnIlkUqiO2OTnyfwW sVUC168RYlNGeBKa+1MkP6m2VX76ltpun+T1MIx+2Mf3WBGjGHmsQ43BnarySw1g770k Ubw28Iwn2aPTzPHq0Kh0Y+tneQEe1XiZQdMX6gH2QVG2vjDtSLoVXQxymg/05sXwGT6K AuzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=/EAQzAfgjQMPjJopeHVd+BRs6kFnnDKEQM2Nkxq5rFc=; b=d73Hv5qSsPbx4xzQ6jSRyKRwv9AqgRp4pbvAs1LTWgQqIp80bb/kNh+MghYNRLWA0s 4wRlDzG9Z5MmdJzrko12lT0oOeiPvKUPue7ckkydpcisJYFtcdw8uFz+etK/uUYIZens J68DR5c3JCgc2P7gH0Eo4bTMpM8hfAWyBs9daCRp+Q6b2fKCPgZbQwt6izKsUoBax3jj 4zUl4jQ2B3gvyrC6McrAzclSA4c4w7v8jA5KLjZ4+HAfLDj131PeRWWuk1VJJhGtHyQ0 8k9vbWZMrAwiwCgiQf9PAsWh7DYosRkF2cIAonp25TW6mvswh70bH4tNtNTM0CfWpz7y Ml6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=B5mtwSVL; 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 y7si13603824pga.296.2019.01.21.23.46.15; Mon, 21 Jan 2019 23:46:30 -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=B5mtwSVL; 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 S1727347AbfAVHpI (ORCPT + 99 others); Tue, 22 Jan 2019 02:45:08 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:62777 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbfAVHpH (ORCPT ); Tue, 22 Jan 2019 02:45:07 -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 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 Cc: Masahiro Yamada , Thierry Reding , Brian Norris , Jonathan Hunter , Linus Walleij , linux-kernel@vger.kernel.org, Marek Vasut , Stefan Agner , Richard Weinberger , David Woodhouse , Janusz Krzysztofik , linux-tegra@vger.kernel.org, Boris Brezillon , Lucas Stach 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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