Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7116734imu; Tue, 22 Jan 2019 00:17:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN6WAQqnTDPVA/PQ7ttawkhlqkCTBX068VY6GsRR0xlIHfktQygRDPNZ+Mn119tSRv4+1eCF X-Received: by 2002:a63:1444:: with SMTP id 4mr31320916pgu.430.1548145077150; Tue, 22 Jan 2019 00:17:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548145077; cv=none; d=google.com; s=arc-20160816; b=yONnbnVfPtxCePrVD0pQaMC9m4wkE0Rsajg62rip3xwZJyG1DyzOt1R5ULWH6EYd3x OLrEF/aJpdk9URHOXS5D69JQgUvyaN5znYvj5WH3u7bawgIlYRpObQqdzyRP4MSXVLkr CSV2JZq5v9+QS6pgtMAvlzVQGtqvW3AZs28/uLmKaElLrJoYhoDFcU4DQii9ydYoMUEZ 28QXcfXLTQz0bYCaXgIJcL22Fa/JVR0QE6J4fmPNc3i9LlGFQ/qXp8zL2ValjrZJnxew gztgGQiPtRm/ogWPQZlFaqtnwns0B/0wR52J6slIM7xGyxntX0jJgoiiRKd1NT3lf7rD 3SxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=E9edDR1WQ/jfpO6pQ7+TCwEoztR/YTcdual/1f3RrJc=; b=rdkGVb4jvkoXIGnVD49khGLlBhXE0SusKbPhawJdxdz1swbj02yM8XDjCtWf6Plbdh RGJUV4ZHrX5dL0zx3K5uiK9d/tIiqaabw+S0yi94lofvC71+G6ZMJPQsOTjj7Wb9OiZC REm0AiQwBNr0UiA6LoJXRvXhbvpuWFP/Tx4SHEdFXYr7zvuJU8LHHu45hKczfyx/A/mz FysgROEtrBcg8FizoMzERbrdfdEgo/fTp3igX114La2TWJRE1f5jG78w32Zru4s2DDZG eMWG7v2k8vINNNd1RnfqJ36EmaVsFoyVH68s0aMsdSjp7NQDT8Lc0CD8Ndg1ybDq/6jr G3Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mNt3q0KB; 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 w16si9587135plp.321.2019.01.22.00.17.41; Tue, 22 Jan 2019 00:17:57 -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=mNt3q0KB; 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 S1727414AbfAVIBh (ORCPT + 99 others); Tue, 22 Jan 2019 03:01:37 -0500 Received: from conssluserg-06.nifty.com ([210.131.2.91]:34453 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727165AbfAVIBh (ORCPT ); Tue, 22 Jan 2019 03:01:37 -0500 X-Greylist: delayed 989 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Jan 2019 03:01:35 EST Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) (authenticated) by conssluserg-06.nifty.com with ESMTP id x0M81VGa006056; Tue, 22 Jan 2019 17:01:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com x0M81VGa006056 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1548144092; bh=E9edDR1WQ/jfpO6pQ7+TCwEoztR/YTcdual/1f3RrJc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mNt3q0KB2dr3Rnmwg5yoa571kc0efSw5gwAy4+lDtuZs6ZLlbL5GMRyR2q9m7oetN 6UeDpn7h2sYhC5QsYdX7iuyMUeE7lyiqTQoOkiQQs2GJxckAcDmgtzfBvC61uwdRPL NF7C/FKkSuUptoON/pLZ+gt5azxmbDS7i6iW3nkAjz4o/Gv24ot7yq2JWcN5LqORrp HqzD0jnjNo6CkLQPKve9gCShU7aiPYoR3bMqUUDeYco377Igh+Vjf0IbEk8PHEnW5h MdhdjFjwk01iGEMFNpZMyQE5HVfdPGTxpverpOsws6VDTBBnBNlBj4djz7QD2B6zkI iD98LZKAZSqWw== X-Nifty-SrcIP: [209.85.217.46] Received: by mail-vs1-f46.google.com with SMTP id t17so14140552vsc.8; Tue, 22 Jan 2019 00:01:31 -0800 (PST) X-Gm-Message-State: AJcUukcmv5fOPtgCRFoXsvR6GK0/K2jGCCf2HtyfZHeEdTUfTFrhaeE7 zB9Ts9+ltPpsK6gDNAtGMiKwEOWNMxu8/NXBJWw= X-Received: by 2002:a67:f1c2:: with SMTP id v2mr13583238vsm.181.1548144090409; Tue, 22 Jan 2019 00:01:30 -0800 (PST) MIME-Version: 1.0 References: <1548142975-14219-1-git-send-email-yamada.masahiro@socionext.com> <1548142975-14219-3-git-send-email-yamada.masahiro@socionext.com> <20190122084944.420fcd4a@xps13> In-Reply-To: <20190122084944.420fcd4a@xps13> From: Masahiro Yamada Date: Tue, 22 Jan 2019 17:00:54 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] mtd: rawnand: use unnamed union in struct nand_op_parser_pattern_elem To: Miquel Raynal Cc: Lucas Stach , Marek Vasut , Richard Weinberger , Linus Walleij , Boris Brezillon , Janusz Krzysztofik , Linux Kernel Mailing List , Stefan Agner , Jonathan Hunter , Boris Brezillon , Thierry Reding , linux-mtd , linux-tegra@vger.kernel.org, Brian Norris , David Woodhouse Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 22, 2019 at 4:50 PM Miquel Raynal wrote: > > Hi Masahiro, > > Masahiro Yamada wrote on Tue, 22 Jan > 2019 16:42:55 +0900: > > > 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. > > > > Actually this is how we wrote it the first time. Then we got robots > reporting that anonymous unions where not allowed with older (still > supported) GCC versions and I had to do this: > > > commit c1a72e2dbb4abb90bd408480d7c48ba40cb799ce > Author: Miquel Raynal > Date: Fri Jan 19 19:11:27 2018 +0100 > > mtd: nand: Fix build issues due to an anonymous union > > GCC-4.4.4 raises errors when assigning a parameter in an anonymous > union, leading to this kind of failure: > > drivers/mtd/nand/marvell_nand.c:1936: > warning: missing braces around initializer > warning: (near initialization for '(anonymous)[1].') > error: unknown field 'data' specified in initializer > error: unknown field 'addr' specified in initializer > > Work around the situation by naming these unions. > > Fixes: 8878b126df76 ("mtd: nand: add ->exec_op() implementation") > Reported-by: Andrew Morton > Signed-off-by: Miquel Raynal > Tested-by: Andrew Morton > Signed-off-by: Boris Brezillon > Hmm, how come Andrew's compiler was fine with the following? struct nand_flash_dev { char *name; union { struct { uint8_t mfr_id; uint8_t dev_id; }; uint8_t id[NAND_MAX_ID_LEN]; }; unsigned int pagesize; ... }; The current minimum version is GCC 4.6 (commit cafa0010cd51fb7) but I am not sure if this restriction is remaining. -- Best Regards Masahiro Yamada