linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build warning after merge of the fbdev tree
@ 2022-11-15  0:20 Stephen Rothwell
  2022-11-15  5:20 ` Helge Deller
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2022-11-15  0:20 UTC (permalink / raw)
  To: Helge Deller
  Cc: Shang XiaoJing, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

Hi all,

After merging the fbdev tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

WARNING: modpost: drivers/video/fbdev/via/viafb.o: section mismatch in reference: init_module (section: .init.text) -> viafb_exit (section: .exit.text)

Introduced by commit

  ab885d8c7e15 ("fbdev: via: Fix error in via_core_init()")

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2022-11-15  0:20 linux-next: build warning after merge of the fbdev tree Stephen Rothwell
@ 2022-11-15  5:20 ` Helge Deller
  0 siblings, 0 replies; 14+ messages in thread
From: Helge Deller @ 2022-11-15  5:20 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Shang XiaoJing, Linux Kernel Mailing List, Linux Next Mailing List

On 11/15/22 01:20, Stephen Rothwell wrote:
> After merging the fbdev tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> WARNING: modpost: drivers/video/fbdev/via/viafb.o: section mismatch in reference: init_module (section: .init.text) -> viafb_exit (section: .exit.text)
>
> Introduced by commit
>
>    ab885d8c7e15 ("fbdev: via: Fix error in via_core_init()")

build is fixed for now... but still looking for a better solution.

Helge


^ permalink raw reply	[flat|nested] 14+ messages in thread

* linux-next: build warning after merge of the fbdev tree
@ 2019-06-11  0:42 Stephen Rothwell
  0 siblings, 0 replies; 14+ messages in thread
From: Stephen Rothwell @ 2019-06-11  0:42 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Linux Next Mailing List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]

Hi Bartlomiej,

After merging the fbdev tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

drivers/video/fbdev/pvr2fb.c:726:12: warning: 'pvr2_get_param_val' defined but not used [-Wunused-function]
 static int pvr2_get_param_val(const struct pvr2_params *p, const char *s,
            ^~~~~~~~~~~~~~~~~~

Introduced by commit

  0f5a5712ad1e ("video: fbdev: pvr2fb: add COMPILE_TEST support")

The uses are protected by #ifndef MODULE.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2019-04-02 12:38 ` Tom Li
@ 2019-04-02 15:16   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2019-04-02 15:16 UTC (permalink / raw)
  To: Tom Li
  Cc: Sudip Mukherjee, Linux Next Mailing List,
	Linux Kernel Mailing List, Gustavo A. R. Silva, Kees Cook,
	linux-fbdev


On 04/02/2019 02:38 PM, Tom Li wrote:
> On Tue, Apr 02, 2019 at 09:30:07AM +1100, Stephen Rothwell wrote:
>> Hi Bartlomiej,
>>
>> After merging the fbdev tree, today's linux-next build (x86_64
>> allmodconfig) produced this warning:
>>
>> drivers/video/fbdev/sm712fb.c: In function 'smtc_blank':
>> drivers/video/fbdev/sm712fb.c:900:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
>>     smtc_seqw(0x6b, 0x02);
>>     ^~~~~~~~~~~~~~~~~~~~~
>> drivers/video/fbdev/sm712fb.c:901:3: note: here
>>    case 0x720:
>>    ^~~~
>>
>> Introduced by commit
>>
>>   f627caf55b8e ("fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting")
>>
> 
> Nice catch! Thanks!
> 
> This bug was introduced by me while attempting to fix another issue, a result of
> my copy-paste error. Since it only reprograms the clock to a different frequency,
> it's only a benign issue without visible side-effect, so it also evaded Sudip
> Mukherjee's code review and regression tests.
> 
> But what's I'm more concerned here is the failure of scripts/checkpatch.pl. I
> thought ./checkpatch.pl should have caught it, but for some reasons it cannot
> detect this one.
> 
> $ ./scripts/checkpatch.pl 0001-fbdev-sm712fb-fix-crashes-and-garbled-display-during.patch
> total: 0 errors, 0 warnings, 105 lines checked
> 
> So I mistakenly assumed the patch doesn't have a problem... It seems checkpatch.pl
> cannot detect fallthroughs in nested switch/case statements? I'm not sure. Should I
> report it to the maintainers of checkpatch.pl?
> 
> Anyway, please apply the following patch ASAP.
> 
> Thanks,
> Tom Li
> 
>>From 040fa4e6cc8b338cd845c11fd3efd7394ca55108 Mon Sep 17 00:00:00 2001
> From: Yifeng Li <tomli@tomli.me>
> Date: Tue, 2 Apr 2019 20:25:20 +0800
> Subject: [PATCH] fbdev: sm712fb: fix memory frequency by avoiding a
>  switch/case fallthrough.
> 
> A fallthrough in switch/case was introduced in f627caf55b8e ("fbdev:
> sm712fb: fix crashes and garbled display during DPMS modesetting"),
> due to my copy-paste error, which would cause the memory clock frequency
> for SM720 to be programmed to SM712.
> 
> Since it only reprograms the clock to a different frequency, it's only
> a benign issue without visible side-effect, so it also evaded Sudip
> Mukherjee's code review and regression tests. scripts/checkpatch.pl
> also failed to discover the issue, possibly due to nested switch
> statements.
> 
> This issue was found by Stephen Rothwell by building linux-next with
> -Wimplicit-fallthrough.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Fixes: f627caf55b8e ("fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting")
> Signed-off-by: Yifeng Li <tomli@tomli.me>

Applied to fbdev-for-next, thanks!

> ---
>  drivers/video/fbdev/sm712fb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c
> index 1e2503b52c6f..f1dcc6766d1e 100644
> --- a/drivers/video/fbdev/sm712fb.c
> +++ b/drivers/video/fbdev/sm712fb.c
> @@ -898,6 +898,7 @@ static int smtc_blank(int blank_mode, struct fb_info *info)
>  		case 0x712:
>  			smtc_seqw(0x6a, 0x16);
>  			smtc_seqw(0x6b, 0x02);
> +			break;
>  		case 0x720:
>  			smtc_seqw(0x6a, 0x0d);
>  			smtc_seqw(0x6b, 0x02);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2019-04-01 22:30 Stephen Rothwell
@ 2019-04-02 12:38 ` Tom Li
  2019-04-02 15:16   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 14+ messages in thread
From: Tom Li @ 2019-04-02 12:38 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Sudip Mukherjee
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Yifeng Li,
	Gustavo A. R. Silva, Kees Cook, linux-fbdev

On Tue, Apr 02, 2019 at 09:30:07AM +1100, Stephen Rothwell wrote:
> Hi Bartlomiej,
> 
> After merging the fbdev tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
> 
> drivers/video/fbdev/sm712fb.c: In function 'smtc_blank':
> drivers/video/fbdev/sm712fb.c:900:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
>     smtc_seqw(0x6b, 0x02);
>     ^~~~~~~~~~~~~~~~~~~~~
> drivers/video/fbdev/sm712fb.c:901:3: note: here
>    case 0x720:
>    ^~~~
> 
> Introduced by commit
> 
>   f627caf55b8e ("fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting")
> 

Nice catch! Thanks!

This bug was introduced by me while attempting to fix another issue, a result of
my copy-paste error. Since it only reprograms the clock to a different frequency,
it's only a benign issue without visible side-effect, so it also evaded Sudip
Mukherjee's code review and regression tests.

But what's I'm more concerned here is the failure of scripts/checkpatch.pl. I
thought ./checkpatch.pl should have caught it, but for some reasons it cannot
detect this one.

$ ./scripts/checkpatch.pl 0001-fbdev-sm712fb-fix-crashes-and-garbled-display-during.patch
total: 0 errors, 0 warnings, 105 lines checked

So I mistakenly assumed the patch doesn't have a problem... It seems checkpatch.pl
cannot detect fallthroughs in nested switch/case statements? I'm not sure. Should I
report it to the maintainers of checkpatch.pl?

Anyway, please apply the following patch ASAP.

Thanks,
Tom Li

>From 040fa4e6cc8b338cd845c11fd3efd7394ca55108 Mon Sep 17 00:00:00 2001
From: Yifeng Li <tomli@tomli.me>
Date: Tue, 2 Apr 2019 20:25:20 +0800
Subject: [PATCH] fbdev: sm712fb: fix memory frequency by avoiding a
 switch/case fallthrough.

A fallthrough in switch/case was introduced in f627caf55b8e ("fbdev:
sm712fb: fix crashes and garbled display during DPMS modesetting"),
due to my copy-paste error, which would cause the memory clock frequency
for SM720 to be programmed to SM712.

Since it only reprograms the clock to a different frequency, it's only
a benign issue without visible side-effect, so it also evaded Sudip
Mukherjee's code review and regression tests. scripts/checkpatch.pl
also failed to discover the issue, possibly due to nested switch
statements.

This issue was found by Stephen Rothwell by building linux-next with
-Wimplicit-fallthrough.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: f627caf55b8e ("fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting")
Signed-off-by: Yifeng Li <tomli@tomli.me>
---
 drivers/video/fbdev/sm712fb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c
index 1e2503b52c6f..f1dcc6766d1e 100644
--- a/drivers/video/fbdev/sm712fb.c
+++ b/drivers/video/fbdev/sm712fb.c
@@ -898,6 +898,7 @@ static int smtc_blank(int blank_mode, struct fb_info *info)
 		case 0x712:
 			smtc_seqw(0x6a, 0x16);
 			smtc_seqw(0x6b, 0x02);
+			break;
 		case 0x720:
 			smtc_seqw(0x6a, 0x0d);
 			smtc_seqw(0x6b, 0x02);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* linux-next: build warning after merge of the fbdev tree
@ 2019-04-01 22:30 Stephen Rothwell
  2019-04-02 12:38 ` Tom Li
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2019-04-01 22:30 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Yifeng Li,
	Gustavo A. R. Silva, Kees Cook

[-- Attachment #1: Type: text/plain, Size: 843 bytes --]

Hi Bartlomiej,

After merging the fbdev tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

drivers/video/fbdev/sm712fb.c: In function 'smtc_blank':
drivers/video/fbdev/sm712fb.c:900:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    smtc_seqw(0x6b, 0x02);
    ^~~~~~~~~~~~~~~~~~~~~
drivers/video/fbdev/sm712fb.c:901:3: note: here
   case 0x720:
   ^~~~

Introduced by commit

  f627caf55b8e ("fbdev: sm712fb: fix crashes and garbled display during DPMS modesetting")

I get this warning because I am building with -Wimplicit-fallthrough
in attempt to catch new additions early.  The gcc warning can be turned
off by adding a /* fall through */ comment at the point the fall through
happens (assuming that the fall through is intentional).

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* linux-next: build warning after merge of the fbdev tree
@ 2017-08-02  1:32 Stephen Rothwell
  0 siblings, 0 replies; 14+ messages in thread
From: Stephen Rothwell @ 2017-08-02  1:32 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Daniel Vetter, Sean Paul

Hi Bartlomiej,

After merging the fbdev tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

drivers/video/fbdev/matrox/matroxfb_base.c:1583:12: warning: 'hotplug' defined but not used [-Wunused-variable]
 static int hotplug = 0;
            ^

Introduced by commit

  376b3ff54c9a ("fbdev: Nuke FBINFO_MODULE")

"hotplug" is only used when CONFIG_MODULE is not set, now.

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2011-12-20 15:42         ` Laurent Pinchart
@ 2011-12-20 15:48           ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2011-12-20 15:48 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Stephen Rothwell, Florian Tobias Schandinat, linux-fbdev,
	linux-next, linux-kernel

Hi Laurent,

On Tue, Dec 20, 2011 at 16:42, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Tuesday 20 December 2011 16:24:30 Geert Uytterhoeven wrote:
>> On Tue, Dec 20, 2011 at 16:19, Laurent Pinchart wrote:
>> > On Tuesday 20 December 2011 14:48:33 Geert Uytterhoeven wrote:
>> >> On Tue, Dec 20, 2011 at 11:37, Laurent Pinchart wrote:
>> >> > On Tuesday 20 December 2011 06:32:14 Stephen Rothwell wrote:
>> >> >> After merging the fbdev tree, today's linux-next build (powerpc
>> >> >> ppc64_defconfig) produced this warning:
>> >> >>
>> >> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: braces around
>> >> >> scalar initializer [enabled by default]
>> >> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near
>> >> >> initialization for 'vesafb_defined.colorspace') [enabled by default]
>> >> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: excess elements
>> >> >> in scalar initializer [enabled by default]
>> >> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near
>> >> >> initialization for 'vesafb_defined.colorspace') [enabled by default]
>> >> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: braces around
>> >> >> scalar initializer [enabled by default]
>> >> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near
>> >> >> initialization for 'matroxfb_dh_defined.colorspace') [enabled by
>> >> >> default]
>> >> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: excess elements
>> >> >> in scalar initializer [enabled by default]
>> >> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near
>> >> >> initialization for 'matroxfb_dh_defined.colorspace') [enabled by
>> >> >> default]
>> >> >>
>> >> >> Introduced by commit fb21c2f42879 ("fbdev: Add FOURCC-based format
>> >> >> configuration API").
>> >> >
>> >> > The following patch should fix the issue. Florian, are you fine with
>> >> > it, or would you rather modify the initializers to be name-based ?
>> >> >
>> >> > From 078987fc14dba806fc1bc628e3e5c371db3cf1b8 Mon Sep 17 00:00:00 2001
>> >> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> >> > Date: Tue, 20 Dec 2011 11:30:53 +0100
>> >> > Subject: [PATCH] fbdev: matroxfb: Fix compilation after
>> >> > fb_var_screeninfo change
>> >> >
>> >> > Commit fb21c2f42879 ("fbdev: Add FOURCC-based format configuration
>> >> > API") modified the layout of the fb_var_screeninfo structure. Update
>> >> > the static initializers in the matroxfb driver accordingly.
>> >> >
>> >> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> >> > ---
>> >> >  drivers/video/matrox/matroxfb_base.c  |    2 +-
>> >> >  drivers/video/matrox/matroxfb_crtc2.c |    2 +-
>> >> >  2 files changed, 2 insertions(+), 2 deletions(-)
>> >> >
>> >> > diff --git a/drivers/video/matrox/matroxfb_base.c
>> >> > b/drivers/video/matrox/matroxfb_base.c index 44bf8d4..f98aad5 100644
>> >> > --- a/drivers/video/matrox/matroxfb_base.c
>> >> > +++ b/drivers/video/matrox/matroxfb_base.c
>> >> > @@ -147,7 +147,7 @@ static struct fb_var_screeninfo vesafb_defined = {
>> >> >        39721L,48L,16L,33L,10L,
>> >> >        96L,2L,~0,      /* No sync info */
>> >> >        FB_VMODE_NONINTERLACED,
>> >> > -       0, {0,0,0,0,0}
>> >> > +       0, 0, {0,0,0,0}
>> >>
>> >> All these zeroes should not be specified, the compiler will do the
>> >> right thing for
>> >> static variables anyway.
>> >>
>> >> Else they have to be updated manually everytime one of the reserved
>> >> fields is consumed for a new feature.
>> >
>> > I agree. Should I just remove them, or switch the structures to named
>> > initializers while I'm at it ?
>>
>> I would just remove them. What do they buy you?
>>
>> Even with named initializers
>>
>>     .reserved = { 0, 0, 0, 0 }
>>
>> will break once we consume one more reserved field, unless you write
>>
>>     .reserved = { 0, }
>>
>> to let the compiler handle it, but then you could just not specify the
>> field at all.
>
> Sure. In both cases I would remove them, but I was wondering if I should
> switch the whole structure to named initializers in addition to removing them.
> I don't know if the common practice to solve issues in the -next tree is to
> apply patches that are as little intrusive as possible, or if bigger patches
> are allowed.

I'd fix the build error first.
The conversion to named initializers can be separate cleanup patch.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2011-12-20 15:24       ` Geert Uytterhoeven
@ 2011-12-20 15:42         ` Laurent Pinchart
  2011-12-20 15:48           ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Laurent Pinchart @ 2011-12-20 15:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Stephen Rothwell, Florian Tobias Schandinat, linux-fbdev,
	linux-next, linux-kernel

Hi Geert,

On Tuesday 20 December 2011 16:24:30 Geert Uytterhoeven wrote:
> On Tue, Dec 20, 2011 at 16:19, Laurent Pinchart wrote:
> > On Tuesday 20 December 2011 14:48:33 Geert Uytterhoeven wrote:
> >> On Tue, Dec 20, 2011 at 11:37, Laurent Pinchart wrote:
> >> > On Tuesday 20 December 2011 06:32:14 Stephen Rothwell wrote:
> >> >> After merging the fbdev tree, today's linux-next build (powerpc
> >> >> ppc64_defconfig) produced this warning:
> >> >> 
> >> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: braces around
> >> >> scalar initializer [enabled by default]
> >> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near
> >> >> initialization for 'vesafb_defined.colorspace') [enabled by default]
> >> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: excess elements
> >> >> in scalar initializer [enabled by default]
> >> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near
> >> >> initialization for 'vesafb_defined.colorspace') [enabled by default]
> >> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: braces around
> >> >> scalar initializer [enabled by default]
> >> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near
> >> >> initialization for 'matroxfb_dh_defined.colorspace') [enabled by
> >> >> default]
> >> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: excess elements
> >> >> in scalar initializer [enabled by default]
> >> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near
> >> >> initialization for 'matroxfb_dh_defined.colorspace') [enabled by
> >> >> default]
> >> >> 
> >> >> Introduced by commit fb21c2f42879 ("fbdev: Add FOURCC-based format
> >> >> configuration API").
> >> > 
> >> > The following patch should fix the issue. Florian, are you fine with
> >> > it, or would you rather modify the initializers to be name-based ?
> >> > 
> >> > From 078987fc14dba806fc1bc628e3e5c371db3cf1b8 Mon Sep 17 00:00:00 2001
> >> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >> > Date: Tue, 20 Dec 2011 11:30:53 +0100
> >> > Subject: [PATCH] fbdev: matroxfb: Fix compilation after
> >> > fb_var_screeninfo change
> >> > 
> >> > Commit fb21c2f42879 ("fbdev: Add FOURCC-based format configuration
> >> > API") modified the layout of the fb_var_screeninfo structure. Update
> >> > the static initializers in the matroxfb driver accordingly.
> >> > 
> >> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >> > ---
> >> >  drivers/video/matrox/matroxfb_base.c  |    2 +-
> >> >  drivers/video/matrox/matroxfb_crtc2.c |    2 +-
> >> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >> > 
> >> > diff --git a/drivers/video/matrox/matroxfb_base.c
> >> > b/drivers/video/matrox/matroxfb_base.c index 44bf8d4..f98aad5 100644
> >> > --- a/drivers/video/matrox/matroxfb_base.c
> >> > +++ b/drivers/video/matrox/matroxfb_base.c
> >> > @@ -147,7 +147,7 @@ static struct fb_var_screeninfo vesafb_defined = {
> >> >        39721L,48L,16L,33L,10L,
> >> >        96L,2L,~0,      /* No sync info */
> >> >        FB_VMODE_NONINTERLACED,
> >> > -       0, {0,0,0,0,0}
> >> > +       0, 0, {0,0,0,0}
> >> 
> >> All these zeroes should not be specified, the compiler will do the
> >> right thing for
> >> static variables anyway.
> >> 
> >> Else they have to be updated manually everytime one of the reserved
> >> fields is consumed for a new feature.
> > 
> > I agree. Should I just remove them, or switch the structures to named
> > initializers while I'm at it ?
> 
> I would just remove them. What do they buy you?
> 
> Even with named initializers
> 
>     .reserved = { 0, 0, 0, 0 }
> 
> will break once we consume one more reserved field, unless you write
> 
>     .reserved = { 0, }
> 
> to let the compiler handle it, but then you could just not specify the
> field at all.

Sure. In both cases I would remove them, but I was wondering if I should 
switch the whole structure to named initializers in addition to removing them. 
I don't know if the common practice to solve issues in the -next tree is to 
apply patches that are as little intrusive as possible, or if bigger patches 
are allowed.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2011-12-20 15:19     ` Laurent Pinchart
@ 2011-12-20 15:24       ` Geert Uytterhoeven
  2011-12-20 15:42         ` Laurent Pinchart
  0 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2011-12-20 15:24 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Stephen Rothwell, Florian Tobias Schandinat, linux-fbdev,
	linux-next, linux-kernel

Hi Laurent,

On Tue, Dec 20, 2011 at 16:19, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Tuesday 20 December 2011 14:48:33 Geert Uytterhoeven wrote:
>> On Tue, Dec 20, 2011 at 11:37, Laurent Pinchart wrote:
>> > On Tuesday 20 December 2011 06:32:14 Stephen Rothwell wrote:
>> >> After merging the fbdev tree, today's linux-next build (powerpc
>> >> ppc64_defconfig) produced this warning:
>> >>
>> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: braces around
>> >> scalar initializer [enabled by default]
>> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near
>> >> initialization for 'vesafb_defined.colorspace') [enabled by default]
>> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: excess elements in
>> >> scalar initializer [enabled by default]
>> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near
>> >> initialization for 'vesafb_defined.colorspace') [enabled by default]
>> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: braces around
>> >> scalar initializer [enabled by default]
>> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near
>> >> initialization for 'matroxfb_dh_defined.colorspace') [enabled by
>> >> default]
>> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: excess elements in
>> >> scalar initializer [enabled by default]
>> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near
>> >> initialization for 'matroxfb_dh_defined.colorspace') [enabled by
>> >> default]
>> >>
>> >> Introduced by commit fb21c2f42879 ("fbdev: Add FOURCC-based format
>> >> configuration API").
>> >
>> > The following patch should fix the issue. Florian, are you fine with it,
>> > or would you rather modify the initializers to be name-based ?
>> >
>> > From 078987fc14dba806fc1bc628e3e5c371db3cf1b8 Mon Sep 17 00:00:00 2001
>> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> > Date: Tue, 20 Dec 2011 11:30:53 +0100
>> > Subject: [PATCH] fbdev: matroxfb: Fix compilation after fb_var_screeninfo
>> > change
>> >
>> > Commit fb21c2f42879 ("fbdev: Add FOURCC-based format configuration API")
>> > modified the layout of the fb_var_screeninfo structure. Update the
>> > static initializers in the matroxfb driver accordingly.
>> >
>> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> > ---
>> >  drivers/video/matrox/matroxfb_base.c  |    2 +-
>> >  drivers/video/matrox/matroxfb_crtc2.c |    2 +-
>> >  2 files changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/video/matrox/matroxfb_base.c
>> > b/drivers/video/matrox/matroxfb_base.c index 44bf8d4..f98aad5 100644
>> > --- a/drivers/video/matrox/matroxfb_base.c
>> > +++ b/drivers/video/matrox/matroxfb_base.c
>> > @@ -147,7 +147,7 @@ static struct fb_var_screeninfo vesafb_defined = {
>> >        39721L,48L,16L,33L,10L,
>> >        96L,2L,~0,      /* No sync info */
>> >        FB_VMODE_NONINTERLACED,
>> > -       0, {0,0,0,0,0}
>> > +       0, 0, {0,0,0,0}
>>
>> All these zeroes should not be specified, the compiler will do the
>> right thing for
>> static variables anyway.
>>
>> Else they have to be updated manually everytime one of the reserved fields
>> is consumed for a new feature.
>
> I agree. Should I just remove them, or switch the structures to named
> initializers while I'm at it ?

I would just remove them. What do they buy you?

Even with named initializers

    .reserved = { 0, 0, 0, 0 }

will break once we consume one more reserved field, unless you write

    .reserved = { 0, }

to let the compiler handle it, but then you could just not specify the
field at all.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2011-12-20 13:48   ` Geert Uytterhoeven
@ 2011-12-20 15:19     ` Laurent Pinchart
  2011-12-20 15:24       ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Laurent Pinchart @ 2011-12-20 15:19 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Stephen Rothwell, Florian Tobias Schandinat, linux-fbdev,
	linux-next, linux-kernel

Hi Geert,

On Tuesday 20 December 2011 14:48:33 Geert Uytterhoeven wrote:
> On Tue, Dec 20, 2011 at 11:37, Laurent Pinchart wrote:
> > On Tuesday 20 December 2011 06:32:14 Stephen Rothwell wrote:
> >> After merging the fbdev tree, today's linux-next build (powerpc
> >> ppc64_defconfig) produced this warning:
> >> 
> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: braces around
> >> scalar initializer [enabled by default]
> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near
> >> initialization for 'vesafb_defined.colorspace') [enabled by default]
> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: excess elements in
> >> scalar initializer [enabled by default]
> >> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near
> >> initialization for 'vesafb_defined.colorspace') [enabled by default]
> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: braces around
> >> scalar initializer [enabled by default]
> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near
> >> initialization for 'matroxfb_dh_defined.colorspace') [enabled by
> >> default]
> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: excess elements in
> >> scalar initializer [enabled by default]
> >> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near
> >> initialization for 'matroxfb_dh_defined.colorspace') [enabled by
> >> default]
> >> 
> >> Introduced by commit fb21c2f42879 ("fbdev: Add FOURCC-based format
> >> configuration API").
> > 
> > The following patch should fix the issue. Florian, are you fine with it,
> > or would you rather modify the initializers to be name-based ?
> > 
> > From 078987fc14dba806fc1bc628e3e5c371db3cf1b8 Mon Sep 17 00:00:00 2001
> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Date: Tue, 20 Dec 2011 11:30:53 +0100
> > Subject: [PATCH] fbdev: matroxfb: Fix compilation after fb_var_screeninfo
> > change
> > 
> > Commit fb21c2f42879 ("fbdev: Add FOURCC-based format configuration API")
> > modified the layout of the fb_var_screeninfo structure. Update the
> > static initializers in the matroxfb driver accordingly.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  drivers/video/matrox/matroxfb_base.c  |    2 +-
> >  drivers/video/matrox/matroxfb_crtc2.c |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/video/matrox/matroxfb_base.c
> > b/drivers/video/matrox/matroxfb_base.c index 44bf8d4..f98aad5 100644
> > --- a/drivers/video/matrox/matroxfb_base.c
> > +++ b/drivers/video/matrox/matroxfb_base.c
> > @@ -147,7 +147,7 @@ static struct fb_var_screeninfo vesafb_defined = {
> >        39721L,48L,16L,33L,10L,
> >        96L,2L,~0,      /* No sync info */
> >        FB_VMODE_NONINTERLACED,
> > -       0, {0,0,0,0,0}
> > +       0, 0, {0,0,0,0}
> 
> All these zeroes should not be specified, the compiler will do the
> right thing for
> static variables anyway.
> 
> Else they have to be updated manually everytime one of the reserved fields
> is consumed for a new feature.

I agree. Should I just remove them, or switch the structures to named 
initializers while I'm at it ?

> >  };
> > 
> > 
> > diff --git a/drivers/video/matrox/matroxfb_crtc2.c
> > b/drivers/video/matrox/matroxfb_crtc2.c index d7112c3..d0c1abc 100644
> > --- a/drivers/video/matrox/matroxfb_crtc2.c
> > +++ b/drivers/video/matrox/matroxfb_crtc2.c
> > @@ -593,7 +593,7 @@ static struct fb_var_screeninfo matroxfb_dh_defined =
> > { 39721L,48L,16L,33L,10L,
> >                96L,2,0,        /* no sync info */
> >                FB_VMODE_NONINTERLACED,
> > -               0, {0,0,0,0,0}
> > +               0, 0, {0,0,0,0}
> 
> Same here.
> 
> >  };
> > 
> >  static int matroxfb_dh_regit(const struct matrox_fb_info *minfo,

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2011-12-20 10:37 ` Laurent Pinchart
@ 2011-12-20 13:48   ` Geert Uytterhoeven
  2011-12-20 15:19     ` Laurent Pinchart
  0 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2011-12-20 13:48 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Stephen Rothwell, Florian Tobias Schandinat, linux-fbdev,
	linux-next, linux-kernel

On Tue, Dec 20, 2011 at 11:37, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Tuesday 20 December 2011 06:32:14 Stephen Rothwell wrote:
>> After merging the fbdev tree, today's linux-next build (powerpc
>> ppc64_defconfig) produced this warning:
>>
>> drivers/video/matrox/matroxfb_base.c:150:2: warning: braces around scalar
>> initializer [enabled by default]
>> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near initialization
>> for 'vesafb_defined.colorspace') [enabled by default]
>> drivers/video/matrox/matroxfb_base.c:150:2: warning: excess elements in
>> scalar initializer [enabled by default]
>> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near initialization
>> for 'vesafb_defined.colorspace') [enabled by default]
>> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: braces around scalar
>> initializer [enabled by default]
>> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near initialization
>> for 'matroxfb_dh_defined.colorspace') [enabled by default]
>> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: excess elements in
>> scalar initializer [enabled by default]
>> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near initialization
>> for 'matroxfb_dh_defined.colorspace') [enabled by default]
>>
>> Introduced by commit fb21c2f42879 ("fbdev: Add FOURCC-based format
>> configuration API").
>
> The following patch should fix the issue. Florian, are you fine with it, or
> would you rather modify the initializers to be name-based ?
>
> From 078987fc14dba806fc1bc628e3e5c371db3cf1b8 Mon Sep 17 00:00:00 2001
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Date: Tue, 20 Dec 2011 11:30:53 +0100
> Subject: [PATCH] fbdev: matroxfb: Fix compilation after fb_var_screeninfo change
>
> Commit fb21c2f42879 ("fbdev: Add FOURCC-based format configuration API")
> modified the layout of the fb_var_screeninfo structure. Update the
> static initializers in the matroxfb driver accordingly.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/video/matrox/matroxfb_base.c  |    2 +-
>  drivers/video/matrox/matroxfb_crtc2.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
> index 44bf8d4..f98aad5 100644
> --- a/drivers/video/matrox/matroxfb_base.c
> +++ b/drivers/video/matrox/matroxfb_base.c
> @@ -147,7 +147,7 @@ static struct fb_var_screeninfo vesafb_defined = {
>        39721L,48L,16L,33L,10L,
>        96L,2L,~0,      /* No sync info */
>        FB_VMODE_NONINTERLACED,
> -       0, {0,0,0,0,0}
> +       0, 0, {0,0,0,0}

All these zeroes should not be specified, the compiler will do the
right thing for
static variables anyway.

Else they have to be updated manually everytime one of the reserved fields
is consumed for a new feature.

>  };
>
>
> diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
> index d7112c3..d0c1abc 100644
> --- a/drivers/video/matrox/matroxfb_crtc2.c
> +++ b/drivers/video/matrox/matroxfb_crtc2.c
> @@ -593,7 +593,7 @@ static struct fb_var_screeninfo matroxfb_dh_defined = {
>                39721L,48L,16L,33L,10L,
>                96L,2,0,        /* no sync info */
>                FB_VMODE_NONINTERLACED,
> -               0, {0,0,0,0,0}
> +               0, 0, {0,0,0,0}

Same here.

>  };
>
>  static int matroxfb_dh_regit(const struct matrox_fb_info *minfo,

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: linux-next: build warning after merge of the fbdev tree
  2011-12-20  5:32 Stephen Rothwell
@ 2011-12-20 10:37 ` Laurent Pinchart
  2011-12-20 13:48   ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Laurent Pinchart @ 2011-12-20 10:37 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Florian Tobias Schandinat, linux-fbdev, linux-next, linux-kernel

Hi Stephen,

On Tuesday 20 December 2011 06:32:14 Stephen Rothwell wrote:
> Hi all,
> 
> After merging the fbdev tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> drivers/video/matrox/matroxfb_base.c:150:2: warning: braces around scalar
> initializer [enabled by default]
> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near initialization
> for 'vesafb_defined.colorspace') [enabled by default]
> drivers/video/matrox/matroxfb_base.c:150:2: warning: excess elements in
> scalar initializer [enabled by default]
> drivers/video/matrox/matroxfb_base.c:150:2: warning: (near initialization
> for 'vesafb_defined.colorspace') [enabled by default]
> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: braces around scalar
> initializer [enabled by default]
> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near initialization
> for 'matroxfb_dh_defined.colorspace') [enabled by default]
> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: excess elements in
> scalar initializer [enabled by default]
> drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near initialization
> for 'matroxfb_dh_defined.colorspace') [enabled by default]
> 
> Introduced by commit fb21c2f42879 ("fbdev: Add FOURCC-based format
> configuration API").

The following patch should fix the issue. Florian, are you fine with it, or
would you rather modify the initializers to be name-based ?

>From 078987fc14dba806fc1bc628e3e5c371db3cf1b8 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Tue, 20 Dec 2011 11:30:53 +0100
Subject: [PATCH] fbdev: matroxfb: Fix compilation after fb_var_screeninfo change

Commit fb21c2f42879 ("fbdev: Add FOURCC-based format configuration API")
modified the layout of the fb_var_screeninfo structure. Update the
static initializers in the matroxfb driver accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/video/matrox/matroxfb_base.c  |    2 +-
 drivers/video/matrox/matroxfb_crtc2.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index 44bf8d4..f98aad5 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -147,7 +147,7 @@ static struct fb_var_screeninfo vesafb_defined = {
 	39721L,48L,16L,33L,10L,
 	96L,2L,~0,	/* No sync info */
 	FB_VMODE_NONINTERLACED,
-	0, {0,0,0,0,0}
+	0, 0, {0,0,0,0}
 };
 
 
diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
index d7112c3..d0c1abc 100644
--- a/drivers/video/matrox/matroxfb_crtc2.c
+++ b/drivers/video/matrox/matroxfb_crtc2.c
@@ -593,7 +593,7 @@ static struct fb_var_screeninfo matroxfb_dh_defined = {
 		39721L,48L,16L,33L,10L,
 		96L,2,0,	/* no sync info */
 		FB_VMODE_NONINTERLACED,
-		0, {0,0,0,0,0}
+		0, 0, {0,0,0,0}
 };
 
 static int matroxfb_dh_regit(const struct matrox_fb_info *minfo,
-- 
Regards,

Laurent Pinchart

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* linux-next: build warning after merge of the fbdev tree
@ 2011-12-20  5:32 Stephen Rothwell
  2011-12-20 10:37 ` Laurent Pinchart
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Rothwell @ 2011-12-20  5:32 UTC (permalink / raw)
  To: Florian Tobias Schandinat, linux-fbdev
  Cc: linux-next, linux-kernel, Laurent Pinchart

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]

Hi all,

After merging the fbdev tree, today's linux-next build (powerpc ppc64_defconfig)
produced this warning:

drivers/video/matrox/matroxfb_base.c:150:2: warning: braces around scalar initializer [enabled by default]
drivers/video/matrox/matroxfb_base.c:150:2: warning: (near initialization for 'vesafb_defined.colorspace') [enabled by default]
drivers/video/matrox/matroxfb_base.c:150:2: warning: excess elements in scalar initializer [enabled by default]
drivers/video/matrox/matroxfb_base.c:150:2: warning: (near initialization for 'vesafb_defined.colorspace') [enabled by default]
drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: braces around scalar initializer [enabled by default]
drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near initialization for 'matroxfb_dh_defined.colorspace') [enabled by default]
drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: excess elements in scalar initializer [enabled by default]
drivers/video/matrox/matroxfb_crtc2.c:596:3: warning: (near initialization for 'matroxfb_dh_defined.colorspace') [enabled by default]

Introduced by commit fb21c2f42879 ("fbdev: Add FOURCC-based format
configuration API").
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-11-15  5:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-15  0:20 linux-next: build warning after merge of the fbdev tree Stephen Rothwell
2022-11-15  5:20 ` Helge Deller
  -- strict thread matches above, loose matches on Subject: below --
2019-06-11  0:42 Stephen Rothwell
2019-04-01 22:30 Stephen Rothwell
2019-04-02 12:38 ` Tom Li
2019-04-02 15:16   ` Bartlomiej Zolnierkiewicz
2017-08-02  1:32 Stephen Rothwell
2011-12-20  5:32 Stephen Rothwell
2011-12-20 10:37 ` Laurent Pinchart
2011-12-20 13:48   ` Geert Uytterhoeven
2011-12-20 15:19     ` Laurent Pinchart
2011-12-20 15:24       ` Geert Uytterhoeven
2011-12-20 15:42         ` Laurent Pinchart
2011-12-20 15:48           ` Geert Uytterhoeven

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).