platform/kernel/linux-rpi.git
2 years agostaging: r8188eu: Fix smatch problems in hal/*.c
Larry Finger [Thu, 12 Aug 2021 01:52:31 +0000 (20:52 -0500)]
staging: r8188eu: Fix smatch problems in hal/*.c

Smatch detects the folloring:

drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c:199 ODM_ReadAndConfig_RadioA_1T_8188E() warn: inconsistent indenting
drivers/staging/r8188eu/hal/HalPwrSeqCmd.c:65 HalPwrSeqCmdParsing() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:225 ODM_DMWatchdog() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:485 ODM_Write_DIG() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:485 ODM_Write_DIG() warn: if statement not indented
drivers/staging/r8188eu/hal/odm.c:491 ODM_Write_DIG() warn: if statement not indented
drivers/staging/r8188eu/hal/odm.c:493 ODM_Write_DIG() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:496 ODM_Write_DIG() warn: if statement not indented
drivers/staging/r8188eu/hal/odm.c:498 ODM_Write_DIG() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm.c:501 ODM_Write_DIG() warn: if statement not indented
drivers/staging/r8188eu/hal/odm.c:551 odm_DIGbyRSSI_LPS() warn: inconsistent indenting
drivers/staging/r8188eu/hal/Hal8188ERateAdaptive.c:360 odm_ARFBRefresh_8188E() warn: inconsistent indenting
drivers/staging/r8188eu/hal/odm_HWConfig.c:268 odm_RxPhyStatus92CSeries_Parsing() warn: inconsistent indenting
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c:726 hal_EfusePowerSwitch_RTL8188E() warn: inconsistent indenting
drivers/staging/r8188eu/hal/rtl8188e_mp.c:60 Hal_mpt_SwitchRfSetting() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:547 wpa_set_encryption() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1478 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1479 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1481 rtw_wx_set_essid() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:1555 rtw_wx_set_rate() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:2596 rtw_wps_start() warn: variable dereferenced before check 'pdata' (see line 2590)
drivers/staging/r8188eu/os_dep/ioctl_linux.c:2790 rtw_p2p_profilefound() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:4846 rtw_set_encryption() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:5628 rtw_mp_efuse_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7055 rtw_mp_thermal() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7251 rtw_mp_set() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7255 rtw_mp_set() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7310 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7345 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/os_dep/ioctl_linux.c:7349 rtw_mp_get() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:856 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:859 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:862 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:887 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:915 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:925 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_halinit.c:929 rtl8188eu_hal_init() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_ops_linux.c:263 usb_writeN() warn: inconsistent indenting
drivers/staging/r8188eu/hal/usb_ops_linux.c:568 usb_read_port() warn: inconsistent indenting
`

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
drivers/staging/r8188eu/hal/usb_halinit.c:1887:17: warning: mixing declarations and code
drivers/staging/r8188eu/hal/usb_ops_linux.c:519:25: error: typename in expression
Link: https://lore.kernel.org/r/20210812015232.23784-3-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix Smatch warnings for core/*.c
Larry Finger [Thu, 12 Aug 2021 01:52:30 +0000 (20:52 -0500)]
staging: r8188eu: Fix Smatch warnings for core/*.c

Smatch reports the following problems:
drivers/staging/r8188eu/core/rtw_br_ext.c:655 nat25_db_handle() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_cmd.c:436 rtw_sitesurvey_cmd() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_cmd.c:450 rtw_sitesurvey_cmd() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_led.c:330 SwLedBlink2() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:359 SwLedBlink2() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:538 SwLedBlink4() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:567 SwLedBlink4() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:685 SwLedBlink5() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:771 SwLedControlMode1() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:819 SwLedControlMode1() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:845 SwLedControlMode1() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_led.c:1574 LedControl8188eu() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme.c:420 is_same_network() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme.c:986 rtw_joinbss_update_stainfo() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme.c:1162 rtw_joinbss_event_prehandle() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme.c:1858 rtw_restruct_sec_ie() error: uninitialized symbol 'authmode'.
drivers/staging/r8188eu/core/rtw_mlme.c:1869 rtw_restruct_sec_ie() error: uninitialized symbol 'authmode'.
drivers/staging/r8188eu/core/rtw_mlme_ext.c:401 _mgt_dispatcher() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme_ext.c:3210 is_matched_in_profilelist() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme_ext.c:4351 dump_mgntframe_and_wait() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme_ext.c:4374 dump_mgntframe_and_wait_ack() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mlme_ext.c:7378 _linked_rx_signal_strehgth_display() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mp.c:694 SetPacketTx() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_mp.c:900 _rtw_mp_xmit_priv() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_p2p.c:1130 process_p2p_group_negotation_req() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_recv.c:188 rtw_free_recvframe() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_recv.c:499 portctrl() error: uninitialized symbol 'ether_type'.
drivers/staging/r8188eu/core/rtw_recv.c:507 portctrl() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_recv.c:722 sta2sta_data_frame() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_recv.c:1601 amsdu_to_msdu() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_security.c:283 rtw_seccalctkipmic() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_security.c:1116 aes_cipher() warn: for statement not indented
drivers/staging/r8188eu/core/rtw_security.c:1213 rtw_aes_encrypt() warn: inconsistent indenting
rivers/staging/r8188eu/core/rtw_sta_mgt.c:18 _rtw_init_stainfo() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_sta_mgt.c:475 rtw_get_bcmc_stainfo() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_wlan_util.c:65 cckratesonly_included() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_wlan_util.c:1150 should_forbid_n_rate() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_wlan_util.c:1401 check_assoc_AP() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_wlan_util.c:1403 check_assoc_AP() warn: inconsistent indenting
drivers/staging/r8188eu/core/rtw_xmit.c:805 rtw_make_wlanhdr() warn: if statement not indented
drivers/staging/r8188eu/core/rtw_xmit.c:1691 rtw_br_client_tx() warn: inconsistent indenting
drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c:199 ODM_ReadAndConfig_RadioA_1T_8188E() warn: inconsistent indenting

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210812015232.23784-2-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove no more necessary definitions and code
Fabio M. De Francesco [Thu, 12 Aug 2021 00:25:19 +0000 (02:25 +0200)]
staging: r8188eu: Remove no more necessary definitions and code

Remove no more necessary further 5GHz related code, along with no
more used definitions of macro and variables.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210812002519.23678-4-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove code related to unsupported channels
Fabio M. De Francesco [Thu, 12 Aug 2021 00:25:18 +0000 (02:25 +0200)]
staging: r8188eu: Remove code related to unsupported channels

Remove all code related to unsupported channel
bandwidths. rtl8188eu* NICs work only on 20 and
40 Mhz channels.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210812002519.23678-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove all 5GHz network types
Fabio M. De Francesco [Thu, 12 Aug 2021 00:25:17 +0000 (02:25 +0200)]
staging: r8188eu: Remove all 5GHz network types

Remove all 5Ghz network types. r8188eu works on
802.11bgn standards and on 2.4Ghz band.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210812002519.23678-2-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove CONFIG_USB_HCI from Makefile
Martin Kaiser [Wed, 11 Aug 2021 20:14:50 +0000 (22:14 +0200)]
staging: r8188eu: remove CONFIG_USB_HCI from Makefile

We already depend on USB. There's no need to set CONFIG_USB_HCI in the
Makefile.

Some other Realtek drivers use #ifdef CONFIG_USB_HCI in their code, the
r8188 driver doesn't.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use proper way to build a module
Martin Kaiser [Wed, 11 Aug 2021 20:14:49 +0000 (22:14 +0200)]
staging: r8188eu: use proper way to build a module

It seems that for now, we can only build this driver as a module.

Use the same mechanism as other drivers (such as rtl8723bs or the
deprecated rtl8188eu) to enforce building as a module, i.e. depend on m
in Kconfig instead of setting CONFIG_R8188EU = m in the Makefile.

If we set CONFIG_R8188EU in the Makefile, this setting will not be visible
in .config.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: (trivial) remove a duplicate debug print
Martin Kaiser [Wed, 11 Aug 2021 20:14:48 +0000 (22:14 +0200)]
staging: r8188eu: (trivial) remove a duplicate debug print

Keep the one that shows the wakeup capability.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused function parameters
Martin Kaiser [Wed, 11 Aug 2021 20:14:47 +0000 (22:14 +0200)]
staging: r8188eu: remove unused function parameters

rtw_usb_if1_init and chip_by_usb_id do not need a
struct usb_device_id parameter.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused efuse hal components
Martin Kaiser [Wed, 11 Aug 2021 20:14:46 +0000 (22:14 +0200)]
staging: r8188eu: remove unused efuse hal components

struct hal_data_8188e contains some components related to efuses which
are not used for rl8188eu.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210811201450.31366-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: gdm724x: Place macro argument within parentheses
Dee-Jay Anthony Logozzo [Wed, 11 Aug 2021 13:41:32 +0000 (23:41 +1000)]
staging: gdm724x: Place macro argument within parentheses

Place the macro arguments within parentheses to avoid precedence issues.
This solves the following checkpatch.pl warnings

CHECK: Macro argument 'len' may be better as '(len)' to avoid precedence issues
+#define ND_NLMSG_S_LEN(len)    (len + ND_IFINDEX_LEN)

CHECK: Macro argument 'nlh' may be better as '(nlh)' to avoid precedence issues
+#define ND_NLMSG_R_LEN(nlh)    (nlh->nlmsg_len - ND_IFINDEX_LEN)

Signed-off-by: Dee-Jay Anthony Logozzo <dj@djl.id.au>
Link: https://lore.kernel.org/r/20210811134132.5240-1-dj@djl.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: rtl_core: Fix possible null-pointer dereference in _rtl92e_pci_dis...
Tuo Li [Wed, 11 Aug 2021 03:11:35 +0000 (20:11 -0700)]
staging: rtl8192e: rtl_core: Fix possible null-pointer dereference in _rtl92e_pci_disconnect()

The variable dev is checked in:
  if (dev)

This indicates that it can be NULL. If so, a null-pointer dereference will
occur:
  priv = rtllib_priv(dev);

However, the value of priv is not used in the remaining part of this
function. Thus the else-branch can be removed to fix this posible
null-pointer dereference.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tuo Li <islituo@gmail.com>
Link: https://lore.kernel.org/r/20210811031135.4110-1-islituo@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: os_dep: Hoist vmalloc.h include into osdep_service.h
Nathan Chancellor [Wed, 11 Aug 2021 00:55:05 +0000 (17:55 -0700)]
staging: r8188eu: os_dep: Hoist vmalloc.h include into osdep_service.h

After commit 71f09c5ae9d2 ("staging: r8188eu: Remove wrapper around
vfree"), the driver fails to build on Hexagon due to an implicit
declaration in several different files:

drivers/staging/r8188eu/core/rtw_mlme.c:129:3: error: implicit
declaration of function 'vfree'
[-Werror,-Wimplicit-function-declaration]
                vfree(pmlmepriv->free_bss_buf);
                ^
1 error generated.

Previously, vfree() was only called in osdep_service.c, which includes
vmalloc.h for vmalloc() and vfree(). Now, the driver relies on vfree()
getting implicitly included from another file.

Hoist the vmalloc.h include from osdep_service.c to osdep_service.h so
that the driver continues to build fine on all architectures.

Fixes: 71f09c5ae9d2 ("staging: r8188eu: Remove wrapper around vfree")
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20210811005505.3953122-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Use GFP_ATOMIC under spin lock
Yang Yingliang [Tue, 10 Aug 2021 12:53:14 +0000 (20:53 +0800)]
staging: r8188eu: Use GFP_ATOMIC under spin lock

A spin lock is taken in __nat25_db_network_insert() and
update_BCNTIM() is called under spin lock so we should
use GFP_ATOMIC in both place.

Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210810125314.2182112-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Replace BITn with BIT(n)
Larry Finger [Tue, 10 Aug 2021 18:05:11 +0000 (13:05 -0500)]
staging: r8188eu: Replace BITn with BIT(n)

The driver uses BITn instead of BIT(n). All such usage is converted.

Note that this patch does not address any warnings that checkpatch
will find. These include missing space around operators and lines
that are too long. These problems will be addressed in a separate
patch.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210810180511.8986-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove lines from Makefile that silence build warnings
Phillip Potter [Tue, 10 Aug 2021 23:50:47 +0000 (00:50 +0100)]
staging: r8188eu: remove lines from Makefile that silence build warnings

Remove the several lines from the Makefile that append EXTRA_CFLAGS options
to silence build warnings about unused variables, unused functions and such
like. This will enable cleanup of missed warnings, and easier spotting
of future such problems.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-9-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused variable from rtw_init_recv_timer
Phillip Potter [Tue, 10 Aug 2021 23:50:46 +0000 (00:50 +0100)]
staging: r8188eu: remove unused variable from rtw_init_recv_timer

Remove unused variable from rtw_init_recv_timer function in
os_dep/recv_linux.c

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused variable from rtw_init_drv_sw
Phillip Potter [Tue, 10 Aug 2021 23:50:45 +0000 (00:50 +0100)]
staging: r8188eu: remove unused variable from rtw_init_drv_sw

Remove unused variable from rtw_init_drv_sw function in
os_dep/os_intfs.c

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused variable from rtl8188e_init_dm_priv
Phillip Potter [Tue, 10 Aug 2021 23:50:44 +0000 (00:50 +0100)]
staging: r8188eu: remove unused variable from rtl8188e_init_dm_priv

Remove unused variable from the rtl8188e_init_dm_priv function in
hal/rtl8188e_dm.c

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_mfree_sta_priv_lock function
Phillip Potter [Tue, 10 Aug 2021 23:50:43 +0000 (00:50 +0100)]
staging: r8188eu: remove rtw_mfree_sta_priv_lock function

Remove rtw_mfree_sta_priv_lock function from rtw_sta_mgt.c, as it does
nothing and contains an unused variable.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused label from recv_indicatepkt_reorder
Phillip Potter [Tue, 10 Aug 2021 23:50:42 +0000 (00:50 +0100)]
staging: r8188eu: remove unused label from recv_indicatepkt_reorder

Remove unused goto label from recv_indicatepkt_reorder function in
core/rtw_recv.c

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused oid_null_function function
Phillip Potter [Tue, 10 Aug 2021 23:50:41 +0000 (00:50 +0100)]
staging: r8188eu: remove unused oid_null_function function

Remove unused oid_null_function function from include/rtw_ioctl.h

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused functions from os_dep/ioctl_linux.c
Phillip Potter [Tue, 10 Aug 2021 23:50:40 +0000 (00:50 +0100)]
staging: r8188eu: remove unused functions from os_dep/ioctl_linux.c

Remove unused functions that are now no longer called as a result of the
removal of rtw_ioctl in a previous patch. This includes functions not
directly called from rtw_ioctl, but anything in that specific
call-chain.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810235047.177883-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rtw_ioctl function
Phillip Potter [Tue, 10 Aug 2021 07:45:04 +0000 (08:45 +0100)]
staging: r8188eu: remove rtw_ioctl function

Remove rtw_ioctl function from os_dep/ioctl_linux.c, its declaration
in include/osdep_intf.h, and finally its inclusion as the value of the
.ndo_do_ioctl member of struct net_device_ops rtw_netdev_ops in
os_dep/os_intfs.c.

The e-mail from Arnd Bergmann at:
https://lore.kernel.org/linux-next/CAK8P3a0WRMNmBmBDerZ0nWPdFZKALnxrj-uUFBkTP-MOtv48vg@mail.gmail.com
explains the justification for this approach. Essentially, changes from
net-next make the existing function and its use of SIOCDEVPRIVATE ioctls
unworkable without changes.

Functions called from rtw_ioctl that are now no longer accessible will
be cleaned up in further patches. Additionally, once these changes have
made their way downstream to the staging branch, we can modify and
reconnect rtw_android_priv_cmd via ndo_siocdevprivate in struct
net_device_ops.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210810074504.957-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove remaining unnecessary parentheses in core dir
Michael Straube [Mon, 9 Aug 2021 16:50:07 +0000 (18:50 +0200)]
staging: r8188eu: remove remaining unnecessary parentheses in core dir

Remove remaining unnecessary parentheses in core dir reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-18-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_cmd.c
Michael Straube [Mon, 9 Aug 2021 16:50:06 +0000 (18:50 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_cmd.c

Remove unnecessary parentheses in core/rtw_cmd.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-17-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_ioctl_set.c
Michael Straube [Mon, 9 Aug 2021 16:50:05 +0000 (18:50 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_ioctl_set.c

Remove unnecessary parentheses in core/rtw_ioctl_set.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-16-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_io.c
Michael Straube [Mon, 9 Aug 2021 16:50:04 +0000 (18:50 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_io.c

Remove unnecessary parentheses in core/rtw_io.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-15-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_pwrctrl.c
Michael Straube [Mon, 9 Aug 2021 16:50:03 +0000 (18:50 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_pwrctrl.c

Remove unnecessary parentheses in core/rtw_pwrctrl.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-14-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_recv.c
Michael Straube [Mon, 9 Aug 2021 16:50:02 +0000 (18:50 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_recv.c

Remove unnecessary parentheses in core/rtw_recv.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-13-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_sta_mgt.c
Michael Straube [Mon, 9 Aug 2021 16:50:01 +0000 (18:50 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_sta_mgt.c

Remove unnecessary parentheses in core/rtw_sta_mgt.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-12-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_xmit.c
Michael Straube [Mon, 9 Aug 2021 16:50:00 +0000 (18:50 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_xmit.c

Remove unnecessary parentheses in core/rtw_xmit.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_mlme.c
Michael Straube [Mon, 9 Aug 2021 16:49:59 +0000 (18:49 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_mlme.c

Remove unnecessary parentheses in core/rtw_mlme.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up comparsions to true/false
Michael Straube [Mon, 9 Aug 2021 16:49:58 +0000 (18:49 +0200)]
staging: r8188eu: clean up comparsions to true/false

Clean up some comparsions to true/false to clear chackpatch warnings.

WARNING: Unnecessary parentheses - maybe == should be = ?

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_p2p.c
Michael Straube [Mon, 9 Aug 2021 16:49:57 +0000 (18:49 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_p2p.c

Remove unnecessary parentheses in core/rtw_p2p.c.
Most of them reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_led.c
Michael Straube [Mon, 9 Aug 2021 16:49:56 +0000 (18:49 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_led.c

Remove unnecessary parentheses in core/rtw_led.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_wlan_util.c
Michael Straube [Mon, 9 Aug 2021 16:49:55 +0000 (18:49 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_wlan_util.c

Remove unnecessary parentheses in core/rtw_wlan_util.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_ap.c
Michael Straube [Mon, 9 Aug 2021 16:49:54 +0000 (18:49 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_ap.c

Remove unnecessary parentheses in core/rtw_ap.c reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in core/rtw_mlme_ext.c
Michael Straube [Mon, 9 Aug 2021 16:49:53 +0000 (18:49 +0200)]
staging: r8188eu: remove unnecessary parentheses in core/rtw_mlme_ext.c

Remove unnecessary parentheses in core/rtw_mlme_ext.c.
Most of them reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in hal dir
Michael Straube [Mon, 9 Aug 2021 16:49:52 +0000 (18:49 +0200)]
staging: r8188eu: remove unnecessary parentheses in hal dir

Remove unnecessary parentheses in the hal directory reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary parentheses in os_dep dir
Michael Straube [Mon, 9 Aug 2021 16:49:51 +0000 (18:49 +0200)]
staging: r8188eu: remove unnecessary parentheses in os_dep dir

Remove unnecessary parentheses in the os_dep directory reported by
checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210809165007.23204-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: os_dep: remove unused variable
Saurav Girepunje [Sat, 7 Aug 2021 10:22:32 +0000 (15:52 +0530)]
staging: rtl8723bs: os_dep: remove unused variable

Remove below unused static variable from os_intfs.c
rtw_enusbss
rtw_hwpdn_mode
rtw_hwpwrp_detect

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/20210807102232.6674-5-saurav.girepunje@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: rtl8192e: rtl_core: remove unused global variable
Saurav Girepunje [Sat, 7 Aug 2021 10:22:31 +0000 (15:52 +0530)]
staging: rtl8192e: rtl8192e: rtl_core: remove unused global variable

Remove unused global variable channels from rtl_core.c

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/20210807102232.6674-4-saurav.girepunje@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove the RT_TRACE macro
Martin Kaiser [Sat, 7 Aug 2021 15:36:36 +0000 (17:36 +0200)]
staging: r8188eu: remove the RT_TRACE macro

We've deleted all RT_TRACE calls. The macro itself can now be removed
as well.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused DEBUG_OID macro
Martin Kaiser [Sat, 7 Aug 2021 15:36:35 +0000 (17:36 +0200)]
staging: r8188eu: remove unused DEBUG_OID macro

The DEBUG_OID macro is not used and can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use IW_HANDLER to declare wext handlers
Martin Kaiser [Sat, 7 Aug 2021 15:36:34 +0000 (17:36 +0200)]
staging: r8188eu: use IW_HANDLER to declare wext handlers

Use the IW_HANDLER macro to declare the handler functions for
wext ioctls. We don't have to skip unused ioctl numbers manually.

The same modification was applied to the deprecated rtl8188eu driver in
commit af249fce390f ("staging: rtl8188eu: use IW_HANDLER to declare wext
handlers").

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove RT_TRACE prints from xmit_linux.c
Martin Kaiser [Sat, 7 Aug 2021 15:36:33 +0000 (17:36 +0200)]
staging: r8188eu: remove RT_TRACE prints from xmit_linux.c

We should use the standard mechanism for debug prints. Remove the prints
that use driver-specific macros.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove RT_TRACE prints from recv_linux.c
Martin Kaiser [Sat, 7 Aug 2021 15:36:32 +0000 (17:36 +0200)]
staging: r8188eu: remove RT_TRACE prints from recv_linux.c

We should use the standard mechanism for debug prints. Remove the prints
that use driver-specific macros.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove an RT_TRACE print from osdep_service.c
Martin Kaiser [Sat, 7 Aug 2021 15:36:31 +0000 (17:36 +0200)]
staging: r8188eu: remove an RT_TRACE print from osdep_service.c

We should use the standard mechanism for debug prints. Remove a print that
uses a driver-specific macro.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove RT_TRACE prints from os_intfs.c
Martin Kaiser [Sat, 7 Aug 2021 15:36:30 +0000 (17:36 +0200)]
staging: r8188eu: remove RT_TRACE prints from os_intfs.c

We should use the standard mechanism for debug prints. Remove the prints
that use driver-specific macros.

Handle errors from dev_alloc_name in one place instead of showing a debug
print.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove RT_TRACE prints from mlme_linux.c
Martin Kaiser [Sat, 7 Aug 2021 15:36:29 +0000 (17:36 +0200)]
staging: r8188eu: remove RT_TRACE prints from mlme_linux.c

We should use the standard mechanism for debug prints. Remove the prints
that use driver-specific macros.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove empty function
Martin Kaiser [Sat, 7 Aug 2021 15:36:28 +0000 (17:36 +0200)]
staging: r8188eu: remove empty function

With the RT_TRACE print removed, the rtw_wx_set_freq function is now
empty.

This function should be removed. At the moment, the setfreq ioctl
returns success to the caller although the frequency wasn't set.
It makes more sense to inform callers that this driver does not
support setfreq.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove RT_TRACE prints from ioctl_linux.c
Martin Kaiser [Sat, 7 Aug 2021 15:36:27 +0000 (17:36 +0200)]
staging: r8188eu: remove RT_TRACE prints from ioctl_linux.c

We should use the standard mechanism for debug prints. Remove the prints
that use driver-specific macros.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove RT_TRACE prints from usb_ops_linux.c
Martin Kaiser [Sat, 7 Aug 2021 15:36:26 +0000 (17:36 +0200)]
staging: r8188eu: remove RT_TRACE prints from usb_ops_linux.c

We should use the standard mechanism for debug prints. Remove the prints
that use driver-specific macros.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove RT_TRACE prints from usb_intf.c
Martin Kaiser [Sat, 7 Aug 2021 15:36:25 +0000 (17:36 +0200)]
staging: r8188eu: remove RT_TRACE prints from usb_intf.c

We should use the standard mechanism for debug prints. Remove the prints
that use driver-specific macros.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210807153636.11712-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove unused RF_*T*R enum
Fabio Aiuto [Sat, 7 Aug 2021 09:48:13 +0000 (11:48 +0200)]
staging: rtl8723bs: remove unused RF_*T*R enum

remove unused RF_*T*R enum, for rtl8723bs is
only capable of 1T1R rf path so selection is not needed.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2f2f185a80fbec71af4a165180ed0156d194c96e.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: fix tx power tables size
Fabio Aiuto [Sat, 7 Aug 2021 09:48:12 +0000 (11:48 +0200)]
staging: rtl8723bs: fix tx power tables size

fix sizes of tx power tables to the real used
values (i.e. 2 bandwidth, 3 rate sections).

Delete MAX_BASE_NUM_IN_PHY_REG_PG_2_4 macro in
this process, for it expands to a larger than
needed rate section index value.

Modify comments accordingly.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/5f52295a8b17f68ad80ffb7b6301da83bfc11a68.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: use MAX_RF_PATH_NUM as ceiling to rf path index
Fabio Aiuto [Sat, 7 Aug 2021 09:48:11 +0000 (11:48 +0200)]
staging: rtl8723bs: use MAX_RF_PATH_NUM as ceiling to rf path index

use MAX_RF_PATH_NUM as ceiling to rf path index.
Only 2 rf paths are used, not 4. Remove also
TX_POWER_BY_RATE_NUM_RF left unused.

Use RF_PATH_A as loop starting point instead of
hardcoded 0, as in other places.

Related comments modified accordingly.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/88da23cef57131b39a63b2757b91f959553dd65d.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove RF_*TX enum
Fabio Aiuto [Sat, 7 Aug 2021 09:48:10 +0000 (11:48 +0200)]
staging: rtl8723bs: remove RF_*TX enum

remove RF_*TX enum, its only used value is RF_1TX.
So remove it and remove all indexes and loop over
these enum items.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/3acc624742a933d90e83a83babb4eecb193cf869.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove unused macro in include/hal_data.h
Fabio Aiuto [Sat, 7 Aug 2021 09:48:09 +0000 (11:48 +0200)]
staging: rtl8723bs: remove unused macro in include/hal_data.h

remove unused macro in include/hal_data.h

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/13b4f41247d1b8bc10f0576d82e4dc9a285d88e1.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove unused rtw_rf_config module param
Fabio Aiuto [Sat, 7 Aug 2021 09:48:08 +0000 (11:48 +0200)]
staging: rtl8723bs: remove unused rtw_rf_config module param

remove unused rtw_rf_config module param and struct field
used to store the param value.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/a83eaa9b2350d3d16f5b1dddc40870e0f0a6df06.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove rf type branching (fourth patch)
Fabio Aiuto [Sat, 7 Aug 2021 09:48:07 +0000 (11:48 +0200)]
staging: rtl8723bs: remove rf type branching (fourth patch)

remove all function calls to rtw_get_hw_reg made to
read HW_VAR_RF_TYPE and get value of rt_type, which
is always 1T1R. Clean up code on removal sites,
keeping 1T1R code unconditionally.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/8ca2f788c42d81b9cb4dbc46e23c7549dc27d081.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove rf type branching (third patch)
Fabio Aiuto [Sat, 7 Aug 2021 09:48:06 +0000 (11:48 +0200)]
staging: rtl8723bs: remove rf type branching (third patch)

remove rf_type struct member, keep all 1T1R code
unconditionally, remove the other *T*R branches.
Removed dead code related to MCS indexes above 7.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/e626790eb8bd7d96f939e1bbb47b899bf12dab0d.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove rf type branching (second patch)
Fabio Aiuto [Sat, 7 Aug 2021 09:48:05 +0000 (11:48 +0200)]
staging: rtl8723bs: remove rf type branching (second patch)

remove RFType field in dm_odm_t struct, keep unconditioned
all code branches related to 1T1R path, delete the others.

Remove unused variable to silence gcc warning.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/fd41fbfba16df2b93a7593c1f853a874255e945c.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove rf type branching (first patch)
Fabio Aiuto [Sat, 7 Aug 2021 09:48:04 +0000 (11:48 +0200)]
staging: rtl8723bs: remove rf type branching (first patch)

remove rf type branching, for the baseband works only on
1T1R rf type, so just keep code branches related to 1T1R.
Remove RFType from hal_version struct, and all
related code.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/72ce98106bb172fce0f43315bc4dbbb7065afef5.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove unused struct member
Fabio Aiuto [Sat, 7 Aug 2021 09:48:03 +0000 (11:48 +0200)]
staging: rtl8723bs: remove unused struct member

remove unused bIsMPChip struct member and all code
storing it.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/ad7831868683a99598cd00a3aacc45f76ba234e8.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove unused macros
Fabio Aiuto [Sat, 7 Aug 2021 09:48:02 +0000 (11:48 +0200)]
staging: rtl8723bs: remove unused macros

remove unused macros in hal/odm_HWConfig.h

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/00575e78b23e36edb3a7e404e26a3c5e84394f3d.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: clean driver from unused RF paths
Fabio Aiuto [Sat, 7 Aug 2021 09:48:01 +0000 (11:48 +0200)]
staging: rtl8723bs: clean driver from unused RF paths

rtl8723bs support only two rf paths (A and B), remove all
the others (C, D, BC, ...) as they are unused. Keep
just one enum selecting rf path, remove unused macro
indicating max rf path number, add an item in rf_path
enum for this pourpose.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/23060c85ab9aa468c9c021378f0dc8a8f887a578.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: fix right side of condition
Fabio Aiuto [Sat, 7 Aug 2021 09:48:00 +0000 (11:48 +0200)]
staging: rtl8723bs: fix right side of condition

TxNum value is compared against ODM_RF_PATH_D,
which is inconsistent. Compare it against
RF_MAX_TX_NUM, as in other places in the same file.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/147631fe6f4f5de84cc54a62ba71d739b92697be.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: beautify function ODM_PhyStatusQuery()
Fabio Aiuto [Sat, 7 Aug 2021 09:47:59 +0000 (11:47 +0200)]
staging: rtl8723bs: beautify function ODM_PhyStatusQuery()

beautify function ODM_PhyStatusQuery().
Fix camel case name, put more than one argument per
line, fix camel case in arugment names.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/5e17b5ece9dbeb526f7a9aff147bf8767d39395c.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove wrapping static function
Fabio Aiuto [Sat, 7 Aug 2021 09:47:58 +0000 (11:47 +0200)]
staging: rtl8723bs: remove wrapping static function

remove unneeded wrapping static function in
hal/odm_HWConif.c

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/786fc4d72db2a4b5e22c95e0e1437cfb734e1218.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove empty files
Fabio Aiuto [Sat, 7 Aug 2021 09:47:57 +0000 (11:47 +0200)]
staging: rtl8723bs: remove empty files

remove empty files after function move,
hal/odm_RTL8723B.h has only an unused
macro declaration.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/92cba6beb56150635ab4c7985d733c93fba7fe83.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: move function to file hal/odm_HWConfig.c
Fabio Aiuto [Sat, 7 Aug 2021 09:47:56 +0000 (11:47 +0200)]
staging: rtl8723bs: move function to file hal/odm_HWConfig.c

move function odm_cck_rssi() to hal/odm_HWConfig.c.
As it is used only in this file turn it to
static.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c2bb14c3d32d3a654df95288751f0bc8cd6566b0.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: do some code cleaning in modified function
Fabio Aiuto [Sat, 7 Aug 2021 09:47:55 +0000 (11:47 +0200)]
staging: rtl8723bs: do some code cleaning in modified function

do some code cleaning after changes of previous commit.
Fixed comments, camel case names, variable naming conventions;
kept function names without chip series numbers (this is
just code for 8723), fixed indentations, blank lines and
other minor stuff.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2bddef34cebdf35666d8abec4462c1a8d30c8c60.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove unneeded loop
Fabio Aiuto [Sat, 7 Aug 2021 09:47:54 +0000 (11:47 +0200)]
staging: rtl8723bs: remove unneeded loop

remove unneeded loop over multiple spatial streams
as phy only works on 1 spatial stream.

Removed commented code, removed condition
always satisfied, beautified comments.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/45f2ed02b8e5bb25057da6e7dc3e7c8713a1a2c0.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove code related to unsupported MCS index values
Fabio Aiuto [Sat, 7 Aug 2021 09:47:53 +0000 (11:47 +0200)]
staging: rtl8723bs: remove code related to unsupported MCS index values

remove code related to MCS index from 8 to 31 for
rtl8723bs works only with index from 0 to 7 and
index 32.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/1d5c8ca570a9f1880864f37099d625f96ea4a1d1.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix potential memory leak or NULL dereference
Larry Finger [Fri, 6 Aug 2021 21:32:35 +0000 (16:32 -0500)]
staging: r8188eu: Fix potential memory leak or NULL dereference

In routine c2h_wk_callback(() following a kmalloc() call, the
error recovery is flawed. If the kmalloc() returns a pointer
that is not NULL, and the following c2h_evt_read() fails, the
code will leak that buffer. If the kmalloc() fails, a NULL
dereference will occur in the following code.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210806213235.22349-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: Avoid field-overflowing memcpy()
Kees Cook [Fri, 6 Aug 2021 20:14:22 +0000 (13:14 -0700)]
staging: rtl8723bs: Avoid field-overflowing memcpy()

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring fields.

Adjust memcpy() destination to be the named structure itself, rather than
the first member, allowing memcpy() to correctly reason about the size.

"objdump -d" shows no object code changes.

Cc: Ross Schmidt <ross.schm.dev@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210806201422.2871679-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192u: Avoid field-overflowing memcpy()
Kees Cook [Fri, 6 Aug 2021 20:12:07 +0000 (13:12 -0700)]
staging: rtl8192u: Avoid field-overflowing memcpy()

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring fields.

Split the 3 addr memcpy() into 3 memcpy() calls so the compiler doesn't
think an overflowing memcpy() happens against the addr1 field (the
neighbors are intended to be copied as well).

ieee80211_read_qos_param_element() copies a struct ieee80211_info_element
into a struct ieee80211_qos_information_element, but is actually wanting to
copy into the larger struct ieee80211_qos_parameter_info (the contents of
ac_params_record[] is later examined). Refactor the routine to perform
centralized checks, and copy the entire contents directly (since the id
and len members match the elementID and length members):

struct ieee80211_info_element {
        u8 id;
        u8 len;
        u8 data[];
} __packed;

struct ieee80211_qos_information_element {
        u8 elementID;
        u8 length;
        u8 qui[QOS_OUI_LEN];
        u8 qui_type;
        u8 qui_subtype;
        u8 version;
        u8 ac_info;
} __packed;

struct ieee80211_qos_parameter_info {
        struct ieee80211_qos_information_element info_element;
        u8 reserved;
        struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
} __packed;

Additionally replace old-style zero-element arrays with flexible arrays.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pascal Terjan <pterjan@google.com>
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210806201208.2871467-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Avoid field-overflowing memcpy()
Kees Cook [Fri, 6 Aug 2021 20:11:06 +0000 (13:11 -0700)]
staging: rtl8192e: Avoid field-overflowing memcpy()

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring fields.

Split the 3 addr memcpy() into 3 memcpy() calls so the compiler doesn't
think an overflowing memcpy() happens against the addr1 field (the
neighbors are intended to be copied as well).

rtllib_read_qos_param_element() copies a struct rtllib_info_element
into a struct rtllib_qos_information_element, but is actually wanting to
copy into the larger struct rtllib_qos_parameter_info (the contents of
ac_params_record[] is later examined). Refactor the routine to perform
centralized checks, and copy the entire contents directly (since the id
and len members match the elementID and length members):

struct rtllib_info_element {
        u8 id;
        u8 len;
        u8 data[];
} __packed;

struct rtllib_qos_information_element {
        u8 elementID;
        u8 length;
        u8 qui[QOS_OUI_LEN];
        u8 qui_type;
        u8 qui_subtype;
        u8 version;
        u8 ac_info;
} __packed;

struct rtllib_qos_parameter_info {
        struct rtllib_qos_information_element info_element;
        u8 reserved;
        struct rtllib_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
} __packed;

Cc: Darshan D V <darshandv10@gmail.com>
Cc: Aditya Srivastava <yashsri421@gmail.com>
Cc: devel@driverdev.osuosl.org
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210806201106.2871169-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq: Add details to Kconfig help texts
Ojaswin Mujoo [Mon, 2 Aug 2021 17:42:11 +0000 (23:12 +0530)]
staging: vchiq: Add details to Kconfig help texts

Add some details to the Kconfig definitions of $CONFIG_VCHIQ_CDEV and
$CONFIG_BCM2835_VCHIQ to help make the motive behind the configs a bit
more clear.

Reviewed-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Link: https://lore.kernel.org/r/ab88d3222088aca29a319147b50a9d1e9f0f8b81.1627925241.git.ojaswin98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq: Set $CONFIG_BCM2835_VCHIQ to imply $CONFIG_VCHIQ_CDEV
Ojaswin Mujoo [Mon, 2 Aug 2021 17:42:10 +0000 (23:12 +0530)]
staging: vchiq: Set $CONFIG_BCM2835_VCHIQ to imply $CONFIG_VCHIQ_CDEV

Before $CONFIG_VCHIQ_CDEV was defined, the vchiq cdev used to be created
unconditionally when CONFIG_BCM2835_VCHIQ=y. When an earlier commit
introduced the new config, its default behavior was set to disabled,
which might surprise some unsuspecting users.  Hence, modify
CONFIG_BCM2835_VCHIQ to imply CONFIG_VCHIQ_CDEV

Reviewed-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Link: https://lore.kernel.org/r/da53207b24bc37f166b05c6835087becdc6b5b4d.1627925241.git.ojaswin98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoMerge 5.14-rc5 into staging-next
Greg Kroah-Hartman [Mon, 9 Aug 2021 06:59:23 +0000 (08:59 +0200)]
Merge 5.14-rc5 into staging-next

We need the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoLinux 5.14-rc5
Linus Torvalds [Sun, 8 Aug 2021 20:49:31 +0000 (13:49 -0700)]
Linux 5.14-rc5

2 years agoMerge tag 'timers-urgent-2021-08-08' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 8 Aug 2021 18:53:30 +0000 (11:53 -0700)]
Merge tag 'timers-urgent-2021-08-08' of git://git./linux/kernel/git/tip/tip

Pull timer fix from Thomas Gleixner:
 "A single timer fix:

   - Prevent a memory ordering issue in the timer expiry code which
     makes it possible to observe falsely that the callback has been
     executed already while that's not the case, which violates the
     guarantee of del_timer_sync()"

* tag 'timers-urgent-2021-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  timers: Move clearing of base::timer_running under base:: Lock

2 years agoMerge tag 'sched-urgent-2021-08-08' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 8 Aug 2021 18:50:07 +0000 (11:50 -0700)]
Merge tag 'sched-urgent-2021-08-08' of git://git./linux/kernel/git/tip/tip

Pull scheduler fix from Thomas Gleixner:
 "A single scheduler fix:

   - Prevent a double enqueue caused by rt_effective_prio() being
     invoked twice in __sched_setscheduler()"

* tag 'sched-urgent-2021-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/rt: Fix double enqueue caused by rt_effective_prio

2 years agoMerge tag 'perf-urgent-2021-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Aug 2021 18:46:13 +0000 (11:46 -0700)]
Merge tag 'perf-urgent-2021-08-08' of git://git./linux/kernel/git/tip/tip

Pull perf fixes from Thomas Gleixner:
 "A set of perf fixes:

   - Correct the permission checks for perf event which send SIGTRAP to
     a different process and clean up that code to be more readable.

   - Prevent an out of bound MSR access in the x86 perf code which
     happened due to an incomplete limiting to the actually available
     hardware counters.

   - Prevent access to the AMD64_EVENTSEL_HOSTONLY bit when running
     inside a guest.

   - Handle small core counter re-enabling correctly by issuing an ACK
     right before reenabling it to prevent a stale PEBS record being
     kept around"

* tag 'perf-urgent-2021-08-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/x86/intel: Apply mid ACK for small core
  perf/x86/amd: Don't touch the AMD64_EVENTSEL_HOSTONLY bit inside the guest
  perf/x86: Fix out of bound MSR access
  perf: Refactor permissions check into perf_check_permission()
  perf: Fix required permissions if sigtrap is requested

2 years agoMerge tag 'char-misc-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregk...
Linus Torvalds [Sun, 8 Aug 2021 17:41:49 +0000 (10:41 -0700)]
Merge tag 'char-misc-5.14-rc5' of git://git./linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here are some small char/misc driver fixes for 5.14-rc5.

  They resolve a few regressions that people reported:

   - acrn driver fix

   - fpga driver fix

   - interconnect tiny driver fixes

  All have been in linux-next for a while with no reported issues"

* tag 'char-misc-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  interconnect: Fix undersized devress_alloc allocation
  interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate
  interconnect: qcom: icc-rpmh: Ensure floor BW is enforced for all nodes
  fpga: dfl: fme: Fix cpu hotplug issue in performance reporting
  virt: acrn: Do hcall_destroy_vm() before resource release
  interconnect: Always call pre_aggregate before aggregate
  interconnect: Zero initial BW after sync-state

2 years agoMerge tag 'driver-core-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Aug 2021 17:34:49 +0000 (10:34 -0700)]
Merge tag 'driver-core-5.14-rc5' of git://git./linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are three tiny driver core and firmware loader fixes for
  5.14-rc5. They are:

   - driver core fix for when probing fails

   - firmware loader fixes for reported problems.

  All have been in linux-next for a while with no reported issues"

* tag 'driver-core-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  firmware_loader: fix use-after-free in firmware_fallback_sysfs
  firmware_loader: use -ETIMEDOUT instead of -EAGAIN in fw_load_sysfs_fallback
  drivers core: Fix oops when driver probe fails

2 years agoMerge tag 'staging-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sun, 8 Aug 2021 17:29:39 +0000 (10:29 -0700)]
Merge tag 'staging-5.14-rc5' of git://git./linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are a few small staging driver fixes for 5.14-rc5 to resolve some
  reported problems. They include:

   - mt7621 driver fix

   - rtl8723bs driver fixes

   - rtl8712 driver fixes.

  Nothing major, just small problems resolved.

  All have been in linux-next for a while with no reported issues"

* tag 'staging-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: mt7621-pci: avoid to re-disable clock for those pcies not in use
  staging: rtl8712: error handling refactoring
  staging: rtl8712: get rid of flush_scheduled_work
  staging: rtl8723bs: select CONFIG_CRYPTO_LIB_ARC4
  staging: rtl8723bs: Fix a resource leak in sd_int_dpc

2 years agoMerge tag 'tty-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sun, 8 Aug 2021 17:23:13 +0000 (10:23 -0700)]
Merge tag 'tty-5.14-rc5' of git://git./linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here are some small tty/serial driver fixes for 5.14-rc5 to resolve a
  number of reported problems.

  They include:

   - mips serial driver fixes

   - 8250 driver fixes for reported problems

   - fsl_lpuart driver fixes

   - other tiny driver fixes

  All have been in linux-next for a while with no reported problems"

* tag 'tty-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: 8250_pci: Avoid irq sharing for MSI(-X) interrupts.
  serial: 8250_mtk: fix uart corruption issue when rx power off
  tty: serial: fsl_lpuart: fix the wrong return value in lpuart32_get_mctrl
  serial: 8250_pci: Enumerate Elkhart Lake UARTs via dedicated driver
  serial: 8250: fix handle_irq locking
  serial: tegra: Only print FIFO error message when an error occurs
  MIPS: Malta: Do not byte-swap accesses to the CBUS UART
  serial: 8250: Mask out floating 16/32-bit bus bits
  serial: max310x: Unprepare and disable clock in error path

2 years agoMerge tag 'usb-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 8 Aug 2021 17:20:05 +0000 (10:20 -0700)]
Merge tag 'usb-5.14-rc5' of git://git./linux/kernel/git/gregkh/usb

Pull USB driver fixes from Greg KH:
 "Here are some small USB driver fixes for 5.14-rc5. They resolve a
  number of small reported issues, including:

   - cdnsp driver fixes

   - usb serial driver fixes and device id updates

   - usb gadget hid fixes

   - usb host driver fixes

   - usb dwc3 driver fixes

   - other usb gadget driver fixes

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'usb-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (21 commits)
  usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events
  usb: dwc3: gadget: Avoid runtime resume if disabling pullup
  usb: dwc3: gadget: Use list_replace_init() before traversing lists
  USB: serial: ftdi_sio: add device ID for Auto-M3 OP-COM v2
  USB: serial: pl2303: fix GT type detection
  USB: serial: option: add Telit FD980 composition 0x1056
  USB: serial: pl2303: fix HX type detection
  USB: serial: ch341: fix character loss at high transfer rates
  usb: cdnsp: Fix the IMAN_IE_SET and IMAN_IE_CLEAR macro
  usb: cdnsp: Fixed issue with ZLP
  usb: cdnsp: Fix incorrect supported maximum speed
  usb: cdns3: Fixed incorrect gadget state
  usb: gadget: f_hid: idle uses the highest byte for duration
  Revert "thunderbolt: Hide authorized attribute if router does not support PCIe tunnels"
  usb: otg-fsm: Fix hrtimer list corruption
  usb: host: ohci-at91: suspend/resume ports after/before OHCI accesses
  usb: musb: Fix suspend and resume issues for PHYs on I2C and SPI
  usb: gadget: f_hid: added GET_IDLE and SET_IDLE handlers
  usb: gadget: f_hid: fixed NULL pointer dereference
  usb: gadget: remove leaked entry from udc driver list
  ...

2 years agoMerge tag 'io_uring-5.14-2021-08-07' of git://git.kernel.dk/linux-block
Linus Torvalds [Sat, 7 Aug 2021 17:34:26 +0000 (10:34 -0700)]
Merge tag 'io_uring-5.14-2021-08-07' of git://git.kernel.dk/linux-block

Pull io_uring from Jens Axboe:
 "A few io-wq related fixes:

   - Fix potential nr_worker race and missing max_workers check from one
     path (Hao)

   - Fix race between worker exiting and new work queue (me)"

* tag 'io_uring-5.14-2021-08-07' of git://git.kernel.dk/linux-block:
  io-wq: fix lack of acct->nr_workers < acct->max_workers judgement
  io-wq: fix no lock protection of acct->nr_worker
  io-wq: fix race between worker exiting and activating free worker

2 years agoMerge tag 'block-5.14-2021-08-07' of git://git.kernel.dk/linux-block
Linus Torvalds [Sat, 7 Aug 2021 17:26:21 +0000 (10:26 -0700)]
Merge tag 'block-5.14-2021-08-07' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "A few minor fixes:

   - Fix ldm kernel-doc warning (Bart)

   - Fix adding offset twice for DMA address in n64cart (Christoph)

   - Fix use-after-free in dasd path handling (Stefan)

   - Order kyber insert trace correctly (Vincent)

   - raid1 errored write handling fix (Wei)

   - Fix blk-iolatency queue get failure handling (Yu)"

* tag 'block-5.14-2021-08-07' of git://git.kernel.dk/linux-block:
  kyber: make trace_block_rq call consistent with documentation
  block/partitions/ldm.c: Fix a kernel-doc warning
  blk-iolatency: error out if blk_get_queue() failed in iolatency_set_limit()
  n64cart: fix the dma address in n64cart_do_bvec
  s390/dasd: fix use after free in dasd path handling
  md/raid10: properly indicate failure when ending a failed write request

2 years agoMerge tag 'riscv-for-linus-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 7 Aug 2021 17:15:04 +0000 (10:15 -0700)]
Merge tag 'riscv-for-linus-5.14-rc5' of git://git./linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:

 - avoid dereferencing a null task pointer while walking the stack

 - fix the memory size in the HiFive Unleashed device tree

 - disable stack protectors when randstruct is enabled, which results in
   non-deterministic offsets during module builds

 - a pair of fixes to avoid relying on a constant physical memory base
   for the non-XIP builds

* tag 'riscv-for-linus-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  Revert "riscv: Remove CONFIG_PHYS_RAM_BASE_FIXED"
  riscv: Get rid of CONFIG_PHYS_RAM_BASE in kernel physical address conversion
  riscv: Disable STACKPROTECTOR_PER_TASK if GCC_PLUGIN_RANDSTRUCT is enabled
  riscv: dts: fix memory size for the SiFive HiFive Unmatched
  riscv: stacktrace: Fix NULL pointer dereference

2 years agoMerge tag 'kbuild-fixes-v5.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 7 Aug 2021 17:03:02 +0000 (10:03 -0700)]
Merge tag 'kbuild-fixes-v5.14-2' of git://git./linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - Correct the Extended Regular Expressions in tools

 - Adjust scripts/checkversion.pl for the current Kbuild

 - Unset sub_make_done for 'make install' to make DKMS work again

* tag 'kbuild-fixes-v5.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: cancel sub_make_done for the install target to fix DKMS
  scripts: checkversion: modernize linux/version.h search strings
  mips: Fix non-POSIX regexp
  x86/tools/relocs: Fix non-POSIX regexp

2 years agoRevert "riscv: Remove CONFIG_PHYS_RAM_BASE_FIXED"
Alexandre Ghiti [Wed, 21 Jul 2021 07:59:36 +0000 (09:59 +0200)]
Revert "riscv: Remove CONFIG_PHYS_RAM_BASE_FIXED"

This reverts commit 9b79878ced8f7ab85c57623f8b1f6882e484a316.

The removal of this config exposes CONFIG_PHYS_RAM_BASE for all kernel
types: this value being implementation-specific, this breaks the
genericity of the RISC-V kernel so revert it.

Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Tested-by: Emil Renner Berthing <kernel@esmil.dk>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2 years agoriscv: Get rid of CONFIG_PHYS_RAM_BASE in kernel physical address conversion
Alexandre Ghiti [Wed, 21 Jul 2021 07:59:35 +0000 (09:59 +0200)]
riscv: Get rid of CONFIG_PHYS_RAM_BASE in kernel physical address conversion

The usage of CONFIG_PHYS_RAM_BASE for all kernel types was a mistake:
this value is implementation-specific and this breaks the genericity of
the RISC-V kernel.

Fix this by introducing a new variable phys_ram_base that holds this
value at runtime and use it in the kernel physical address conversion
macro. Since this value is used only for XIP kernels, evaluate it only if
CONFIG_XIP_KERNEL is set which in addition optimizes this macro for
standard kernels at compile-time.

Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Tested-by: Emil Renner Berthing <kernel@esmil.dk>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Fixes: 44c922572952 ("RISC-V: enable XIP")
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2 years agokyber: make trace_block_rq call consistent with documentation
Vincent Fu [Wed, 4 Aug 2021 19:49:23 +0000 (19:49 +0000)]
kyber: make trace_block_rq call consistent with documentation

The kyber ioscheduler calls trace_block_rq_insert() *after* the request
is added to the queue but the documentation for trace_block_rq_insert()
says that the call should be made *before* the request is added to the
queue.  Move the tracepoint for the kyber ioscheduler so that it is
consistent with the documentation.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20210804194913.10497-1-vincent.fu@samsung.com
Reviewed by: Adam Manzanares <a.manzanares@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 years agoMerge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 6 Aug 2021 19:55:07 +0000 (12:55 -0700)]
Merge tag 'ext4_for_linus_stable' of git://git./linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "A regression fix, bug fix, and a comment cleanup for ext4"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: fix potential htree corruption when growing large_dir directories
  ext4: remove conflicting comment from __ext4_forget
  ext4: fix potential uninitialized access to retval in kmmpd