platform/kernel/linux-starfive.git
2 years agostaging: vc04_services: Remove repeated word in vchiq log warning
Gautam Menghani [Tue, 28 Dec 2021 10:16:15 +0000 (15:46 +0530)]
staging: vc04_services: Remove repeated word in vchiq log warning

In a log warning in vhciq code, the word 'count' is repeated twice.
Remove repeated word 'count' from vhciq log warning.
This change has been suggested by checkpatch.pl

Signed-off-by: Gautam Menghani <gautammenghani14@gmail.com>
Link: https://lore.kernel.org/r/20211228101615.5073-1-gautammenghani14@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: greybus: fix stack size warning with UBSAN
Arnd Bergmann [Thu, 9 Dec 2021 19:51:42 +0000 (12:51 -0700)]
staging: greybus: fix stack size warning with UBSAN

clang warns about excessive stack usage in this driver when
UBSAN is enabled:

drivers/staging/greybus/audio_topology.c:977:12: error: stack frame size of 1836 bytes in function 'gbaudio_tplg_create_widget' [-Werror,-Wframe-larger-than=]

Rework this code to no longer use compound literals for
initializing the structure in each case, but instead keep
the common bits in a preallocated constant array and copy
them as needed.

Link: https://github.com/ClangBuiltLinux/linux/issues/1535
Link: https://lore.kernel.org/r/20210103223541.2790855-1-arnd@kernel.org/
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[nathan: Address review comments from v1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20211209195141.1165233-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: move the steps into Hal8188EPwrSeq.c
Martin Kaiser [Sun, 19 Dec 2021 18:39:26 +0000 (19:39 +0100)]
staging: r8188: move the steps into Hal8188EPwrSeq.c

Move the power transition steps into Hal8188EPwrSeq.c where the arrays
are defined.

There's no point in having defines for sequences of steps in the include
file. All of these sequences are used only once (apart from the end
sequence).

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: reformat the power transition steps
Martin Kaiser [Sun, 19 Dec 2021 18:39:25 +0000 (19:39 +0100)]
staging: r8188: reformat the power transition steps

Clean up the definitions of the power transition steps and address some
checkpatch warnings.

Reduce the line lengths where possible. Add spaces between elements.
Rewrite comments that are in contradiction with the definition they
describe.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove unused power command
Martin Kaiser [Sun, 19 Dec 2021 18:39:24 +0000 (19:39 +0100)]
staging: r8188: remove unused power command

None of the remaining power transition steps used PWR_CMD_READ.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove base address from power transitions
Martin Kaiser [Sun, 19 Dec 2021 18:39:23 +0000 (19:39 +0100)]
staging: r8188: remove base address from power transitions

Remove the base entry from the power transition steps. This field
is not used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove interface mask from power transitions
Martin Kaiser [Sun, 19 Dec 2021 18:39:22 +0000 (19:39 +0100)]
staging: r8188: remove interface mask from power transitions

For the r8188 driver, we always have a usb interface. We can remove
the power transition steps that are not applicable for a usb interface.

We can then remove the interface mask itself.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove fab mask from power transitions
Martin Kaiser [Sun, 19 Dec 2021 18:39:21 +0000 (19:39 +0100)]
staging: r8188: remove fab mask from power transitions

Remove the fab mask from the steps of the power transitions.
The fab mask is not used, all values are allowed for all steps.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove cut mask from power transitions
Martin Kaiser [Sun, 19 Dec 2021 18:39:20 +0000 (19:39 +0100)]
staging: r8188: remove cut mask from power transitions

Remove the power cut mask from the steps of the power transitions.
The power cut mask is not used, all values are allowed for all steps.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove sizes from power transition arrays
Martin Kaiser [Sun, 19 Dec 2021 18:39:19 +0000 (19:39 +0100)]
staging: r8188: remove sizes from power transition arrays

There's no need to set the array size explicitly if an array is
initialized with a constant value. Remove the array sizes and
related definitions for the power transition arrays.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove unused power transitions
Martin Kaiser [Sun, 19 Dec 2021 18:39:18 +0000 (19:39 +0100)]
staging: r8188: remove unused power transitions

The r8188 driver defines a number of transitions between different
power states. Remove the transitions which are not used by the rest
of the code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211219183926.4746-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: ODM_BB_RA_MASK is always set
Martin Kaiser [Sat, 18 Dec 2021 12:04:23 +0000 (13:04 +0100)]
staging: r8188: ODM_BB_RA_MASK is always set

Remove the ODM_BB_RA_MASK capability. It is always set for this driver.

Like for ODM_BB_DIG before, we can be sure that ODM_BB_RA_MASK was never
checked before it was set.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: ODM_BB_DIG is always set
Martin Kaiser [Sat, 18 Dec 2021 12:04:22 +0000 (13:04 +0100)]
staging: r8188: ODM_BB_DIG is always set

Remove the ODM_BB_DIG capability. It is always set for this driver.

(ODM_BB_DIG was set in Update_ODM_ComInfo_88E and checked in odm_DIG,
which was always called after the capability was set.)

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove unused odm capabilities
Martin Kaiser [Sat, 18 Dec 2021 12:04:21 +0000 (13:04 +0100)]
staging: r8188: remove unused odm capabilities

Remove odm capabilities which are either unused or set but
never checked.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: Bssid in struct fast_ant_train is set but not used
Martin Kaiser [Sat, 18 Dec 2021 12:04:20 +0000 (13:04 +0100)]
staging: r8188: Bssid in struct fast_ant_train is set but not used

Bssid in struct fast_ant_train is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: antSumRSSI is set but not used
Martin Kaiser [Sat, 18 Dec 2021 12:04:19 +0000 (13:04 +0100)]
staging: r8188: antSumRSSI is set but not used

antSumRSSI in struct fast_ant_train is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: antRSSIcnt is set but not used
Martin Kaiser [Sat, 18 Dec 2021 12:04:18 +0000 (13:04 +0100)]
staging: r8188: antRSSIcnt is set but not used

antRSSIcnt in struct fast_ant_train is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: antAveRSSI is set but not used
Martin Kaiser [Sat, 18 Dec 2021 12:04:17 +0000 (13:04 +0100)]
staging: r8188: antAveRSSI is set but not used

antAveRSSI in struct fast_ant_train is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: remove the dummy ioctl handler
Martin Kaiser [Sat, 18 Dec 2021 12:04:16 +0000 (13:04 +0100)]
staging: r8188: remove the dummy ioctl handler

The r8188 driver installs a dummy handler for some unused ioctls. All
that the dummy handler does is return -1.

Remove the dummy handler and let the wext core handle unused ioctls.
This way, user space gets a consistent errno for an unused wext ioctl,
regardless of which driver is used for the interface.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188: make rx signal strength function static
Martin Kaiser [Sat, 18 Dec 2021 12:04:15 +0000 (13:04 +0100)]
staging: r8188: make rx signal strength function static

The _linked_rx_signal_strength_display function is used only in
rtw_mlme_ext.c. Make the function static and remove the prototype.

While at it, fix a typo in the function name.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211218120423.29906-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up rtl8188e_sreset_linked_status_check
Martin Kaiser [Sun, 12 Dec 2021 18:58:33 +0000 (19:58 +0100)]
staging: r8188eu: clean up rtl8188e_sreset_linked_status_check

Clean up the rtl8188e_sreset_linked_status_check, which has just
been moved to rtw_mlme_ext.

Don't initialise variables to 0 if the first access sets a new value.

Check the value of fw_status only once.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211212185833.22000-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: move linked status check from hal to rtw_mlme_ext
Martin Kaiser [Sun, 12 Dec 2021 18:58:32 +0000 (19:58 +0100)]
staging: r8188eu: move linked status check from hal to rtw_mlme_ext

Move rtl8188e_sreset_linked_status_check from the hal layer into
rtw_mlme_ext.c.

Like the xmit status check, this is a simple function that's only
called from one place.

With this function gone, hal/rtl8188e_sreset.c and
include/rtl8188e_sreset.h are now empty and can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211212185833.22000-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: move xmit status check from hal to rtw_cmd
Martin Kaiser [Sun, 12 Dec 2021 18:58:31 +0000 (19:58 +0100)]
staging: r8188eu: move xmit status check from hal to rtw_cmd

Move rtl8188e_sreset_xmit_status_check from the hal layer into
rtw_cmd.c.

As this driver supports only the 8188 chipset, there's no need
to go through the hal layer for simple operations that have only
one caller.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211212185833.22000-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: fix typo in a comment
Jason Wang [Sat, 11 Dec 2021 09:16:32 +0000 (17:16 +0800)]
staging: rtl8723bs: fix typo in a comment

The double `for' in the comment in line 2203 is repeated. Remove one
of them from the comment.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Link: https://lore.kernel.org/r/20211211091632.264035-1-wangborong@cdjrlc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192u: remove some repeated words in some comments
Jason Wang [Sat, 11 Dec 2021 09:14:22 +0000 (17:14 +0800)]
staging: rtl8192u: remove some repeated words in some comments

The double `new' in the comment in line 1349 and `to' in the comment in
line 2030 are repeated. Remove the repeated words from these comments.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Link: https://lore.kernel.org/r/20211211091422.260442-1-wangborong@cdjrlc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8712: Fix alignment checks with flipped condition
Ngo Tak Fong [Tue, 7 Dec 2021 21:22:23 +0000 (05:22 +0800)]
staging: rtl8712: Fix alignment checks with flipped condition

Fixed two CHECKs of Alignment should match open parenthesis and flipped
a condition to pull the code in one tab.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ngo Tak Fong <simon.fodin@gmail.com>
Link: https://lore.kernel.org/r/20211207212223.GA70594@simon-desktop
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove LedPin from struct struct LED_871x
Martin Kaiser [Tue, 7 Dec 2021 21:05:37 +0000 (22:05 +0100)]
staging: r8188eu: remove LedPin from struct struct LED_871x

We only support a single LED. LedPin in struct struct LED_871x is
always LED_PIN_LED0. There's no need to store this info or to pass it
to functions as a parameter.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211207210537.23382-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove code to set led1 registers
Martin Kaiser [Tue, 7 Dec 2021 21:05:36 +0000 (22:05 +0100)]
staging: r8188eu: remove code to set led1 registers

This driver uses only led0. Remove the register settings to switch led1
on and off.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211207210537.23382-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove SwLed1
Martin Kaiser [Tue, 7 Dec 2021 21:05:35 +0000 (22:05 +0100)]
staging: r8188eu: remove SwLed1

The r8188eu driver does not use SwLed1. Calls from other layers to modify
the led state end up in SwLedControlMode1, where SwLed0 is hard-coded.

This patch removes the code to initialise and deinitialise SwLed1 and
the SwLed1 struct itself.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211207210537.23382-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert type of HalData in struct adapter
Michael Straube [Tue, 7 Dec 2021 14:04:05 +0000 (15:04 +0100)]
staging: r8188eu: convert type of HalData in struct adapter

adapter->HalData is used in the GET_HAL_DATA macro all across the
driver code but nobody checks if its allocation in
rtl188eu_alloc_haldata() was successful or not.

To avoid errors when the allocation fails convert the type of field
HalData from void pointer to struct hal_data_8188eu. Remove
GET_HAL_DATA, rtl8188eu_alloc_haldata(), rtl8188e_free_hal_data().

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211207140405.8673-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert/remove DBG_88E calls in core/rtw_cmd.c
Phillip Potter [Mon, 6 Dec 2021 23:49:52 +0000 (23:49 +0000)]
staging: r8188eu: convert/remove DBG_88E calls in core/rtw_cmd.c

Convert two DBG_88E calls within core/rtw_cmd.c to netdev_dbg calls, and
remove three commented DBG_88E calls. Considering the original driver
author commented them, it seems better to delete these three than
convert.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211206234952.1238-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E calls in core/rtw_security.c
Phillip Potter [Mon, 6 Dec 2021 23:49:51 +0000 (23:49 +0000)]
staging: r8188eu: convert DBG_88E calls in core/rtw_security.c

Convert all DBG_88E calls in core/rtw_security.c to netdev_dbg calls.
These calls seem to contain useful information/assertions and so are
probably worth keeping. In doing this conversion, also convert
static aes_decipher to take a struct adapter * parameter, as per the
convention elsewhere in the driver currently. This allows us to pass
this through and access its pnetdev member for the netdev_dbg call in
the function.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211206234952.1238-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused macro IS_FW_81xxC
Michael Straube [Sun, 5 Dec 2021 17:13:42 +0000 (18:13 +0100)]
staging: r8188eu: remove unused macro IS_FW_81xxC

The macro IS_FW_81xxC is not used. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: bWIFI_Display is set but never used
Michael Straube [Sun, 5 Dec 2021 17:13:41 +0000 (18:13 +0100)]
staging: r8188eu: bWIFI_Display is set but never used

bWIFI_Display in odm_dm_struct is set but never used. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: bWIFI_Direct is set but never used
Michael Straube [Sun, 5 Dec 2021 17:13:40 +0000 (18:13 +0100)]
staging: r8188eu: bWIFI_Direct is set but never used

bWIFI_Direct in odm_dm_struct is set but never used. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove duplicate defines
Michael Straube [Sun, 5 Dec 2021 17:13:39 +0000 (18:13 +0100)]
staging: r8188eu: remove duplicate defines

The following constants are defined in three different header files.

IQK_MAC_REG_NUM
IQK_ADDA_REG_NUM
IQK_BB_REG_NUM
HP_THERMAL_NUM

Keep them in odm.h and remove them from Hal8188EPhyCfg.h and
rtl8188e_dm.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove macro PHY_QueryBBReg
Michael Straube [Sun, 5 Dec 2021 17:13:38 +0000 (18:13 +0100)]
staging: r8188eu: remove macro PHY_QueryBBReg

The macro PHY_QueryBBReg just re-defines rtl8188e_PHY_QueryBBReg().
Call rtl8188e_PHY_QueryBBReg() directly and remove the macro.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove macro PHY_SetBBReg
Michael Straube [Sun, 5 Dec 2021 17:13:37 +0000 (18:13 +0100)]
staging: r8188eu: remove macro PHY_SetBBReg

The macro PHY_SetBBReg just re-defines rtl8188e_PHY_SetBBReg().
Call rtl8188e_PHY_SetBBReg() directly and remove the macro.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove macro PHY_QueryRFReg
Michael Straube [Sun, 5 Dec 2021 17:13:36 +0000 (18:13 +0100)]
staging: r8188eu: remove macro PHY_QueryRFReg

The macro PHY_QueryRFReg just re-defines rtl8188e_PHY_QueryRFReg().
Call rtl8188e_PHY_QueryRFReg() directly and remove the macro.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove macro PHY_SetRFReg
Michael Straube [Sun, 5 Dec 2021 17:13:35 +0000 (18:13 +0100)]
staging: r8188eu: remove macro PHY_SetRFReg

The macro PHY_SetRFReg just re-defines rtl8188e_PHY_SetRFReg().
Call rtl8188e_PHY_SetRFReg() directly and remove the macro.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: struct odm_mac_status_info is not used
Michael Straube [Sun, 5 Dec 2021 17:13:34 +0000 (18:13 +0100)]
staging: r8188eu: struct odm_mac_status_info is not used

The structure odm_mac_status_info is not used. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove RF_PATH_{C,D}
Michael Straube [Sun, 5 Dec 2021 17:13:33 +0000 (18:13 +0100)]
staging: r8188eu: remove RF_PATH_{C,D}

pHalData->PHYRegDef[RF_PATH_C] and pHalData->PHYRegDef[RF_PATH_D]
are initialized but not used. Remove them and remove RF_PATH_C and
RF_PATH_D from the rf_radio_path enum.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211205171342.20551-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: AntCombination is always 2
Martin Kaiser [Sun, 5 Dec 2021 15:12:51 +0000 (16:12 +0100)]
staging: r8188eu: AntCombination is always 2

AntCombination is initialized with 2 and never changed. Remove
resulting dead code.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused define
Martin Kaiser [Sun, 5 Dec 2021 15:12:50 +0000 (16:12 +0100)]
staging: r8188eu: remove unused define

Remove the _IOCTL_LINUX_C_ define, which is not used.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove two write-only wifi direct variables
Martin Kaiser [Sun, 5 Dec 2021 15:12:49 +0000 (16:12 +0100)]
staging: r8188eu: remove two write-only wifi direct variables

Remove two variables related to wifidirect which are set but not used.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove empty HAL_INIT_PROFILE_TAG macro
Martin Kaiser [Sun, 5 Dec 2021 15:12:48 +0000 (16:12 +0100)]
staging: r8188eu: remove empty HAL_INIT_PROFILE_TAG macro

Remove the HAL_INIT_PROFILE_TAG macro, which is empty.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: hal data's interfaceIndex is never read
Martin Kaiser [Sun, 5 Dec 2021 15:12:47 +0000 (16:12 +0100)]
staging: r8188eu: hal data's interfaceIndex is never read

interfaceIndex in struct hal_data_8188e is set but not used.
It can be removed.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused macros from drv_types.h
Martin Kaiser [Sun, 5 Dec 2021 15:12:46 +0000 (16:12 +0100)]
staging: r8188eu: remove unused macros from drv_types.h

Remove some unused macros from drv_types.h.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: bHWPowerdown is set but not used
Martin Kaiser [Sun, 5 Dec 2021 15:12:45 +0000 (16:12 +0100)]
staging: r8188eu: bHWPowerdown is set but not used

bHWPowerdown in struct pwrctrl_priv is set but never read. Remove it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove two unused macros
Martin Kaiser [Sun, 5 Dec 2021 15:12:44 +0000 (16:12 +0100)]
staging: r8188eu: remove two unused macros

Remove two unused macros that increment and decrement a "mutex counter".

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove a bunch of unused led defines
Martin Kaiser [Sun, 5 Dec 2021 15:12:43 +0000 (16:12 +0100)]
staging: r8188eu: remove a bunch of unused led defines

Remove a couple of unused defines from rtw_led.h.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: bLedOpenDrain is always true for r8188eu
Martin Kaiser [Sun, 5 Dec 2021 15:12:42 +0000 (16:12 +0100)]
staging: r8188eu: bLedOpenDrain is always true for r8188eu

Remove the bLedOpenDrain variable and code that would be executed only
if bLedOpenDrain was false.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211205151251.6861-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix coding style error
Abdun Nihaal [Wed, 1 Dec 2021 15:30:39 +0000 (21:00 +0530)]
staging: r8188eu: Fix coding style error

Move opening brace to next line to conform to kernel coding style.

Fixes the following checkpatch error:
ERROR: open brace '{' following function definitions go on the next line

Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Link: https://lore.kernel.org/r/20211201153039.305245-1-abdun.nihaal@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: pNumRxBytesUnicast is set but never used
Michael Straube [Thu, 2 Dec 2021 19:23:09 +0000 (20:23 +0100)]
staging: r8188eu: pNumRxBytesUnicast is set but never used

pNumRxBytesUnicast in odm_dm_struct is set but never used.
Remove it.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211202192309.9362-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: pNumTxBytesUnicast is set but never used
Michael Straube [Thu, 2 Dec 2021 19:23:08 +0000 (20:23 +0100)]
staging: r8188eu: pNumTxBytesUnicast is set but never used

pNumTxBytesUnicast in odm_dm_struct is set but never used.
Remove it.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211202192309.9362-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: pSecurity is set but never used
Michael Straube [Thu, 2 Dec 2021 19:23:07 +0000 (20:23 +0100)]
staging: r8188eu: pSecurity is set but never used

pSecurity in odm_dm_struct is set but never used. Remove it.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211202192309.9362-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: pbNet_closed is set but never used
Michael Straube [Thu, 2 Dec 2021 19:23:06 +0000 (20:23 +0100)]
staging: r8188eu: pbNet_closed is set but never used

pbNet_closed in odm_dm_struct is set but never used. Remove it.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211202192309.9362-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused variables from odm_dm_struct
Michael Straube [Thu, 2 Dec 2021 19:23:05 +0000 (20:23 +0100)]
staging: r8188eu: remove unused variables from odm_dm_struct

There are many unused variables in the odm_dm_struct structure.
Remove them.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211202192309.9362-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: RFType is set but never used
Michael Straube [Mon, 29 Nov 2021 23:01:25 +0000 (00:01 +0100)]
staging: r8188eu: RFType is set but never used

RFType is set but never used. Remove it from struct HAL_VERSION and
remove the now unused enum HAL_RF_TYPE.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211129230125.27247-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use a delayed worker for led updates
Martin Kaiser [Fri, 26 Nov 2021 11:41:35 +0000 (12:41 +0100)]
staging: r8188eu: use a delayed worker for led updates

The led layer uses a combination of timer and worker for periodic led
updates, e.g. for blinking. The reason seems to be that blocking
operations like a usb read are not allowed in a timer handler.

Replace the combination of timer and worker with a delayed worker.

Convert the timeout defines from milliseconds to jiffies to make them
usable as delays for the delayed worker. Shorten the names of the defines
and rename the work item to make checkpatch happy.

Other layers may call SwLedControlMode1 to update the led state. Such
an update may result in cancelling the delayed worker. SwLedControlMode1
might be called in interrupt context, we must use cancel_delayed_work to
cancel the worker. cancel_delayed_work_sync waits until the worker is
finished, this is not allowed in interrupt context.

DeInitLed871x is called when the driver is removed or when the system
goes into standby. We may use cancel_delayed_work_sync here to cancel
the delayed worker.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126114135.18228-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove DBG_88E_LEVEL macro from include/rtw_debug.h
Phillip Potter [Mon, 29 Nov 2021 00:20:41 +0000 (00:20 +0000)]
staging: r8188eu: remove DBG_88E_LEVEL macro from include/rtw_debug.h

Remove the DBG_88E_LEVEL macro definition from include/rtw_debug.h, as
it has no callers and is surplus to requirements. This is motivated by
ongoing efforts to remove all non-standard debugging code from the
driver.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211129002041.865-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E_LEVEL calls in os_dep/ioctl_linux.c
Phillip Potter [Mon, 29 Nov 2021 00:20:40 +0000 (00:20 +0000)]
staging: r8188eu: convert DBG_88E_LEVEL calls in os_dep/ioctl_linux.c

Convert all DBG_88E_LEVEL macro calls in os_dep/ioctl_linux.c to plain
netdev_dbg calls, as although the information is potentially useful,
we should be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211129002041.865-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E_LEVEL call in hal/rtl8188e_hal_init.c
Phillip Potter [Mon, 29 Nov 2021 00:20:39 +0000 (00:20 +0000)]
staging: r8188eu: convert DBG_88E_LEVEL call in hal/rtl8188e_hal_init.c

Convert DBG_88E_LEVEL macro call in hal/rtl8188e_hal_init.c to plain
dev_dbg call, as although the information is potentially useful, we should
be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211129002041.865-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_ioctl_set.c
Phillip Potter [Mon, 29 Nov 2021 00:20:38 +0000 (00:20 +0000)]
staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_ioctl_set.c

Convert all DBG_88E_LEVEL macro calls in core/rtw_ioctl_set.c to plain
netdev_dbg calls, as although the information is potentially useful,
we should be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211129002041.865-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E_LEVEL call in core/rtw_xmit.c
Phillip Potter [Mon, 29 Nov 2021 00:20:37 +0000 (00:20 +0000)]
staging: r8188eu: convert DBG_88E_LEVEL call in core/rtw_xmit.c

Convert single DBG_88E_LEVEL macro call in core/rtw_xmit.c to plain
netdev_dbg call, as although the information is potentially useful,
we should be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211129002041.865-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_pwrctrl.c
Phillip Potter [Mon, 29 Nov 2021 00:20:36 +0000 (00:20 +0000)]
staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_pwrctrl.c

Convert all DBG_88E_LEVEL macro calls in core/rtw_pwrctrl.c to plain
netdev_dbg calls, as although the information is potentially useful,
we should be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211129002041.865-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_mlme_ext.c
Phillip Potter [Mon, 29 Nov 2021 00:20:35 +0000 (00:20 +0000)]
staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_mlme_ext.c

Convert all DBG_88E_LEVEL macro calls in core/rtw_mlme_ext.c to plain
netdev_dbg calls, as although the information is potentially useful, we
should be exposing it using standard kernel debugging functionality.

Also fix some indentation issues in the block of one such call, and
remove usage of FUNC_ADPT_FMT/FUNC_ADPT_ARG macros in another, as
netdev_dbg provides equivalent functionality.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20211129002041.865-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove module parameter rtw_rf_config
Michael Straube [Sun, 28 Nov 2021 17:09:24 +0000 (18:09 +0100)]
staging: r8188eu: remove module parameter rtw_rf_config

The module parameter rtw_rf_config is not used in the driver.
Remove it and remove the now unused enum rt_rf_type_def.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-11-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rf_type from struct hal_data_8188e
Michael Straube [Sun, 28 Nov 2021 17:09:23 +0000 (18:09 +0100)]
staging: r8188eu: remove rf_type from struct hal_data_8188e

The field rf_type of struct hal_data_8188e is set to RF_1T1R and
never changed. Also it is used only in a call to netdev_dbg() which
is not very useful since RTL8188EU chips are always 1T1R. Remove
the netdev_dbg() and remove rf_type from the hal_data_8188e
structure.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-10-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused HW_VAR_RF_TYPE
Michael Straube [Sun, 28 Nov 2021 17:09:22 +0000 (18:09 +0100)]
staging: r8188eu: remove unused HW_VAR_RF_TYPE

After previous cleanups HW_VAR_RF_TYPE is unused now.
Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rf_type from bb_reg_dump()
Michael Straube [Sun, 28 Nov 2021 17:09:21 +0000 (18:09 +0100)]
staging: r8188eu: remove rf_type from bb_reg_dump()

rf_type is always RF_1T1R. Remove it from bb_reg_dump() and remove
resulting dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rf_type from writeOFDMPowerReg88E()
Michael Straube [Sun, 28 Nov 2021 17:09:20 +0000 (18:09 +0100)]
staging: r8188eu: remove rf_type from writeOFDMPowerReg88E()

pHalData->rf_type is always RF_1T1R. Remove unnecessary checks from
writeOFDMPowerReg88E().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove TxCount from getTxPowerIndex88E()
Michael Straube [Sun, 28 Nov 2021 17:09:19 +0000 (18:09 +0100)]
staging: r8188eu: remove TxCount from getTxPowerIndex88E()

In getTxPowerIndex88E() the variable TxCount is set to RF_PATH_A and
never changed. Remove the unnecessary extra variable and replace its
usage with RF_PATH_A.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rf_type from getTxPowerIndex88E()
Michael Straube [Sun, 28 Nov 2021 17:09:18 +0000 (18:09 +0100)]
staging: r8188eu: remove rf_type from getTxPowerIndex88E()

pHalData->rf_type is always RF_1T1R. As a result the variable
path_nums is always set to 1 and the for loop is entered only
once with TxCount = 0. Also RF_PATH_A = 0. Remove the unneeded
check for pHalData->rf_type and resulting dead code from
getTxPowerIndex88E().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rf_type from storePwrIndexDiffRateOffset()
Michael Straube [Sun, 28 Nov 2021 17:09:17 +0000 (18:09 +0100)]
staging: r8188eu: remove rf_type from storePwrIndexDiffRateOffset()

pHalData->rf_type is always RF_1T1R. Remove unnecessary checks and
related dead code from storePwrIndexDiffRateOffset().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rf_type from issue_assocreq()
Michael Straube [Sun, 28 Nov 2021 17:09:16 +0000 (18:09 +0100)]
staging: r8188eu: remove rf_type from issue_assocreq()

rf_type is always RF_1T1R. Remove it from issue_assocreq() and remove
related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove rf_type from rtw_update_ht_cap()
Michael Straube [Sun, 28 Nov 2021 17:09:15 +0000 (18:09 +0100)]
staging: r8188eu: remove rf_type from rtw_update_ht_cap()

rf_type is always RF_1T1R. Remove it from rtw_update_ht_cap() and
remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211128170924.5874-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: loadparam needs no net_device
Martin Kaiser [Fri, 26 Nov 2021 13:04:00 +0000 (14:04 +0100)]
staging: r8188eu: loadparam needs no net_device

Remove the second parameter of the loadparam function. This parameter
is not used.

Reviewed-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126130400.26151-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove _ps_close_RF
Martin Kaiser [Fri, 26 Nov 2021 13:03:59 +0000 (14:03 +0100)]
staging: r8188eu: remove _ps_close_RF

The _ps_close_RF is empty. Remove it.

Reviewed-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126130400.26151-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove _ps_open_RF
Martin Kaiser [Fri, 26 Nov 2021 13:03:58 +0000 (14:03 +0100)]
staging: r8188eu: remove _ps_open_RF

The _ps_open_RF function is empty. Remove it.

Reviewed-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126130400.26151-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove pm_netdev_open
Martin Kaiser [Fri, 26 Nov 2021 13:03:57 +0000 (14:03 +0100)]
staging: r8188eu: remove pm_netdev_open

The only caller of pm_netdev_open sets bnormal to true. In this case,
pm_netdev_open just calls netdev_open.

Remove pm_netdev_open and call netdev_open directly.

Reviewed-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126130400.26151-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: require a single bulk in endpoint
Martin Kaiser [Fri, 26 Nov 2021 17:32:05 +0000 (18:32 +0100)]
staging: r8188eu: require a single bulk in endpoint

The current r8188eu driver code has no support for interrupt in
endpoints. Some parts of the code assume implicitly that we use
one single bulk in endpoint for the incoming network data.

Make this assumption clearer and reject devices that have more than
one bulk in endpoint. Ignore any interrupt in endpoints.

We can then change RtInPipe into a single value instead of an array.
There's no need any more to pass around the number of in endpoints.
We know that it's one or the device would have been rejected.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126173205.21352-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: don't store nr_endpoint in a global struct
Martin Kaiser [Fri, 26 Nov 2021 17:32:04 +0000 (18:32 +0100)]
staging: r8188eu: don't store nr_endpoint in a global struct

There's no need to store the number of endpoints in a global struct.
We only need it at startup when we iterate over the endpoints.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126173205.21352-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove ep_num array
Martin Kaiser [Fri, 26 Nov 2021 17:32:03 +0000 (18:32 +0100)]
staging: r8188eu: remove ep_num array

The ep_num array in struct dvobj_priv is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126173205.21352-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: if2 is not used
Martin Kaiser [Fri, 26 Nov 2021 17:32:02 +0000 (18:32 +0100)]
staging: r8188eu: if2 is not used

Remove if2 from struct dvobj_priv. It is not used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126173205.21352-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove code to get int in pipe handle
Martin Kaiser [Fri, 26 Nov 2021 17:32:01 +0000 (18:32 +0100)]
staging: r8188eu: remove code to get int in pipe handle

After the previous cleanup, ffaddr2pipehdl is called only by
rtw_write_port. This function will never ask for the pipe handle
of the interrupt in pipe. We can remove the related code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126173205.21352-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: get the rcv bulk pipe handle directly
Martin Kaiser [Fri, 26 Nov 2021 17:32:00 +0000 (18:32 +0100)]
staging: r8188eu: get the rcv bulk pipe handle directly

There's no point in calling ffaddr2pipehdl from rtw_read_port if the
endpoint address is constant. We can call usb_rcvbulkpipe ourselves
to get the pipe handle.

We can now remove RECV_BULK_IN_ADDR.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126173205.21352-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: only the bulk in ep is used for network data
Martin Kaiser [Fri, 26 Nov 2021 17:31:59 +0000 (18:31 +0100)]
staging: r8188eu: only the bulk in ep is used for network data

All supported devices use a single bulk in endpoint for receiving
network data.

The rtw_read_port function needs no addr parameter. The ff_hwaddr in
struct recv_priv is also a constant value. We can use RECV_BULK_IN_ADDR
directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126173205.21352-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rtw_read_port needs no cnt parameter
Martin Kaiser [Fri, 26 Nov 2021 17:31:58 +0000 (18:31 +0100)]
staging: r8188eu: rtw_read_port needs no cnt parameter

The cnt parameter in the rtw_read_port function is not used.
Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211126173205.21352-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: rtllib_module: remove unnecessary assignment
Yang Yingliang [Thu, 2 Dec 2021 03:07:04 +0000 (11:07 +0800)]
staging: rtl8192e: rtllib_module: remove unnecessary assignment

Remove the null pointer assignment after freeing 'ieee->pHTInfo'.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211202030704.2425621-4-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: rtllib_module: fix error handle case in alloc_rtllib()
Yang Yingliang [Thu, 2 Dec 2021 03:07:03 +0000 (11:07 +0800)]
staging: rtl8192e: rtllib_module: fix error handle case in alloc_rtllib()

Some variables are leaked in the error handling in alloc_rtllib(), free
the variables in the error path.

Fixes: 94a799425eee ("From: wlanfae <wlanfae@realtek.com>")
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211202030704.2425621-3-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: return error code from rtllib_softmac_init()
Yang Yingliang [Thu, 2 Dec 2021 03:07:02 +0000 (11:07 +0800)]
staging: rtl8192e: return error code from rtllib_softmac_init()

If it fails to allocate 'dot11d_info', rtllib_softmac_init()
should return error code. And remove unneccessary error message.

Fixes: 94a799425eee ("From: wlanfae <wlanfae@realtek.com>")
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211202030704.2425621-2-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192u: make array queuetopipe static const
Colin Ian King [Mon, 29 Nov 2021 22:50:13 +0000 (22:50 +0000)]
staging: rtl8192u: make array queuetopipe static const

 Don't populate the array queuetopipe on the stack but instead make it
static const. Also makes the object code smaller by ~50 bytes.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20211129225013.524016-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: refactor camelcase uCurrRSSI to current_rssi
Alberto Merciai [Sat, 27 Nov 2021 10:08:02 +0000 (11:08 +0100)]
staging: vt6655: refactor camelcase uCurrRSSI to current_rssi

Replace camelcase variable "uCurrRSSI" (current Received Signal Strength
Indicator) into linux kernel coding style equivalent
variable "current_rssi".

Signed-off-by: Alberto Merciai <alb3rt0.m3rciai@gmail.com>
Link: https://lore.kernel.org/r/20211127100807.3113388-1-alb3rt0.m3rciai@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: fbtft: sh1106: use new macro FBTFT_REGISTER_SPI_DRIVER
Heiner Kallweit [Wed, 1 Dec 2021 21:04:07 +0000 (22:04 +0100)]
staging: fbtft: sh1106: use new macro FBTFT_REGISTER_SPI_DRIVER

Make fb_sh1106 the first user of new macro FBTFT_REGISTER_SPI_DRIVER.
In addition the MODULE_ALIASes can be removed. Module auto-loading
was successfully tested with a SH1106-based OLED module connected
to an Odroid C2.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/65516be1-9588-af00-cf4f-053e20af9b45@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: fbtft: add macro FBTFT_REGISTER_SPI_DRIVER
Heiner Kallweit [Wed, 1 Dec 2021 21:02:47 +0000 (22:02 +0100)]
staging: fbtft: add macro FBTFT_REGISTER_SPI_DRIVER

After 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT
compatible") we need to add spi id_tables. Changing existing macro
FBTFT_REGISTER_DRIVER would have meant to change arguments and
therefore adjust all fbtft drivers.

This patch adds a new and simplified macro FBTFT_REGISTER_SPI_DRIVER
that includes a spi id_table, and in addition to that:
- does not define a platform driver
- uses macro module_spi_driver()

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/a58b3bc9-27a2-3f16-dd92-e597666a0263@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoMerge 5.16-rc3 into staging-next
Greg Kroah-Hartman [Mon, 29 Nov 2021 07:03:05 +0000 (08:03 +0100)]
Merge 5.16-rc3 into staging-next

We need the staging driver fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoLinux 5.16-rc3
Linus Torvalds [Sun, 28 Nov 2021 22:09:19 +0000 (14:09 -0800)]
Linux 5.16-rc3

2 years agoMerge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Linus Torvalds [Sun, 28 Nov 2021 19:58:52 +0000 (11:58 -0800)]
Merge tag 'for_linus' of git://git./linux/kernel/git/mst/vhost

Pull vhost,virtio,vdpa bugfixes from Michael Tsirkin:
 "Misc fixes all over the place.

  Revert of virtio used length validation series: the approach taken
  does not seem to work, breaking too many guests in the process. We'll
  need to do length validation using some other approach"

[ This merge also ends up reverting commit f7a36b03a732 ("vsock/virtio:
  suppress used length validation"), which came in through the
  networking tree in the meantime, and was part of that whole used
  length validation series   - Linus ]

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  vdpa_sim: avoid putting an uninitialized iova_domain
  vhost-vdpa: clean irqs before reseting vdpa device
  virtio-blk: modify the value type of num in virtio_queue_rq()
  vhost/vsock: cleanup removing `len` variable
  vhost/vsock: fix incorrect used length reported to the guest
  Revert "virtio_ring: validate used buffer length"
  Revert "virtio-net: don't let virtio core to validate used length"
  Revert "virtio-blk: don't let virtio core to validate used length"
  Revert "virtio-scsi: don't let virtio core to validate used buffer length"

2 years agoMerge tag 'x86-urgent-2021-11-28' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 28 Nov 2021 17:24:50 +0000 (09:24 -0800)]
Merge tag 'x86-urgent-2021-11-28' of git://git./linux/kernel/git/tip/tip

Pull x86 build fix from Thomas Gleixner:
 "A single fix for a missing __init annotation of prepare_command_line()"

* tag 'x86-urgent-2021-11-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/boot: Mark prepare_command_line() __init