All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: wwan: t7xx: do not compile with -Werror by default
@ 2023-03-29 10:26 Jiri Slaby (SUSE)
  2023-03-31  6:27 ` Jakub Kicinski
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Slaby (SUSE) @ 2023-03-29 10:26 UTC (permalink / raw)
  To: kuba
  Cc: linux-kernel, Jiri Slaby (SUSE),
	Chandrashekar Devegowda, Intel Corporation, Chiranjeevi Rapolu,
	Liu Haijun, M Chetan Kumar, Ricardo Martinez, Loic Poulain,
	Sergey Ryazanov, Johannes Berg, David S. Miller, Eric Dumazet,
	Paolo Abeni, netdev

When playing with various compilers or their versions, some choke on
the t7xx code. For example (with gcc 13):
 In file included from ./arch/s390/include/generated/asm/rwonce.h:1,
                  from ../include/linux/compiler.h:247,
                  from ../include/linux/build_bug.h:5,
                  from ../include/linux/bits.h:22,
                  from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17:
 In function 'preempt_count',
     inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43:
 ../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=]

There is no reason for any code in the kernel to be built with -Werror
by default. Note that we have generic CONFIG_WERROR. OTOH, some drivers
may want to do this only on per-driver basis. Some do
CONFIG_DRM_I915_WERROR or alike. But I reused the scsi's:
  ifdef WARNINGS_BECOME_ERRORS
approach.

Now, if one wants to build t7xx with -Werror, they may say:
  make WARNINGS_BECOME_ERRORS=1

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
Cc: Intel Corporation <linuxwwan@intel.com>
Cc: Chiranjeevi Rapolu <chiranjeevi.rapolu@linux.intel.com>
Cc: Liu Haijun <haijun.liu@mediatek.com>
Cc: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Cc: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Cc: Loic Poulain <loic.poulain@linaro.org>
Cc: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
---
 drivers/net/wwan/t7xx/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wwan/t7xx/Makefile b/drivers/net/wwan/t7xx/Makefile
index 268ff9e87e5b..29622c2c4533 100644
--- a/drivers/net/wwan/t7xx/Makefile
+++ b/drivers/net/wwan/t7xx/Makefile
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
+ifdef WARNINGS_BECOME_ERRORS
 ccflags-y += -Werror
+endif
 
 obj-${CONFIG_MTK_T7XX} := mtk_t7xx.o
 mtk_t7xx-y:=	t7xx_pci.o \
-- 
2.40.0


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

* Re: [PATCH] net: wwan: t7xx: do not compile with -Werror by default
  2023-03-29 10:26 [PATCH] net: wwan: t7xx: do not compile with -Werror by default Jiri Slaby (SUSE)
@ 2023-03-31  6:27 ` Jakub Kicinski
  2023-03-31  6:35   ` [PATCH] net: wwan: t7xx: do not compile with -Werror Jiri Slaby (SUSE)
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2023-03-31  6:27 UTC (permalink / raw)
  To: Jiri Slaby (SUSE)
  Cc: linux-kernel, Chandrashekar Devegowda, Intel Corporation,
	Chiranjeevi Rapolu, Liu Haijun, M Chetan Kumar, Ricardo Martinez,
	Loic Poulain, Sergey Ryazanov, Johannes Berg, David S. Miller,
	Eric Dumazet, Paolo Abeni, netdev

On Wed, 29 Mar 2023 12:26:39 +0200 Jiri Slaby (SUSE) wrote:
> There is no reason for any code in the kernel to be built with -Werror
> by default. Note that we have generic CONFIG_WERROR. OTOH, some drivers
> may want to do this only on per-driver basis. Some do
> CONFIG_DRM_I915_WERROR or alike. But I reused the scsi's:
>   ifdef WARNINGS_BECOME_ERRORS
> approach.
> 
> Now, if one wants to build t7xx with -Werror, they may say:
>   make WARNINGS_BECOME_ERRORS=1

As you said we have CONFIG_WERROR now, so I'd vote to delete 
that line completely.

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

* [PATCH] net: wwan: t7xx: do not compile with -Werror
  2023-03-31  6:27 ` Jakub Kicinski
@ 2023-03-31  6:35   ` Jiri Slaby (SUSE)
  2023-03-31  6:36     ` Jiri Slaby
  2023-03-31  8:40     ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: Jiri Slaby (SUSE) @ 2023-03-31  6:35 UTC (permalink / raw)
  To: kuba
  Cc: linux-kernel, Jiri Slaby (SUSE),
	Chandrashekar Devegowda, Intel Corporation, Chiranjeevi Rapolu,
	Liu Haijun, M Chetan Kumar, Ricardo Martinez, Loic Poulain,
	Sergey Ryazanov, Johannes Berg, David S. Miller, Eric Dumazet,
	Paolo Abeni, netdev

When playing with various compilers or their versions, some choke on
the t7xx code. For example (with gcc 13):
 In file included from ./arch/s390/include/generated/asm/rwonce.h:1,
                  from ../include/linux/compiler.h:247,
                  from ../include/linux/build_bug.h:5,
                  from ../include/linux/bits.h:22,
                  from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17:
 In function 'preempt_count',
     inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43:
 ../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=]

There is no reason for any code in the kernel to be built with -Werror
by default. Note that we have generic CONFIG_WERROR. So if anyone wants
-Werror, they can enable that.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/all/20230330232717.1f8bf5ea@kernel.org/
Cc: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
Cc: Intel Corporation <linuxwwan@intel.com>
Cc: Chiranjeevi Rapolu <chiranjeevi.rapolu@linux.intel.com>
Cc: Liu Haijun <haijun.liu@mediatek.com>
Cc: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Cc: Ricardo Martinez <ricardo.martinez@linux.intel.com>
Cc: Loic Poulain <loic.poulain@linaro.org>
Cc: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
---

Notes:
    [v2] delete the line completely

 drivers/net/wwan/t7xx/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wwan/t7xx/Makefile b/drivers/net/wwan/t7xx/Makefile
index 268ff9e87e5b..2652cd00504e 100644
--- a/drivers/net/wwan/t7xx/Makefile
+++ b/drivers/net/wwan/t7xx/Makefile
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-ccflags-y += -Werror
-
 obj-${CONFIG_MTK_T7XX} := mtk_t7xx.o
 mtk_t7xx-y:=	t7xx_pci.o \
 		t7xx_pcie_mac.o \
-- 
2.40.0


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

* Re: [PATCH] net: wwan: t7xx: do not compile with -Werror
  2023-03-31  6:35   ` [PATCH] net: wwan: t7xx: do not compile with -Werror Jiri Slaby (SUSE)
@ 2023-03-31  6:36     ` Jiri Slaby
  2023-03-31  6:51       ` Jakub Kicinski
  2023-03-31  8:40     ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2023-03-31  6:36 UTC (permalink / raw)
  To: kuba
  Cc: linux-kernel, Chandrashekar Devegowda, Intel Corporation,
	Chiranjeevi Rapolu, Liu Haijun, M Chetan Kumar, Ricardo Martinez,
	Loic Poulain, Sergey Ryazanov, Johannes Berg, David S. Miller,
	Eric Dumazet, Paolo Abeni, netdev

It should have been [PATCH v2] in the subject. Do you want me to resend?

On 31. 03. 23, 8:35, Jiri Slaby (SUSE) wrote:
> When playing with various compilers or their versions, some choke on
> the t7xx code. For example (with gcc 13):
>   In file included from ./arch/s390/include/generated/asm/rwonce.h:1,
>                    from ../include/linux/compiler.h:247,
>                    from ../include/linux/build_bug.h:5,
>                    from ../include/linux/bits.h:22,
>                    from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17:
>   In function 'preempt_count',
>       inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43:
>   ../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=]
> 
> There is no reason for any code in the kernel to be built with -Werror
> by default. Note that we have generic CONFIG_WERROR. So if anyone wants
> -Werror, they can enable that.
> 
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> Link: https://lore.kernel.org/all/20230330232717.1f8bf5ea@kernel.org/
> Cc: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
> Cc: Intel Corporation <linuxwwan@intel.com>
> Cc: Chiranjeevi Rapolu <chiranjeevi.rapolu@linux.intel.com>
> Cc: Liu Haijun <haijun.liu@mediatek.com>
> Cc: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
> Cc: Ricardo Martinez <ricardo.martinez@linux.intel.com>
> Cc: Loic Poulain <loic.poulain@linaro.org>
> Cc: Sergey Ryazanov <ryazanov.s.a@gmail.com>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: netdev@vger.kernel.org
> ---
> 
> Notes:
>      [v2] delete the line completely
> 
>   drivers/net/wwan/t7xx/Makefile | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/wwan/t7xx/Makefile b/drivers/net/wwan/t7xx/Makefile
> index 268ff9e87e5b..2652cd00504e 100644
> --- a/drivers/net/wwan/t7xx/Makefile
> +++ b/drivers/net/wwan/t7xx/Makefile
> @@ -1,7 +1,5 @@
>   # SPDX-License-Identifier: GPL-2.0-only
>   
> -ccflags-y += -Werror
> -
>   obj-${CONFIG_MTK_T7XX} := mtk_t7xx.o
>   mtk_t7xx-y:=	t7xx_pci.o \
>   		t7xx_pcie_mac.o \

-- 
js


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

* Re: [PATCH] net: wwan: t7xx: do not compile with -Werror
  2023-03-31  6:36     ` Jiri Slaby
@ 2023-03-31  6:51       ` Jakub Kicinski
  0 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2023-03-31  6:51 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: linux-kernel, Chandrashekar Devegowda, Intel Corporation,
	Chiranjeevi Rapolu, Liu Haijun, M Chetan Kumar, Ricardo Martinez,
	Loic Poulain, Sergey Ryazanov, Johannes Berg, David S. Miller,
	Eric Dumazet, Paolo Abeni, netdev

On Fri, 31 Mar 2023 08:36:06 +0200 Jiri Slaby wrote:
> It should have been [PATCH v2] in the subject. Do you want me to resend?

It's fine confusing seems unlikely, thanks for respining!

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

* Re: [PATCH] net: wwan: t7xx: do not compile with -Werror
  2023-03-31  6:35   ` [PATCH] net: wwan: t7xx: do not compile with -Werror Jiri Slaby (SUSE)
  2023-03-31  6:36     ` Jiri Slaby
@ 2023-03-31  8:40     ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-31  8:40 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: kuba, linux-kernel, chandrashekar.devegowda, linuxwwan,
	chiranjeevi.rapolu, haijun.liu, m.chetan.kumar, ricardo.martinez,
	loic.poulain, ryazanov.s.a, johannes, davem, edumazet, pabeni,
	netdev

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 31 Mar 2023 08:35:15 +0200 you wrote:
> When playing with various compilers or their versions, some choke on
> the t7xx code. For example (with gcc 13):
>  In file included from ./arch/s390/include/generated/asm/rwonce.h:1,
>                   from ../include/linux/compiler.h:247,
>                   from ../include/linux/build_bug.h:5,
>                   from ../include/linux/bits.h:22,
>                   from ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:17:
>  In function 'preempt_count',
>      inlined from 't7xx_fsm_append_event' at ../drivers/net/wwan/t7xx/t7xx_state_monitor.c:439:43:
>  ../include/asm-generic/rwonce.h:44:26: error: array subscript 0 is outside array bounds of 'const volatile int[0]' [-Werror=array-bounds=]
> 
> [...]

Here is the summary with links:
  - net: wwan: t7xx: do not compile with -Werror
    https://git.kernel.org/netdev/net/c/362f0b6678ad

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-03-31  8:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29 10:26 [PATCH] net: wwan: t7xx: do not compile with -Werror by default Jiri Slaby (SUSE)
2023-03-31  6:27 ` Jakub Kicinski
2023-03-31  6:35   ` [PATCH] net: wwan: t7xx: do not compile with -Werror Jiri Slaby (SUSE)
2023-03-31  6:36     ` Jiri Slaby
2023-03-31  6:51       ` Jakub Kicinski
2023-03-31  8:40     ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.