* [PATCH] media/i2c: ths8200: fix build failure with gcc 4.5.4
@ 2013-10-13 10:13 Russell King - ARM Linux
2013-10-13 10:36 ` Gianluca Gennari
0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-10-13 10:13 UTC (permalink / raw)
To: Mauro Carvalho Chehab, linux-media
v3.12-rc fails to build with this error:
drivers/media/i2c/ths8200.c:49:2: error: unknown field 'bt' specified in initializer
drivers/media/i2c/ths8200.c:50:3: error: field name not in record or union initializer
drivers/media/i2c/ths8200.c:50:3: error: (near initialization for 'ths8200_timings_cap.reserved')
drivers/media/i2c/ths8200.c:51:3: error: field name not in record or union initializer
drivers/media/i2c/ths8200.c:51:3: error: (near initialization for 'ths8200_timings_cap.reserved')
...
with gcc 4.5.4. This error was not detected in builds prior to v3.12-rc.
This patch fixes this.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/media/i2c/ths8200.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index a58a8f6..5ae2a4f 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -46,13 +46,17 @@ struct ths8200_state {
static const struct v4l2_dv_timings_cap ths8200_timings_cap = {
.type = V4L2_DV_BT_656_1120,
- .bt = {
- .max_width = 1920,
- .max_height = 1080,
- .min_pixelclock = 25000000,
- .max_pixelclock = 148500000,
- .standards = V4L2_DV_BT_STD_CEA861,
- .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE,
+ /* Allow gcc 4.5.4 to build this */
+ .reserved = { },
+ {
+ .bt = {
+ .max_width = 1920,
+ .max_height = 1080,
+ .min_pixelclock = 25000000,
+ .max_pixelclock = 148500000,
+ .standards = V4L2_DV_BT_STD_CEA861,
+ .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE,
+ },
},
};
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] media/i2c: ths8200: fix build failure with gcc 4.5.4
2013-10-13 10:13 [PATCH] media/i2c: ths8200: fix build failure with gcc 4.5.4 Russell King - ARM Linux
@ 2013-10-13 10:36 ` Gianluca Gennari
2013-10-13 11:16 ` Russell King - ARM Linux
0 siblings, 1 reply; 5+ messages in thread
From: Gianluca Gennari @ 2013-10-13 10:36 UTC (permalink / raw)
To: Russell King - ARM Linux; +Cc: Mauro Carvalho Chehab, linux-media
Il 13/10/2013 12:13, Russell King - ARM Linux ha scritto:
> v3.12-rc fails to build with this error:
>
> drivers/media/i2c/ths8200.c:49:2: error: unknown field 'bt' specified in initializer
> drivers/media/i2c/ths8200.c:50:3: error: field name not in record or union initializer
> drivers/media/i2c/ths8200.c:50:3: error: (near initialization for 'ths8200_timings_cap.reserved')
> drivers/media/i2c/ths8200.c:51:3: error: field name not in record or union initializer
> drivers/media/i2c/ths8200.c:51:3: error: (near initialization for 'ths8200_timings_cap.reserved')
> ...
>
> with gcc 4.5.4. This error was not detected in builds prior to v3.12-rc.
> This patch fixes this.
Hi Russel,
this error is already fixed by this patch:
https://patchwork.linuxtv.org/patch/20002/
that has been already accepted and is queued for kernel 3.12.
Regards,
Gianluca
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> drivers/media/i2c/ths8200.c | 18 +++++++++++-------
> 1 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
> index a58a8f6..5ae2a4f 100644
> --- a/drivers/media/i2c/ths8200.c
> +++ b/drivers/media/i2c/ths8200.c
> @@ -46,13 +46,17 @@ struct ths8200_state {
>
> static const struct v4l2_dv_timings_cap ths8200_timings_cap = {
> .type = V4L2_DV_BT_656_1120,
> - .bt = {
> - .max_width = 1920,
> - .max_height = 1080,
> - .min_pixelclock = 25000000,
> - .max_pixelclock = 148500000,
> - .standards = V4L2_DV_BT_STD_CEA861,
> - .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE,
> + /* Allow gcc 4.5.4 to build this */
> + .reserved = { },
> + {
> + .bt = {
> + .max_width = 1920,
> + .max_height = 1080,
> + .min_pixelclock = 25000000,
> + .max_pixelclock = 148500000,
> + .standards = V4L2_DV_BT_STD_CEA861,
> + .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE,
> + },
> },
> };
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] media/i2c: ths8200: fix build failure with gcc 4.5.4
2013-10-13 10:36 ` Gianluca Gennari
@ 2013-10-13 11:16 ` Russell King - ARM Linux
2013-10-13 12:55 ` Gianluca Gennari
0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-10-13 11:16 UTC (permalink / raw)
To: Gianluca Gennari; +Cc: Mauro Carvalho Chehab, linux-media
On Sun, Oct 13, 2013 at 12:36:07PM +0200, Gianluca Gennari wrote:
> Il 13/10/2013 12:13, Russell King - ARM Linux ha scritto:
> > v3.12-rc fails to build with this error:
> >
> > drivers/media/i2c/ths8200.c:49:2: error: unknown field 'bt' specified in initializer
> > drivers/media/i2c/ths8200.c:50:3: error: field name not in record or union initializer
> > drivers/media/i2c/ths8200.c:50:3: error: (near initialization for 'ths8200_timings_cap.reserved')
> > drivers/media/i2c/ths8200.c:51:3: error: field name not in record or union initializer
> > drivers/media/i2c/ths8200.c:51:3: error: (near initialization for 'ths8200_timings_cap.reserved')
> > ...
> >
> > with gcc 4.5.4. This error was not detected in builds prior to v3.12-rc.
> > This patch fixes this.
>
> Hi Russel,
> this error is already fixed by this patch:
>
> https://patchwork.linuxtv.org/patch/20002/
>
> that has been already accepted and is queued for kernel 3.12.
It would be a good idea to have the comment updated - given that gcc 4.5.4
also has a problem, it's not only a problem for gcc < 4.4.6 as that patch
claims.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] media/i2c: ths8200: fix build failure with gcc 4.5.4
2013-10-13 11:16 ` Russell King - ARM Linux
@ 2013-10-13 12:55 ` Gianluca Gennari
2013-10-13 12:58 ` Russell King - ARM Linux
0 siblings, 1 reply; 5+ messages in thread
From: Gianluca Gennari @ 2013-10-13 12:55 UTC (permalink / raw)
To: Russell King - ARM Linux; +Cc: Mauro Carvalho Chehab, linux-media
Il 13/10/2013 13:16, Russell King - ARM Linux ha scritto:
> On Sun, Oct 13, 2013 at 12:36:07PM +0200, Gianluca Gennari wrote:
>> Il 13/10/2013 12:13, Russell King - ARM Linux ha scritto:
>>> v3.12-rc fails to build with this error:
>>>
>>> drivers/media/i2c/ths8200.c:49:2: error: unknown field 'bt' specified in initializer
>>> drivers/media/i2c/ths8200.c:50:3: error: field name not in record or union initializer
>>> drivers/media/i2c/ths8200.c:50:3: error: (near initialization for 'ths8200_timings_cap.reserved')
>>> drivers/media/i2c/ths8200.c:51:3: error: field name not in record or union initializer
>>> drivers/media/i2c/ths8200.c:51:3: error: (near initialization for 'ths8200_timings_cap.reserved')
>>> ...
>>>
>>> with gcc 4.5.4. This error was not detected in builds prior to v3.12-rc.
>>> This patch fixes this.
>>
>> Hi Russel,
>> this error is already fixed by this patch:
>>
>> https://patchwork.linuxtv.org/patch/20002/
>>
>> that has been already accepted and is queued for kernel 3.12.
>
> It would be a good idea to have the comment updated - given that gcc 4.5.4
> also has a problem, it's not only a problem for gcc < 4.4.6 as that patch
> claims.
>
Yep, the fact is that there are 2 different compatibility problems:
- gcc < 4.4.6 requires additional curly brackets to initialize anonymous
structs (see v4l2-dv-timings.h);
- some gcc version requires that structure members are initialized in
the same order they are defined, even if you specify the member name;
The second issue is the one you are facing, but I don't know how to
track it down to a specific gcc version. If you can get the exact
version number and provide a patch, you're welcome!
Regards,
Gianluca
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] media/i2c: ths8200: fix build failure with gcc 4.5.4
2013-10-13 12:55 ` Gianluca Gennari
@ 2013-10-13 12:58 ` Russell King - ARM Linux
0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-10-13 12:58 UTC (permalink / raw)
To: Gianluca Gennari; +Cc: Mauro Carvalho Chehab, linux-media
On Sun, Oct 13, 2013 at 02:55:49PM +0200, Gianluca Gennari wrote:
> Il 13/10/2013 13:16, Russell King - ARM Linux ha scritto:
> > On Sun, Oct 13, 2013 at 12:36:07PM +0200, Gianluca Gennari wrote:
> >> Il 13/10/2013 12:13, Russell King - ARM Linux ha scritto:
> >>> v3.12-rc fails to build with this error:
> >>>
> >>> drivers/media/i2c/ths8200.c:49:2: error: unknown field 'bt' specified in initializer
> >>> drivers/media/i2c/ths8200.c:50:3: error: field name not in record or union initializer
> >>> drivers/media/i2c/ths8200.c:50:3: error: (near initialization for 'ths8200_timings_cap.reserved')
> >>> drivers/media/i2c/ths8200.c:51:3: error: field name not in record or union initializer
> >>> drivers/media/i2c/ths8200.c:51:3: error: (near initialization for 'ths8200_timings_cap.reserved')
> >>> ...
> >>>
> >>> with gcc 4.5.4. This error was not detected in builds prior to v3.12-rc.
> >>> This patch fixes this.
> >>
> >> Hi Russel,
> >> this error is already fixed by this patch:
> >>
> >> https://patchwork.linuxtv.org/patch/20002/
> >>
> >> that has been already accepted and is queued for kernel 3.12.
> >
> > It would be a good idea to have the comment updated - given that gcc 4.5.4
> > also has a problem, it's not only a problem for gcc < 4.4.6 as that patch
> > claims.
> >
>
> Yep, the fact is that there are 2 different compatibility problems:
> - gcc < 4.4.6 requires additional curly brackets to initialize anonymous
> structs (see v4l2-dv-timings.h);
gcc 4.5.4 also requires that - merely adding the initializer for
.reserved doesn't fix it on this gcc version (it continues to
complain about "unknown field 'bt'").
> - some gcc version requires that structure members are initialized in
> the same order they are defined, even if you specify the member name;
>
> The second issue is the one you are facing, but I don't know how to
> track it down to a specific gcc version. If you can get the exact
> version number and provide a patch, you're welcome!
The exact version number is gcc 4.5.4. It's the released 4.5.4 version
built straight from the FSF's gcc-core-4.5.4.tar.bz2.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-10-13 12:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-13 10:13 [PATCH] media/i2c: ths8200: fix build failure with gcc 4.5.4 Russell King - ARM Linux
2013-10-13 10:36 ` Gianluca Gennari
2013-10-13 11:16 ` Russell King - ARM Linux
2013-10-13 12:55 ` Gianluca Gennari
2013-10-13 12:58 ` Russell King - ARM Linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox