From patchwork Wed Dec 30 01:24:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 7931001 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1AE6BEEE5 for ; Wed, 30 Dec 2015 01:25:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEE7220160 for ; Wed, 30 Dec 2015 01:25:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE6C820173 for ; Wed, 30 Dec 2015 01:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754113AbbL3BZO (ORCPT ); Tue, 29 Dec 2015 20:25:14 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:46720 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753903AbbL3BZH (ORCPT ); Tue, 29 Dec 2015 20:25:07 -0500 Received: from localhost (c-71-198-47-131.hsd1.ca.comcast.net [71.198.47.131]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BC633130A; Wed, 30 Dec 2015 01:25:05 +0000 (UTC) Date: Tue, 29 Dec 2015 17:24:53 -0800 From: Andrew Morton To: "Rafael J. Wysocki" Cc: Andy Shevchenko , Stephen Rothwell , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, heikki.krogerus@linux.intel.com, linux-acpi@vger.kernel.org Subject: Re: [PATCH v2 1/3] device property: add spaces to PROPERTY_ENTRY_STRING macro Message-Id: <20151229172453.b8bf71ef.akpm@linux-foundation.org> In-Reply-To: <1627434.AfSeGfofYv@vostro.rjw.lan> References: <1450877684-76316-1-git-send-email-andriy.shevchenko@linux.intel.com> <4285778.gtB2L18Hsx@vostro.rjw.lan> <1451301853.30729.326.camel@linux.intel.com> <1627434.AfSeGfofYv@vostro.rjw.lan> X-Mailer: Sylpheed 2.7.1 (GTK+ 2.18.9; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 30 Dec 2015 02:49:26 +0100 "Rafael J. Wysocki" wrote: > On Monday, December 28, 2015 01:24:13 PM Andy Shevchenko wrote: > > On Mon, 2015-12-28 at 02:12 +0100, Rafael J. Wysocki wrote: > > > On Wednesday, December 23, 2015 03:34:42 PM Andy Shevchenko wrote: > > > > Just a style fix, no functional changes. > > > > > > > > To be folded to Andrew's patch. > > > > > > What patch? > > > > In linux-next from Andrew: > > > > e39ece7 include-linux-propertyh-fix-build-issues-with-gcc-444-fix > > 40bb8a1 include/linux/property.h: fix build issues with gcc-4.4.4 > > Any pointers to the original patch submission(s)? I think it was discussed in some followup to something else, I forget. This: From: Andrew Morton Subject: include/linux/property.h: fix build issues with gcc-4.4.4 gcc-4.4.4 has problems with initialization of anonymous unions: drivers/mfd/intel-lpss-acpi.c:30: error: unknown field 'value' specified in initializer work around this by crafting the initializers in a manner which the compiler can handle. Cc: Kevin Fenzi Cc: Mika Westerberg Cc: Andy Shevchenko Cc: Rafael J. Wysocki Cc: Heikki Krogerus Signed-off-by: Andrew Morton --- include/linux/property.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff -puN include/linux/property.h~include-linux-propertyh-fix-build-issues-with-gcc-444 include/linux/property.h --- a/include/linux/property.h~include-linux-propertyh-fix-build-issues-with-gcc-444 +++ a/include/linux/property.h @@ -175,12 +175,19 @@ struct property_entry { }; }; +/* + * Note: the below four initializers for the anonymous union are carefully + * crafted to avoid gcc-4.4.4's problems with initialization of anon unions + * and structs. + */ + #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ { \ .name = _name_, \ .length = ARRAY_SIZE(_val_) * sizeof(_type_), \ .is_array = true, \ - .pointer._type_##_data = _val_, \ + .is_string = false, \ + { .pointer = _type_##_data = _val_ } }, \ } #define PROPERTY_ENTRY_U8_ARRAY(_name_, _val_) \ @@ -198,14 +205,15 @@ struct property_entry { .length = ARRAY_SIZE(_val_) * sizeof(const char *), \ .is_array = true, \ .is_string = true, \ - .pointer.str = _val_, \ + { .pointer = { .str = _val_ } }, \ } #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ { \ .name = _name_, \ .length = sizeof(_type_), \ - .value._type_##_data = _val_, \ + .is_string = false, \ + { .value = { ._type_##_data = _val_ } }, \ } #define PROPERTY_ENTRY_U8(_name_, _val_) \ @@ -222,7 +230,7 @@ struct property_entry { .name = _name_, \ .length = sizeof(_val_), \ .is_string = true, \ - .value.str = _val_, \ + { .value = {.str = _val_} }, \ } #define PROPERTY_ENTRY_BOOL(_name_) \