From: Andrew Morton <akpm@linux-foundation.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
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
Date: Tue, 29 Dec 2015 17:44:48 -0800 [thread overview]
Message-ID: <20151229174448.dba9a7ab.akpm@linux-foundation.org> (raw)
In-Reply-To: <1850926.j60LlceTNY@vostro.rjw.lan>
On Wed, 30 Dec 2015 03:06:23 +0100 "Rafael J. Wysocki" <rjw@rjwysocki.net> wrote:
> I'll apply it to my tree if you don't mind with the Andy's [1/3] on top
> so we have all of that in one place.
That version needed a fix. Here's the one to apply:
From: Andrew Morton <akpm@linux-foundation.org>
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 <kevin@scrye.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
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_) \
_
next prev parent reply other threads:[~2015-12-30 1:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 13:34 [PATCH v2 0/3] device property: post merge fixes Andy Shevchenko
2015-12-23 13:34 ` [PATCH v2 1/3] device property: add spaces to PROPERTY_ENTRY_STRING macro Andy Shevchenko
2015-12-28 1:12 ` Rafael J. Wysocki
2015-12-28 11:24 ` Andy Shevchenko
2015-12-30 1:49 ` Rafael J. Wysocki
2015-12-30 1:24 ` Andrew Morton
2015-12-30 2:06 ` Rafael J. Wysocki
2015-12-30 1:43 ` Andy Shevchenko
2015-12-30 1:44 ` Andrew Morton [this message]
2016-01-01 0:53 ` Rafael J. Wysocki
2015-12-30 1:29 ` Andy Shevchenko
2015-12-23 13:34 ` [PATCH v2 2/3] device property: the secondary fwnode needs to depend on the primary Andy Shevchenko
2015-12-29 8:40 ` Heikki Krogerus
2015-12-29 10:57 ` Andy Shevchenko
2015-12-23 13:34 ` [PATCH v2 3/3] device property: avoid allocations of 0 length Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151229174448.dba9a7ab.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).