2019-08-05 02:15:18

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH] sh: Drop -Werror from kernel Makefile

Since commit a035d552a93b ("Makefile: Globally enable fall-through
warning"), all sh builds fail with errors such as

arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through

Since this effectively disables all build and boot tests for the
architecture, let's drop -Werror from the sh kernel Makefile until
the problems are fixed.

Cc: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
---
arch/sh/kernel/Makefile | 2 --
1 file changed, 2 deletions(-)

diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index 59673f8a3379..ef65f0625c6c 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -47,5 +47,3 @@ obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
obj-$(CONFIG_DMA_NONCOHERENT) += dma-coherent.o
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
-
-ccflags-y := -Werror
--
2.7.4


2019-08-05 03:27:21

by Rich Felker

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

On Sun, Aug 04, 2019 at 07:14:23PM -0700, Guenter Roeck wrote:
> Since commit a035d552a93b ("Makefile: Globally enable fall-through
> warning"), all sh builds fail with errors such as
>
> arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
> arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
>
> Since this effectively disables all build and boot tests for the
> architecture, let's drop -Werror from the sh kernel Makefile until
> the problems are fixed.
>
> Cc: Gustavo A. R. Silva <[email protected]>
> Signed-off-by: Guenter Roeck <[email protected]>

Acked-by: Rich Felker <[email protected]>

> ---
> arch/sh/kernel/Makefile | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
> index 59673f8a3379..ef65f0625c6c 100644
> --- a/arch/sh/kernel/Makefile
> +++ b/arch/sh/kernel/Makefile
> @@ -47,5 +47,3 @@ obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
> obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
> obj-$(CONFIG_DMA_NONCOHERENT) += dma-coherent.o
> obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
> -
> -ccflags-y := -Werror
> --
> 2.7.4

2019-08-09 19:57:27

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

On Sun, Aug 04, 2019 at 11:24:41PM -0400, Rich Felker wrote:
> On Sun, Aug 04, 2019 at 07:14:23PM -0700, Guenter Roeck wrote:
> > Since commit a035d552a93b ("Makefile: Globally enable fall-through
> > warning"), all sh builds fail with errors such as
> >
> > arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
> > arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
> >
> > Since this effectively disables all build and boot tests for the
> > architecture, let's drop -Werror from the sh kernel Makefile until
> > the problems are fixed.
> >
> > Cc: Gustavo A. R. Silva <[email protected]>
> > Signed-off-by: Guenter Roeck <[email protected]>
>
> Acked-by: Rich Felker <[email protected]>
>
Any chance to get this or a similar patch applied soon ? All sh builds
in mainline and -next are still broken.

Thanks,
Guenter

> > ---
> > arch/sh/kernel/Makefile | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
> > index 59673f8a3379..ef65f0625c6c 100644
> > --- a/arch/sh/kernel/Makefile
> > +++ b/arch/sh/kernel/Makefile
> > @@ -47,5 +47,3 @@ obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
> > obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
> > obj-$(CONFIG_DMA_NONCOHERENT) += dma-coherent.o
> > obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
> > -
> > -ccflags-y := -Werror
> > --
> > 2.7.4

2019-08-09 21:37:34

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

Hi Guenter,

On 8/9/19 2:56 PM, Guenter Roeck wrote:
> On Sun, Aug 04, 2019 at 11:24:41PM -0400, Rich Felker wrote:
>> On Sun, Aug 04, 2019 at 07:14:23PM -0700, Guenter Roeck wrote:
>>> Since commit a035d552a93b ("Makefile: Globally enable fall-through
>>> warning"), all sh builds fail with errors such as
>>>
>>> arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
>>> arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
>>>
>>> Since this effectively disables all build and boot tests for the
>>> architecture, let's drop -Werror from the sh kernel Makefile until
>>> the problems are fixed.
>>>
>>> Cc: Gustavo A. R. Silva <[email protected]>
>>> Signed-off-by: Guenter Roeck <[email protected]>
>>
>> Acked-by: Rich Felker <[email protected]>
>>
> Any chance to get this or a similar patch applied soon ? All sh builds
> in mainline and -next are still broken.
>

If no one cares, I can add it to my tree and include it in my pull-request
for 5.3-rc4.

I would just need your Tested-by.

Thanks
--
Gustavo

> Thanks,
> Guenter
>
>>> ---
>>> arch/sh/kernel/Makefile | 2 --
>>> 1 file changed, 2 deletions(-)
>>>
>>> diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
>>> index 59673f8a3379..ef65f0625c6c 100644
>>> --- a/arch/sh/kernel/Makefile
>>> +++ b/arch/sh/kernel/Makefile
>>> @@ -47,5 +47,3 @@ obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
>>> obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
>>> obj-$(CONFIG_DMA_NONCOHERENT) += dma-coherent.o
>>> obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
>>> -
>>> -ccflags-y := -Werror
>>> --
>>> 2.7.4

2019-08-09 21:57:27

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

On Fri, Aug 09, 2019 at 04:36:01PM -0500, Gustavo A. R. Silva wrote:
> Hi Guenter,
>
> On 8/9/19 2:56 PM, Guenter Roeck wrote:
> > On Sun, Aug 04, 2019 at 11:24:41PM -0400, Rich Felker wrote:
> >> On Sun, Aug 04, 2019 at 07:14:23PM -0700, Guenter Roeck wrote:
> >>> Since commit a035d552a93b ("Makefile: Globally enable fall-through
> >>> warning"), all sh builds fail with errors such as
> >>>
> >>> arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
> >>> arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
> >>>
> >>> Since this effectively disables all build and boot tests for the
> >>> architecture, let's drop -Werror from the sh kernel Makefile until
> >>> the problems are fixed.
> >>>
> >>> Cc: Gustavo A. R. Silva <[email protected]>
> >>> Signed-off-by: Guenter Roeck <[email protected]>
> >>
> >> Acked-by: Rich Felker <[email protected]>
> >>
> > Any chance to get this or a similar patch applied soon ? All sh builds
> > in mainline and -next are still broken.
> >
>
> If no one cares, I can add it to my tree and include it in my pull-request
> for 5.3-rc4.
>
> I would just need your Tested-by.
>

Sure:

Tested-by: Guenter Roeck <[email protected]>

[ Applied to ToT and built sh:{defconfig,allnoconfig,tinyconfig} ]

Thanks,
Guenter

> Thanks
> --
> Gustavo
>
> > Thanks,
> > Guenter
> >
> >>> ---
> >>> arch/sh/kernel/Makefile | 2 --
> >>> 1 file changed, 2 deletions(-)
> >>>
> >>> diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
> >>> index 59673f8a3379..ef65f0625c6c 100644
> >>> --- a/arch/sh/kernel/Makefile
> >>> +++ b/arch/sh/kernel/Makefile
> >>> @@ -47,5 +47,3 @@ obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
> >>> obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
> >>> obj-$(CONFIG_DMA_NONCOHERENT) += dma-coherent.o
> >>> obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
> >>> -
> >>> -ccflags-y := -Werror
> >>> --
> >>> 2.7.4

2019-08-10 02:52:49

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

Guenter,

On 8/9/19 4:56 PM, Guenter Roeck wrote:
> On Fri, Aug 09, 2019 at 04:36:01PM -0500, Gustavo A. R. Silva wrote:
>> Hi Guenter,
>>
>> On 8/9/19 2:56 PM, Guenter Roeck wrote:
>>> On Sun, Aug 04, 2019 at 11:24:41PM -0400, Rich Felker wrote:
>>>> On Sun, Aug 04, 2019 at 07:14:23PM -0700, Guenter Roeck wrote:
>>>>> Since commit a035d552a93b ("Makefile: Globally enable fall-through
>>>>> warning"), all sh builds fail with errors such as
>>>>>
>>>>> arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
>>>>> arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
>>>>>
>>>>> Since this effectively disables all build and boot tests for the
>>>>> architecture, let's drop -Werror from the sh kernel Makefile until
>>>>> the problems are fixed.
>>>>>
>>>>> Cc: Gustavo A. R. Silva <[email protected]>
>>>>> Signed-off-by: Guenter Roeck <[email protected]>
>>>>
>>>> Acked-by: Rich Felker <[email protected]>
>>>>
>>> Any chance to get this or a similar patch applied soon ? All sh builds
>>> in mainline and -next are still broken.
>>>
>>
>> If no one cares, I can add it to my tree and include it in my pull-request
>> for 5.3-rc4.
>>
>> I would just need your Tested-by.
>>
>
> Sure:
>
> Tested-by: Guenter Roeck <[email protected]>
>
> [ Applied to ToT and built sh:{defconfig,allnoconfig,tinyconfig} ]
>

On second thought it seems to me that this is not a good idea, at least
for mainline. For the time being I'll take this patch for linux-next only.

Who is the maintainer of sh?

The best solution is to fix those fall-through warnings you see. Could you
please send me all the warnings you see? I can try to fix them.

Thanks!
--
Gustavo

2019-08-10 04:22:10

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

On Fri, 2019-08-09 at 21:47 -0500, Gustavo A. R. Silva wrote:
> On 8/9/19 4:56 PM, Guenter Roeck wrote:
> > On Fri, Aug 09, 2019 at 04:36:01PM -0500, Gustavo A. R. Silva wrote:
> > > On 8/9/19 2:56 PM, Guenter Roeck wrote:
> > > > On Sun, Aug 04, 2019 at 11:24:41PM -0400, Rich Felker wrote:
> > > > > On Sun, Aug 04, 2019 at 07:14:23PM -0700, Guenter Roeck wrote:
> > > > > > Since commit a035d552a93b ("Makefile: Globally enable fall-through
> > > > > > warning"), all sh builds fail with errors such as
> > > > > >
> > > > > > arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
> > > > > > arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
> > > > > >
> > > > > > Since this effectively disables all build and boot tests for the
> > > > > > architecture, let's drop -Werror from the sh kernel Makefile until
> > > > > > the problems are fixed.
[]
> On second thought it seems to me that this is not a good idea, at least
> for mainline. For the time being I'll take this patch for linux-next only.
>
> Who is the maintainer of sh?

But whoever it may be, isn't particularly active.

MAINTAINERS-SUPERH
MAINTAINERS-M: Yoshinori Sato <[email protected]>
MAINTAINERS-M: Rich Felker <[email protected]>
MAINTAINERS-L: [email protected]
MAINTAINERS-Q: http://patchwork.kernel.org/project/linux-sh/list/
MAINTAINERS-S: Maintained
MAINTAINERS-F: Documentation/sh/
MAINTAINERS:F: arch/sh/
MAINTAINERS-F: drivers/sh/

> The best solution is to fix those fall-through warnings you see. Could you
> please send me all the warnings you see? I can try to fix them.

It's true it's a warning, but adding -Werror is rarely
a good idea as gcc error output can change with every
version.


2019-08-10 04:34:13

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile



On 8/9/19 11:20 PM, Joe Perches wrote:
> On Fri, 2019-08-09 at 21:47 -0500, Gustavo A. R. Silva wrote:
>> On 8/9/19 4:56 PM, Guenter Roeck wrote:
>>> On Fri, Aug 09, 2019 at 04:36:01PM -0500, Gustavo A. R. Silva wrote:
>>>> On 8/9/19 2:56 PM, Guenter Roeck wrote:
>>>>> On Sun, Aug 04, 2019 at 11:24:41PM -0400, Rich Felker wrote:
>>>>>> On Sun, Aug 04, 2019 at 07:14:23PM -0700, Guenter Roeck wrote:
>>>>>>> Since commit a035d552a93b ("Makefile: Globally enable fall-through
>>>>>>> warning"), all sh builds fail with errors such as
>>>>>>>
>>>>>>> arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
>>>>>>> arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
>>>>>>>
>>>>>>> Since this effectively disables all build and boot tests for the
>>>>>>> architecture, let's drop -Werror from the sh kernel Makefile until
>>>>>>> the problems are fixed.
> []
>> On second thought it seems to me that this is not a good idea, at least
>> for mainline. For the time being I'll take this patch for linux-next only.
>>
>> Who is the maintainer of sh?
>
> But whoever it may be, isn't particularly active.
>
> MAINTAINERS-SUPERH
> MAINTAINERS-M: Yoshinori Sato <[email protected]>
> MAINTAINERS-M: Rich Felker <[email protected]>
> MAINTAINERS-L: [email protected]
> MAINTAINERS-Q: http://patchwork.kernel.org/project/linux-sh/list/
> MAINTAINERS-S: Maintained
> MAINTAINERS-F: Documentation/sh/
> MAINTAINERS:F: arch/sh/
> MAINTAINERS-F: drivers/sh/
>
>> The best solution is to fix those fall-through warnings you see. Could you
>> please send me all the warnings you see? I can try to fix them.
>
> It's true it's a warning, but adding -Werror is rarely
> a good idea as gcc error output can change with every
> version.
>

In the meantime I'll install sh4 and fix those warnings.

--
Gustavo

2019-08-10 04:45:03

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile



On 8/9/19 11:31 PM, Gustavo A. R. Silva wrote:
>
>
> On 8/9/19 11:20 PM, Joe Perches wrote:
>> On Fri, 2019-08-09 at 21:47 -0500, Gustavo A. R. Silva wrote:
>>> On 8/9/19 4:56 PM, Guenter Roeck wrote:
>>>> On Fri, Aug 09, 2019 at 04:36:01PM -0500, Gustavo A. R. Silva wrote:
>>>>> On 8/9/19 2:56 PM, Guenter Roeck wrote:
>>>>>> On Sun, Aug 04, 2019 at 11:24:41PM -0400, Rich Felker wrote:
>>>>>>> On Sun, Aug 04, 2019 at 07:14:23PM -0700, Guenter Roeck wrote:
>>>>>>>> Since commit a035d552a93b ("Makefile: Globally enable fall-through
>>>>>>>> warning"), all sh builds fail with errors such as
>>>>>>>>
>>>>>>>> arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
>>>>>>>> arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
>>>>>>>>
>>>>>>>> Since this effectively disables all build and boot tests for the
>>>>>>>> architecture, let's drop -Werror from the sh kernel Makefile until
>>>>>>>> the problems are fixed.
>> []
>>> On second thought it seems to me that this is not a good idea, at least
>>> for mainline. For the time being I'll take this patch for linux-next only.
>>>
>>> Who is the maintainer of sh?
>>
>> But whoever it may be, isn't particularly active.
>>
>> MAINTAINERS-SUPERH
>> MAINTAINERS-M: Yoshinori Sato <[email protected]>
>> MAINTAINERS-M: Rich Felker <[email protected]>
>> MAINTAINERS-L: [email protected]
>> MAINTAINERS-Q: http://patchwork.kernel.org/project/linux-sh/list/
>> MAINTAINERS-S: Maintained
>> MAINTAINERS-F: Documentation/sh/
>> MAINTAINERS:F: arch/sh/
>> MAINTAINERS-F: drivers/sh/
>>
>>> The best solution is to fix those fall-through warnings you see. Could you
>>> please send me all the warnings you see? I can try to fix them.
>>
>> It's true it's a warning, but adding -Werror is rarely
>> a good idea as gcc error output can change with every
>> version.
>>
>
> In the meantime I'll install sh4 and fix those warnings.
>

Well, I think it has paid off. It seems there is an ancient bug right there:

diff --git a/arch/sh/kernel/hw_breakpoint.c b/arch/sh/kernel/hw_breakpoint.c
index 3bd010b4c55f..f10d64311127 100644
--- a/arch/sh/kernel/hw_breakpoint.c
+++ b/arch/sh/kernel/hw_breakpoint.c
@@ -157,6 +157,7 @@ int arch_bp_generic_fields(int sh_len, int sh_type,
switch (sh_type) {
case SH_BREAKPOINT_READ:
*gen_type = HW_BREAKPOINT_R;
+ break;
case SH_BREAKPOINT_WRITE:
*gen_type = HW_BREAKPOINT_W;
break;

--
Gustavo

2019-08-13 10:33:36

by Yoshinori Sato

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

On Mon, 05 Aug 2019 11:14:23 +0900,
Guenter Roeck wrote:
>
> Since commit a035d552a93b ("Makefile: Globally enable fall-through
> warning"), all sh builds fail with errors such as
>
> arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
> arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
>
> Since this effectively disables all build and boot tests for the
> architecture, let's drop -Werror from the sh kernel Makefile until
> the problems are fixed.
>
> Cc: Gustavo A. R. Silva <[email protected]>
> Signed-off-by: Guenter Roeck <[email protected]>
> ---
> arch/sh/kernel/Makefile | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
> index 59673f8a3379..ef65f0625c6c 100644
> --- a/arch/sh/kernel/Makefile
> +++ b/arch/sh/kernel/Makefile
> @@ -47,5 +47,3 @@ obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
> obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
> obj-$(CONFIG_DMA_NONCOHERENT) += dma-coherent.o
> obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
> -
> -ccflags-y := -Werror
> --
> 2.7.4
>

Applied sh-next.
Sorry too late replay.

--
Yosinori Sato

2019-08-13 15:29:12

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

On 8/13/19 1:49 AM, Yoshinori Sato wrote:
> On Mon, 05 Aug 2019 11:14:23 +0900,
> Guenter Roeck wrote:
>>
>> Since commit a035d552a93b ("Makefile: Globally enable fall-through
>> warning"), all sh builds fail with errors such as
>>
>> arch/sh/kernel/disassemble.c: In function 'print_sh_insn':
>> arch/sh/kernel/disassemble.c:478:8: error: this statement may fall through
>>
>> Since this effectively disables all build and boot tests for the
>> architecture, let's drop -Werror from the sh kernel Makefile until
>> the problems are fixed.
>>
>> Cc: Gustavo A. R. Silva <[email protected]>
>> Signed-off-by: Guenter Roeck <[email protected]>
>> ---
>> arch/sh/kernel/Makefile | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
>> index 59673f8a3379..ef65f0625c6c 100644
>> --- a/arch/sh/kernel/Makefile
>> +++ b/arch/sh/kernel/Makefile
>> @@ -47,5 +47,3 @@ obj-$(CONFIG_DWARF_UNWINDER) += dwarf.o
>> obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_callchain.o
>> obj-$(CONFIG_DMA_NONCOHERENT) += dma-coherent.o
>> obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
>> -
>> -ccflags-y := -Werror
>> --
>> 2.7.4
>>
>
> Applied sh-next.
> Sorry too late replay.
>

Please note that _mainline_ builds are currently broken.

Guenter

2019-08-15 02:09:10

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

Guenter,

On 8/13/19 8:18 AM, Guenter Roeck wrote:
>
> Please note that _mainline_ builds are currently broken.
>

This should be fixed now:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=41de59634046b19cd53a1983594a95135c656997

Thanks
--
Gustavo

2019-08-15 03:42:47

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH] sh: Drop -Werror from kernel Makefile

On 8/14/19 5:59 PM, Gustavo A. R. Silva wrote:
> Guenter,
>
> On 8/13/19 8:18 AM, Guenter Roeck wrote:
>>
>> Please note that _mainline_ builds are currently broken.
>>
>
> This should be fixed now:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=41de59634046b19cd53a1983594a95135c656997
>

Yes, it is.

Thanks!

Guenter