Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7111324imu; Tue, 22 Jan 2019 00:10:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN4tcp9/u/nnm/YTHKzxBlKnyo37VCMDL5VIbSAFUXeMyzrYw+3q82OlWyJ1fgVJmsPjXfKC X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr33605794plb.0.1548144634032; Tue, 22 Jan 2019 00:10:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548144634; cv=none; d=google.com; s=arc-20160816; b=ZX4I4vmkXuIzvx7Rnk20tNR0K7Yj3mG3QUfV6sGBF4xhCl4BaFWpd1FZZ1YlB424gZ KDMqIPXvF55oWEQ8tQLJSYEVup/zYR0bt8EwGlVEmUWiZvYgGHyy13RlDbvIOfYXK2Gv G+CCVN/Pg19Fllcoo4FVDuPdy8RLcprFaH0+lYX8ORpEkLzYyKSG9crPbCzddkY7p3dg vv+VhaCCDiblko5erPQTtJsfNy2kZ6JbeLYmtx/dxoyeVowJFjPmx6h0n4i0sveBbzfS Z/DoWcjgGzo5WaYna3xhlinUTUzAxxeWIxYsV9ryoFFw8Kpw/Muf/Mbzrfcndx54Ztl9 oiyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=tME3vxaihLNWhuqE8vELe1rXEHOmPHrTGUdbzBMCD0I=; b=zQPqDjlDcHe6jJYE/4TfCjaLGY6GsdFvlGPm2bEYLORSIFaRasVZSFDGsWUwbcDth6 fuQU5vHfhkO6/q3Q46TrCXwBSBQaDpjjfWAYDE6rljzRZTd9rRARhMtHm3mSQihX27G/ rPalKxv4zyy7eP9egoNiiZGtSbGbjgx6KKY+qzdV6CDqIIDCEpJIE5DhRsrQAvHjsVI2 MuxFfR9uyetFXgG6D4a4SXTxNR7eG9Lo6PPsZUoViepBHXoNsQHxPAbAQK1gvPsaiEJz Vxwo33+HhqcbbF9nIVJFACrZjHkql/n07eDG3cJKf49DnNZzKKOjJBpTqnL6pxYN1cZx UayQ== ARC-Authentication-Results: i=1; mx.google.com; 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 l186si9114394pge.205.2019.01.22.00.10.18; Tue, 22 Jan 2019 00:10:33 -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; 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 S1727588AbfAVIIn convert rfc822-to-8bit (ORCPT + 99 others); Tue, 22 Jan 2019 03:08:43 -0500 Received: from mail.bootlin.com ([62.4.15.54]:54475 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727374AbfAVIIn (ORCPT ); Tue, 22 Jan 2019 03:08:43 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 8D411209EF; Tue, 22 Jan 2019 09:08:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from xps13 (aaubervilliers-681-1-37-87.w90-88.abo.wanadoo.fr [90.88.156.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 1B575206DC; Tue, 22 Jan 2019 09:08:30 +0100 (CET) Date: Tue, 22 Jan 2019 09:08:30 +0100 From: Miquel Raynal To: Masahiro Yamada 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 Subject: Re: [PATCH 2/2] mtd: rawnand: use unnamed union in struct nand_op_parser_pattern_elem Message-ID: <20190122090830.118eb6be@xps13> In-Reply-To: References: <1548142975-14219-1-git-send-email-yamada.masahiro@socionext.com> <1548142975-14219-3-git-send-email-yamada.masahiro@socionext.com> <20190122084944.420fcd4a@xps13> Organization: Bootlin X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masahiro, Masahiro Yamada wrote on Tue, 22 Jan 2019 17:00:54 +0900: > 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; > ... > }; > It is probably not :) > > > The current minimum version is GCC 4.6 > (commit cafa0010cd51fb7) > but I am not sure if this restriction is remaining. > That's right, can you please test if this limitation is still ongoing wit GCC 4.6? Thanks, Miquèl