linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: r8188eu: clean up the Makefile
@ 2021-10-16 17:35 Martin Kaiser
  2021-10-16 17:35 ` [PATCH 1/3] staging: r8188eu: Makefile: remove unused driver config Martin Kaiser
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Martin Kaiser @ 2021-10-16 17:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Clean up the Makefile, make it similar to other drivers.

Please apply this after the "staging: r8188eu: remove CONFIG_BT_COEXIST"
series.

Martin Kaiser (3):
  staging: r8188eu: Makefile: remove unused driver config
  staging: r8188eu: Makefile: don't overwrite global settings
  staging: r8188eu: Makefile: use one file list

 drivers/staging/r8188eu/Makefile | 146 ++++++++++++-------------------
 1 file changed, 55 insertions(+), 91 deletions(-)

-- 
2.20.1


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

* [PATCH 1/3] staging: r8188eu: Makefile: remove unused driver config
  2021-10-16 17:35 [PATCH 0/3] staging: r8188eu: clean up the Makefile Martin Kaiser
@ 2021-10-16 17:35 ` Martin Kaiser
  2021-10-17 12:15   ` Michael Straube
  2021-10-16 17:35 ` [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings Martin Kaiser
  2021-10-16 17:35 ` [PATCH 3/3] staging: r8188eu: Makefile: use one file list Martin Kaiser
  2 siblings, 1 reply; 11+ messages in thread
From: Martin Kaiser @ 2021-10-16 17:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Remove config settings from the Makefile that are related to
unused or deleted features.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/Makefile | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
index 1e0cb819f7f3..fccf7e6d1520 100644
--- a/drivers/staging/r8188eu/Makefile
+++ b/drivers/staging/r8188eu/Makefile
@@ -4,8 +4,6 @@ EXTRA_CFLAGS += -O1
 
 ccflags-y += -D__CHECK_ENDIAN__
 
-CONFIG_WOWLAN = n
-
 OUTSRC_FILES :=				\
 		hal/HalHWImg8188E_MAC.o	\
 		hal/HalHWImg8188E_BB.o	\
@@ -36,10 +34,6 @@ OUTSRC_FILES :=				\
 		hal/usb_halinit.o	\
 		hal/usb_ops_linux.o
 
-RTL871X = rtl8188e
-
-HCI_NAME = usb
-
 _OS_INTFS_FILES :=				\
 			os_dep/ioctl_linux.o	\
 			os_dep/mlme_linux.o	\
@@ -52,10 +46,6 @@ _OS_INTFS_FILES :=				\
 
 _HAL_INTFS_FILES += $(OUTSRC_FILES)
 
-ifeq ($(CONFIG_WOWLAN), y)
-EXTRA_CFLAGS += -DCONFIG_WOWLAN
-endif
-
 SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
 
 ARCH ?= $(SUBARCH)
-- 
2.20.1


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

* [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings
  2021-10-16 17:35 [PATCH 0/3] staging: r8188eu: clean up the Makefile Martin Kaiser
  2021-10-16 17:35 ` [PATCH 1/3] staging: r8188eu: Makefile: remove unused driver config Martin Kaiser
@ 2021-10-16 17:35 ` Martin Kaiser
  2021-10-17 12:18   ` Michael Straube
  2021-10-16 17:35 ` [PATCH 3/3] staging: r8188eu: Makefile: use one file list Martin Kaiser
  2 siblings, 1 reply; 11+ messages in thread
From: Martin Kaiser @ 2021-10-16 17:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Remove settings from the Makefile that are set by higher-level Makefiles.

Some of those settings might have been useful when the driver was
maintained out of tree.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/Makefile | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
index fccf7e6d1520..8294fb69ecf9 100644
--- a/drivers/staging/r8188eu/Makefile
+++ b/drivers/staging/r8188eu/Makefile
@@ -1,8 +1,3 @@
-SHELL := /bin/bash
-EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
-EXTRA_CFLAGS += -O1
-
-ccflags-y += -D__CHECK_ENDIAN__
 
 OUTSRC_FILES :=				\
 		hal/HalHWImg8188E_MAC.o	\
@@ -46,15 +41,6 @@ _OS_INTFS_FILES :=				\
 
 _HAL_INTFS_FILES += $(OUTSRC_FILES)
 
-SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
-
-ARCH ?= $(SUBARCH)
-CROSS_COMPILE ?=
-KVER  ?= $(if $(KERNELRELEASE),$(KERNELRELEASE),$(shell uname -r))
-KSRC ?= $(if $(KERNEL_SRC),$(KERNEL_SRC),/lib/modules/$(KVER)/build)
-MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless
-INSTALL_PREFIX :=
-
 rtk_core :=				\
 		core/rtw_ap.o		\
 		core/rtw_br_ext.o	\
-- 
2.20.1


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

* [PATCH 3/3] staging: r8188eu: Makefile: use one file list
  2021-10-16 17:35 [PATCH 0/3] staging: r8188eu: clean up the Makefile Martin Kaiser
  2021-10-16 17:35 ` [PATCH 1/3] staging: r8188eu: Makefile: remove unused driver config Martin Kaiser
  2021-10-16 17:35 ` [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings Martin Kaiser
@ 2021-10-16 17:35 ` Martin Kaiser
  2 siblings, 0 replies; 11+ messages in thread
From: Martin Kaiser @ 2021-10-16 17:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

It's enough to have a single list of source files. There are no config
settings for this driver that change the list of source files that
we compile.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/Makefile | 122 ++++++++++++++-----------------
 1 file changed, 55 insertions(+), 67 deletions(-)

diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
index 8294fb69ecf9..a0a8e150da3f 100644
--- a/drivers/staging/r8188eu/Makefile
+++ b/drivers/staging/r8188eu/Makefile
@@ -1,71 +1,59 @@
 
-OUTSRC_FILES :=				\
-		hal/HalHWImg8188E_MAC.o	\
-		hal/HalHWImg8188E_BB.o	\
-		hal/HalHWImg8188E_RF.o	\
-		hal/HalPhyRf_8188e.o	\
-		hal/HalPwrSeqCmd.o	\
-		hal/Hal8188EPwrSeq.o	\
-		hal/Hal8188ERateAdaptive.o\
-		hal/hal_intf.o		\
-		hal/hal_com.o		\
-		hal/odm.o		\
-		hal/odm_debug.o		\
-		hal/odm_interface.o	\
-		hal/odm_HWConfig.o	\
-		hal/odm_RegConfig8188E.o\
-		hal/odm_RTL8188E.o	\
-		hal/rtl8188e_cmd.o	\
-		hal/rtl8188e_dm.o	\
-		hal/rtl8188e_hal_init.o	\
-		hal/rtl8188e_phycfg.o	\
-		hal/rtl8188e_rf6052.o	\
-		hal/rtl8188e_rxdesc.o	\
-		hal/rtl8188e_sreset.o	\
-		hal/rtl8188e_xmit.o	\
-		hal/rtl8188eu_led.o	\
-		hal/rtl8188eu_recv.o	\
-		hal/rtl8188eu_xmit.o	\
-		hal/usb_halinit.o	\
-		hal/usb_ops_linux.o
-
-_OS_INTFS_FILES :=				\
-			os_dep/ioctl_linux.o	\
-			os_dep/mlme_linux.o	\
-			os_dep/os_intfs.o	\
-			os_dep/osdep_service.o	\
-			os_dep/recv_linux.o	\
-			os_dep/usb_intf.o	\
-			os_dep/usb_ops_linux.o	\
-			os_dep/xmit_linux.o
-
-_HAL_INTFS_FILES += $(OUTSRC_FILES)
-
-rtk_core :=				\
-		core/rtw_ap.o		\
-		core/rtw_br_ext.o	\
-		core/rtw_cmd.o		\
-		core/rtw_efuse.o	\
-		core/rtw_ieee80211.o	\
-		core/rtw_ioctl_set.o	\
-		core/rtw_iol.o		\
-		core/rtw_led.o		\
-		core/rtw_mlme.o		\
-		core/rtw_mlme_ext.o	\
-		core/rtw_pwrctrl.o	\
-		core/rtw_p2p.o		\
-		core/rtw_recv.o		\
-		core/rtw_rf.o		\
-		core/rtw_security.o	\
-		core/rtw_sreset.o	\
-		core/rtw_sta_mgt.o	\
-		core/rtw_wlan_util.o	\
+r8188eu-y = \
+		hal/HalHWImg8188E_MAC.o \
+		hal/HalHWImg8188E_BB.o \
+		hal/HalHWImg8188E_RF.o \
+		hal/HalPhyRf_8188e.o \
+		hal/HalPwrSeqCmd.o \
+		hal/Hal8188EPwrSeq.o \
+		hal/Hal8188ERateAdaptive.o \
+		hal/hal_intf.o \
+		hal/hal_com.o \
+		hal/odm.o \
+		hal/odm_debug.o \
+		hal/odm_interface.o \
+		hal/odm_HWConfig.o \
+		hal/odm_RegConfig8188E.o \
+		hal/odm_RTL8188E.o \
+		hal/rtl8188e_cmd.o \
+		hal/rtl8188e_dm.o \
+		hal/rtl8188e_hal_init.o \
+		hal/rtl8188e_phycfg.o \
+		hal/rtl8188e_rf6052.o \
+		hal/rtl8188e_rxdesc.o \
+		hal/rtl8188e_sreset.o \
+		hal/rtl8188e_xmit.o \
+		hal/rtl8188eu_led.o \
+		hal/rtl8188eu_recv.o \
+		hal/rtl8188eu_xmit.o \
+		hal/usb_halinit.o \
+		hal/usb_ops_linux.o \
+		os_dep/ioctl_linux.o \
+		os_dep/mlme_linux.o \
+		os_dep/os_intfs.o \
+		os_dep/osdep_service.o \
+		os_dep/recv_linux.o \
+		os_dep/usb_intf.o \
+		os_dep/usb_ops_linux.o \
+		os_dep/xmit_linux.o \
+		core/rtw_ap.o \
+		core/rtw_br_ext.o \
+		core/rtw_cmd.o \
+		core/rtw_efuse.o \
+		core/rtw_ieee80211.o \
+		core/rtw_ioctl_set.o \
+		core/rtw_iol.o \
+		core/rtw_led.o \
+		core/rtw_mlme.o \
+		core/rtw_mlme_ext.o \
+		core/rtw_pwrctrl.o \
+		core/rtw_p2p.o \
+		core/rtw_recv.o \
+		core/rtw_rf.o \
+		core/rtw_security.o \
+		core/rtw_sreset.o \
+		core/rtw_sta_mgt.o \
+		core/rtw_wlan_util.o \
 		core/rtw_xmit.o
 
-r8188eu-y += $(rtk_core)
-
-r8188eu-y += $(_HAL_INTFS_FILES)
-
-r8188eu-y += $(_OS_INTFS_FILES)
-
 obj-$(CONFIG_R8188EU) := r8188eu.o
-- 
2.20.1


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

* Re: [PATCH 1/3] staging: r8188eu: Makefile: remove unused driver config
  2021-10-16 17:35 ` [PATCH 1/3] staging: r8188eu: Makefile: remove unused driver config Martin Kaiser
@ 2021-10-17 12:15   ` Michael Straube
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Straube @ 2021-10-17 12:15 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, linux-staging, linux-kernel

On 10/16/21 19:35, Martin Kaiser wrote:
> Remove config settings from the Makefile that are related to
> unused or deleted features.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>   drivers/staging/r8188eu/Makefile | 10 ----------
>   1 file changed, 10 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
> index 1e0cb819f7f3..fccf7e6d1520 100644
> --- a/drivers/staging/r8188eu/Makefile
> +++ b/drivers/staging/r8188eu/Makefile
> @@ -4,8 +4,6 @@ EXTRA_CFLAGS += -O1
>   
>   ccflags-y += -D__CHECK_ENDIAN__
>   
> -CONFIG_WOWLAN = n
> -
>   OUTSRC_FILES :=				\
>   		hal/HalHWImg8188E_MAC.o	\
>   		hal/HalHWImg8188E_BB.o	\
> @@ -36,10 +34,6 @@ OUTSRC_FILES :=				\
>   		hal/usb_halinit.o	\
>   		hal/usb_ops_linux.o
>   
> -RTL871X = rtl8188e
> -
> -HCI_NAME = usb
> -
>   _OS_INTFS_FILES :=				\
>   			os_dep/ioctl_linux.o	\
>   			os_dep/mlme_linux.o	\
> @@ -52,10 +46,6 @@ _OS_INTFS_FILES :=				\
>   
>   _HAL_INTFS_FILES += $(OUTSRC_FILES)
>   
> -ifeq ($(CONFIG_WOWLAN), y)
> -EXTRA_CFLAGS += -DCONFIG_WOWLAN
> -endif
> -
>   SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
>   
>   ARCH ?= $(SUBARCH)
> 

Acked-by: Michael Straube <straube.linux@gmail.com>

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

* Re: [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings
  2021-10-16 17:35 ` [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings Martin Kaiser
@ 2021-10-17 12:18   ` Michael Straube
  2021-10-17 17:46     ` Martin Kaiser
  2021-10-18 14:46     ` Greg Kroah-Hartman
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Straube @ 2021-10-17 12:18 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, linux-staging, linux-kernel

On 10/16/21 19:35, Martin Kaiser wrote:
> Remove settings from the Makefile that are set by higher-level Makefiles.
> 
> Some of those settings might have been useful when the driver was
> maintained out of tree.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>   drivers/staging/r8188eu/Makefile | 14 --------------
>   1 file changed, 14 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
> index fccf7e6d1520..8294fb69ecf9 100644
> --- a/drivers/staging/r8188eu/Makefile
> +++ b/drivers/staging/r8188eu/Makefile
> @@ -1,8 +1,3 @@
> -SHELL := /bin/bash
> -EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
> -EXTRA_CFLAGS += -O1
> -
> -ccflags-y += -D__CHECK_ENDIAN__
>   
>   OUTSRC_FILES :=				\
>   		hal/HalHWImg8188E_MAC.o	\
> @@ -46,15 +41,6 @@ _OS_INTFS_FILES :=				\
>   
>   _HAL_INTFS_FILES += $(OUTSRC_FILES)
>   
> -SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
> -
> -ARCH ?= $(SUBARCH)
> -CROSS_COMPILE ?=
> -KVER  ?= $(if $(KERNELRELEASE),$(KERNELRELEASE),$(shell uname -r))
> -KSRC ?= $(if $(KERNEL_SRC),$(KERNEL_SRC),/lib/modules/$(KVER)/build)
> -MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless
> -INSTALL_PREFIX :=
> -
>   rtk_core :=				\
>   		core/rtw_ap.o		\
>   		core/rtw_br_ext.o	\
> 

Hi Martin, this patch introduces a GCC warning on my system.

drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function 
'rtw_wx_set_enc_ext':
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1929:9: warning: 'strncpy' 
specified bound 16 equals destination size [-Wstringop-truncation]
  1929 |         strncpy((char *)param->u.crypt.alg, alg_name, 
IEEE_CRYPT_ALG_NAME_LEN);
       | 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Regards,
Michael

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

* Re: [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings
  2021-10-17 12:18   ` Michael Straube
@ 2021-10-17 17:46     ` Martin Kaiser
  2021-10-17 20:46       ` Michael Straube
  2021-10-18 14:46     ` Greg Kroah-Hartman
  1 sibling, 1 reply; 11+ messages in thread
From: Martin Kaiser @ 2021-10-17 17:46 UTC (permalink / raw)
  To: Michael Straube
  Cc: Greg Kroah-Hartman, Larry Finger, Phillip Potter, linux-staging,
	linux-kernel

Thus wrote Michael Straube (straube.linux@gmail.com):

> On 10/16/21 19:35, Martin Kaiser wrote:
> > Remove settings from the Makefile that are set by higher-level Makefiles.

> > Some of those settings might have been useful when the driver was
> > maintained out of tree.

> > Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> > ---
> >   drivers/staging/r8188eu/Makefile | 14 --------------
> >   1 file changed, 14 deletions(-)

> > diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
> > index fccf7e6d1520..8294fb69ecf9 100644
> > --- a/drivers/staging/r8188eu/Makefile
> > +++ b/drivers/staging/r8188eu/Makefile
> > @@ -1,8 +1,3 @@
> > -SHELL := /bin/bash
> > -EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
> > -EXTRA_CFLAGS += -O1
> > -
> > -ccflags-y += -D__CHECK_ENDIAN__
> >   OUTSRC_FILES :=				\
> >   		hal/HalHWImg8188E_MAC.o	\
> > @@ -46,15 +41,6 @@ _OS_INTFS_FILES :=				\
> >   _HAL_INTFS_FILES += $(OUTSRC_FILES)
> > -SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
> > -
> > -ARCH ?= $(SUBARCH)
> > -CROSS_COMPILE ?=
> > -KVER  ?= $(if $(KERNELRELEASE),$(KERNELRELEASE),$(shell uname -r))
> > -KSRC ?= $(if $(KERNEL_SRC),$(KERNEL_SRC),/lib/modules/$(KVER)/build)
> > -MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless
> > -INSTALL_PREFIX :=
> > -
> >   rtk_core :=				\
> >   		core/rtw_ap.o		\
> >   		core/rtw_br_ext.o	\


> Hi Martin, this patch introduces a GCC warning on my system.

> drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function
> 'rtw_wx_set_enc_ext':
> drivers/staging/r8188eu/os_dep/ioctl_linux.c:1929:9: warning: 'strncpy'
> specified bound 16 equals destination size [-Wstringop-truncation]
>  1929 |         strncpy((char *)param->u.crypt.alg, alg_name,
> IEEE_CRYPT_ALG_NAME_LEN);
>       |


Hi Michael,

thanks for reporting this. So far, I can't reproduce the warning, even
if I enable -Wstringop-truncation explicitly. I tried this with gcc
8.3.0 (Debian buster) on x86_64.

Could you send me your complete compiler command line for this file
(make V=1)?

Maybe it's not ok to delete the EXTRA_CFLAGS. I guessed that the
optimisation level would be set by a higher-level Makefile...

Thanks,
Martin

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

* Re: [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings
  2021-10-17 17:46     ` Martin Kaiser
@ 2021-10-17 20:46       ` Michael Straube
  2021-10-18 14:52         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Straube @ 2021-10-17 20:46 UTC (permalink / raw)
  To: Martin Kaiser
  Cc: Greg Kroah-Hartman, Larry Finger, Phillip Potter, linux-staging,
	linux-kernel

On 10/17/21 19:46, Martin Kaiser wrote:
> Thus wrote Michael Straube (straube.linux@gmail.com):
> 
>> On 10/16/21 19:35, Martin Kaiser wrote:
>>> Remove settings from the Makefile that are set by higher-level Makefiles.
> 
>>> Some of those settings might have been useful when the driver was
>>> maintained out of tree.
> 
>>> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
>>> ---
>>>    drivers/staging/r8188eu/Makefile | 14 --------------
>>>    1 file changed, 14 deletions(-)
> 
>>> diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
>>> index fccf7e6d1520..8294fb69ecf9 100644
>>> --- a/drivers/staging/r8188eu/Makefile
>>> +++ b/drivers/staging/r8188eu/Makefile
>>> @@ -1,8 +1,3 @@
>>> -SHELL := /bin/bash
>>> -EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
>>> -EXTRA_CFLAGS += -O1
>>> -
>>> -ccflags-y += -D__CHECK_ENDIAN__
>>>    OUTSRC_FILES :=				\
>>>    		hal/HalHWImg8188E_MAC.o	\
>>> @@ -46,15 +41,6 @@ _OS_INTFS_FILES :=				\
>>>    _HAL_INTFS_FILES += $(OUTSRC_FILES)
>>> -SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
>>> -
>>> -ARCH ?= $(SUBARCH)
>>> -CROSS_COMPILE ?=
>>> -KVER  ?= $(if $(KERNELRELEASE),$(KERNELRELEASE),$(shell uname -r))
>>> -KSRC ?= $(if $(KERNEL_SRC),$(KERNEL_SRC),/lib/modules/$(KVER)/build)
>>> -MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless
>>> -INSTALL_PREFIX :=
>>> -
>>>    rtk_core :=				\
>>>    		core/rtw_ap.o		\
>>>    		core/rtw_br_ext.o	\
> 
> 
>> Hi Martin, this patch introduces a GCC warning on my system.
> 
>> drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function
>> 'rtw_wx_set_enc_ext':
>> drivers/staging/r8188eu/os_dep/ioctl_linux.c:1929:9: warning: 'strncpy'
>> specified bound 16 equals destination size [-Wstringop-truncation]
>>   1929 |         strncpy((char *)param->u.crypt.alg, alg_name,
>> IEEE_CRYPT_ALG_NAME_LEN);
>>        |
> 
> 
> Hi Michael,
> 
> thanks for reporting this. So far, I can't reproduce the warning, even
> if I enable -Wstringop-truncation explicitly. I tried this with gcc
> 8.3.0 (Debian buster) on x86_64.

Hi Martin,

probably only newer gcc versions produce this warning. On my system
the gcc version is 11.2.1 (openSUSE Tumbleweed).

> Could you send me your complete compiler command line for this file
> (make V=1)?
> 

See end of this mail.

> Maybe it's not ok to delete the EXTRA_CFLAGS. I guessed that the
> optimisation level would be set by a higher-level Makefile...
> 

The warning is gone when I add back EXTRA_CFLAGS += -O1

Best regards,
Michael


   gcc -Wp,-MMD,drivers/staging/r8188eu/os_dep/.ioctl_linux.o.d 
-nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/11/include 
-I./arch/x86/include -I./arch/x86/include/generated  -I./include 
-I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi 
-I./include/uapi -I./include/generated/uapi -include 
./include/linux/compiler-version.h -include ./include/linux/kconfig.h 
-include ./include/linux/compiler_types.h -D__KERNEL__ 
-fmacro-prefix-map=./= -DKBUILD_EXTRA_WARN1 -Wall -Wundef 
-Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing 
-fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration 
-Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 
-mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none 
-m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 
-mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic 
-mno-red-zone -mcmodel=kernel -Wno-sign-compare 
-fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern 
-mindirect-branch-register -fno-jump-tables 
-fno-delete-null-pointer-checks -Wno-frame-address 
-Wno-format-truncation -Wno-format-overflow 
-Wno-address-of-packed-member -O2 -fno-allow-store-data-races 
-Wframe-larger-than=2048 -fstack-protector-strong -Werror 
-Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable 
-Wno-unused-const-variable -fno-stack-clash-protection -g -gdwarf-4 -pg 
-mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement 
-Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds 
-Wno-array-bounds -Wno-stringop-overflow -Wno-restrict 
-Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check 
-fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types 
-Werror=designated-init -Wno-packed-not-aligned -Wextra -Wunused 
-Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute 
-Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs 
-Wunused-but-set-variable -Wunused-const-variable -Wpacked-not-aligned 
-Wstringop-truncation -Wno-missing-field-initializers -Wno-sign-compare 
-Wno-type-limits -Wno-error  -DMODULE  -DKBUILD_BASENAME='"ioctl_linux"' 
-DKBUILD_MODNAME='"r8188eu"' -D__KBUILD_MODNAME=kmod_r8188eu -c -o 
drivers/staging/r8188eu/os_dep/ioctl_linux.o 
drivers/staging/r8188eu/os_dep/ioctl_linux.c
drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function 
'rtw_wx_set_enc_ext':
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1929:9: warning: 'strncpy' 
specified bound 16 equals destination size [-Wstringop-truncation]
  1929 |         strncpy((char *)param->u.crypt.alg, alg_name, 
IEEE_CRYPT_ALG_NAME_LEN);
       | 
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

* Re: [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings
  2021-10-17 12:18   ` Michael Straube
  2021-10-17 17:46     ` Martin Kaiser
@ 2021-10-18 14:46     ` Greg Kroah-Hartman
  1 sibling, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-10-18 14:46 UTC (permalink / raw)
  To: Michael Straube
  Cc: Martin Kaiser, Larry Finger, Phillip Potter, linux-staging, linux-kernel

On Sun, Oct 17, 2021 at 02:18:30PM +0200, Michael Straube wrote:
> On 10/16/21 19:35, Martin Kaiser wrote:
> > Remove settings from the Makefile that are set by higher-level Makefiles.
> > 
> > Some of those settings might have been useful when the driver was
> > maintained out of tree.
> > 
> > Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> > ---
> >   drivers/staging/r8188eu/Makefile | 14 --------------
> >   1 file changed, 14 deletions(-)
> > 
> > diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
> > index fccf7e6d1520..8294fb69ecf9 100644
> > --- a/drivers/staging/r8188eu/Makefile
> > +++ b/drivers/staging/r8188eu/Makefile
> > @@ -1,8 +1,3 @@
> > -SHELL := /bin/bash
> > -EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
> > -EXTRA_CFLAGS += -O1
> > -
> > -ccflags-y += -D__CHECK_ENDIAN__
> >   OUTSRC_FILES :=				\
> >   		hal/HalHWImg8188E_MAC.o	\
> > @@ -46,15 +41,6 @@ _OS_INTFS_FILES :=				\
> >   _HAL_INTFS_FILES += $(OUTSRC_FILES)
> > -SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
> > -
> > -ARCH ?= $(SUBARCH)
> > -CROSS_COMPILE ?=
> > -KVER  ?= $(if $(KERNELRELEASE),$(KERNELRELEASE),$(shell uname -r))
> > -KSRC ?= $(if $(KERNEL_SRC),$(KERNEL_SRC),/lib/modules/$(KVER)/build)
> > -MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless
> > -INSTALL_PREFIX :=
> > -
> >   rtk_core :=				\
> >   		core/rtw_ap.o		\
> >   		core/rtw_br_ext.o	\
> > 
> 
> Hi Martin, this patch introduces a GCC warning on my system.
> 
> drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function
> 'rtw_wx_set_enc_ext':
> drivers/staging/r8188eu/os_dep/ioctl_linux.c:1929:9: warning: 'strncpy'
> specified bound 16 equals destination size [-Wstringop-truncation]
>  1929 |         strncpy((char *)param->u.crypt.alg, alg_name,
> IEEE_CRYPT_ALG_NAME_LEN);
>       |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As you all found out, that's due to the -O1 removal which was hiding
this mess :(

let me see if I can fix this up...

greg k-h

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

* Re: [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings
  2021-10-17 20:46       ` Michael Straube
@ 2021-10-18 14:52         ` Greg Kroah-Hartman
  2021-10-18 22:33           ` Michael Straube
  0 siblings, 1 reply; 11+ messages in thread
From: Greg Kroah-Hartman @ 2021-10-18 14:52 UTC (permalink / raw)
  To: Michael Straube
  Cc: Martin Kaiser, Larry Finger, Phillip Potter, linux-staging, linux-kernel

On Sun, Oct 17, 2021 at 10:46:11PM +0200, Michael Straube wrote:
> On 10/17/21 19:46, Martin Kaiser wrote:
> > Thus wrote Michael Straube (straube.linux@gmail.com):
> > 
> > > On 10/16/21 19:35, Martin Kaiser wrote:
> > > > Remove settings from the Makefile that are set by higher-level Makefiles.
> > 
> > > > Some of those settings might have been useful when the driver was
> > > > maintained out of tree.
> > 
> > > > Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> > > > ---
> > > >    drivers/staging/r8188eu/Makefile | 14 --------------
> > > >    1 file changed, 14 deletions(-)
> > 
> > > > diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
> > > > index fccf7e6d1520..8294fb69ecf9 100644
> > > > --- a/drivers/staging/r8188eu/Makefile
> > > > +++ b/drivers/staging/r8188eu/Makefile
> > > > @@ -1,8 +1,3 @@
> > > > -SHELL := /bin/bash
> > > > -EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
> > > > -EXTRA_CFLAGS += -O1
> > > > -
> > > > -ccflags-y += -D__CHECK_ENDIAN__
> > > >    OUTSRC_FILES :=				\
> > > >    		hal/HalHWImg8188E_MAC.o	\
> > > > @@ -46,15 +41,6 @@ _OS_INTFS_FILES :=				\
> > > >    _HAL_INTFS_FILES += $(OUTSRC_FILES)
> > > > -SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
> > > > -
> > > > -ARCH ?= $(SUBARCH)
> > > > -CROSS_COMPILE ?=
> > > > -KVER  ?= $(if $(KERNELRELEASE),$(KERNELRELEASE),$(shell uname -r))
> > > > -KSRC ?= $(if $(KERNEL_SRC),$(KERNEL_SRC),/lib/modules/$(KVER)/build)
> > > > -MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless
> > > > -INSTALL_PREFIX :=
> > > > -
> > > >    rtk_core :=				\
> > > >    		core/rtw_ap.o		\
> > > >    		core/rtw_br_ext.o	\
> > 
> > 
> > > Hi Martin, this patch introduces a GCC warning on my system.
> > 
> > > drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function
> > > 'rtw_wx_set_enc_ext':
> > > drivers/staging/r8188eu/os_dep/ioctl_linux.c:1929:9: warning: 'strncpy'
> > > specified bound 16 equals destination size [-Wstringop-truncation]
> > >   1929 |         strncpy((char *)param->u.crypt.alg, alg_name,
> > > IEEE_CRYPT_ALG_NAME_LEN);
> > >        |
> > 
> > 
> > Hi Michael,
> > 
> > thanks for reporting this. So far, I can't reproduce the warning, even
> > if I enable -Wstringop-truncation explicitly. I tried this with gcc
> > 8.3.0 (Debian buster) on x86_64.
> 
> Hi Martin,
> 
> probably only newer gcc versions produce this warning. On my system
> the gcc version is 11.2.1 (openSUSE Tumbleweed).

I have gcc 11.1.0 here and I can not duplicate this warning.  And it
looks like the code matches other places in the kernel where this
happens, so I'll just take this for now and see if someone wants to send
me a real fix for it, as it is independent of this Makefile change.

thanks,

greg k-h

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

* Re: [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings
  2021-10-18 14:52         ` Greg Kroah-Hartman
@ 2021-10-18 22:33           ` Michael Straube
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Straube @ 2021-10-18 22:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Martin Kaiser, Larry Finger, Phillip Potter, linux-staging, linux-kernel

On 10/18/21 16:52, Greg Kroah-Hartman wrote:
> On Sun, Oct 17, 2021 at 10:46:11PM +0200, Michael Straube wrote:
>> On 10/17/21 19:46, Martin Kaiser wrote:
>>> Thus wrote Michael Straube (straube.linux@gmail.com):
>>>
>>>> On 10/16/21 19:35, Martin Kaiser wrote:
>>>>> Remove settings from the Makefile that are set by higher-level Makefiles.
>>>
>>>>> Some of those settings might have been useful when the driver was
>>>>> maintained out of tree.
>>>
>>>>> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
>>>>> ---
>>>>>     drivers/staging/r8188eu/Makefile | 14 --------------
>>>>>     1 file changed, 14 deletions(-)
>>>
>>>>> diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
>>>>> index fccf7e6d1520..8294fb69ecf9 100644
>>>>> --- a/drivers/staging/r8188eu/Makefile
>>>>> +++ b/drivers/staging/r8188eu/Makefile
>>>>> @@ -1,8 +1,3 @@
>>>>> -SHELL := /bin/bash
>>>>> -EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
>>>>> -EXTRA_CFLAGS += -O1
>>>>> -
>>>>> -ccflags-y += -D__CHECK_ENDIAN__
>>>>>     OUTSRC_FILES :=				\
>>>>>     		hal/HalHWImg8188E_MAC.o	\
>>>>> @@ -46,15 +41,6 @@ _OS_INTFS_FILES :=				\
>>>>>     _HAL_INTFS_FILES += $(OUTSRC_FILES)
>>>>> -SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc.*/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
>>>>> -
>>>>> -ARCH ?= $(SUBARCH)
>>>>> -CROSS_COMPILE ?=
>>>>> -KVER  ?= $(if $(KERNELRELEASE),$(KERNELRELEASE),$(shell uname -r))
>>>>> -KSRC ?= $(if $(KERNEL_SRC),$(KERNEL_SRC),/lib/modules/$(KVER)/build)
>>>>> -MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless
>>>>> -INSTALL_PREFIX :=
>>>>> -
>>>>>     rtk_core :=				\
>>>>>     		core/rtw_ap.o		\
>>>>>     		core/rtw_br_ext.o	\
>>>
>>>
>>>> Hi Martin, this patch introduces a GCC warning on my system.
>>>
>>>> drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function
>>>> 'rtw_wx_set_enc_ext':
>>>> drivers/staging/r8188eu/os_dep/ioctl_linux.c:1929:9: warning: 'strncpy'
>>>> specified bound 16 equals destination size [-Wstringop-truncation]
>>>>    1929 |         strncpy((char *)param->u.crypt.alg, alg_name,
>>>> IEEE_CRYPT_ALG_NAME_LEN);
>>>>         |
>>>
>>>
>>> Hi Michael,
>>>
>>> thanks for reporting this. So far, I can't reproduce the warning, even
>>> if I enable -Wstringop-truncation explicitly. I tried this with gcc
>>> 8.3.0 (Debian buster) on x86_64.
>>
>> Hi Martin,
>>
>> probably only newer gcc versions produce this warning. On my system
>> the gcc version is 11.2.1 (openSUSE Tumbleweed).
> 
> I have gcc 11.1.0 here and I can not duplicate this warning.  And it
> looks like the code matches other places in the kernel where this
> happens, so I'll just take this for now and see if someone wants to send
> me a real fix for it, as it is independent of this Makefile change.
> 
> thanks,
> 
> greg k-h
> 

I totally forgot that I have an alias for building that sets W=1.
That's why I got this warning...

However, I sent a patch to fix it.

Thanks,
Michael

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

end of thread, other threads:[~2021-10-18 22:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-16 17:35 [PATCH 0/3] staging: r8188eu: clean up the Makefile Martin Kaiser
2021-10-16 17:35 ` [PATCH 1/3] staging: r8188eu: Makefile: remove unused driver config Martin Kaiser
2021-10-17 12:15   ` Michael Straube
2021-10-16 17:35 ` [PATCH 2/3] staging: r8188eu: Makefile: don't overwrite global settings Martin Kaiser
2021-10-17 12:18   ` Michael Straube
2021-10-17 17:46     ` Martin Kaiser
2021-10-17 20:46       ` Michael Straube
2021-10-18 14:52         ` Greg Kroah-Hartman
2021-10-18 22:33           ` Michael Straube
2021-10-18 14:46     ` Greg Kroah-Hartman
2021-10-16 17:35 ` [PATCH 3/3] staging: r8188eu: Makefile: use one file list Martin Kaiser

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