diff mbox

[v2,1/3] device property: add spaces to PROPERTY_ENTRY_STRING macro

Message ID 20151229172453.b8bf71ef.akpm@linux-foundation.org (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Andrew Morton Dec. 30, 2015, 1:24 a.m. UTC
On Wed, 30 Dec 2015 02:49:26 +0100 "Rafael J. Wysocki" <rjw@rjwysocki.net> 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 <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(-)

Comments

Andy Shevchenko Dec. 30, 2015, 1:43 a.m. UTC | #1
On Wed, Dec 30, 2015 at 4:06 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Tuesday, December 29, 2015 05:24:53 PM Andrew Morton wrote:
>> On Wed, 30 Dec 2015 02:49:26 +0100 "Rafael J. Wysocki" <rjw@rjwysocki.net> 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 <akpm@linux-foundation.org>
>> Subject: include/linux/property.h: fix build issues with gcc-4.4.4
>
> OK, thanks!
>
> 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.

Be aware that there are actually _two_ patches from Andrew and _one_
from me to be all folded together.
I think there is no need to have 3 of them.

>
> Thanks,
> Rafael
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
Rafael J. Wysocki Dec. 30, 2015, 2:06 a.m. UTC | #2
On Tuesday, December 29, 2015 05:24:53 PM Andrew Morton wrote:
> On Wed, 30 Dec 2015 02:49:26 +0100 "Rafael J. Wysocki" <rjw@rjwysocki.net> 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 <akpm@linux-foundation.org>
> Subject: include/linux/property.h: fix build issues with gcc-4.4.4

OK, thanks!

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.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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_)		\