linux.git
3 years agostaging: most: dim2: do not double-register the same device
Nikita Yushchenko [Mon, 11 Oct 2021 06:11:18 +0000 (09:11 +0300)]
staging: most: dim2: do not double-register the same device

Commit 723de0f9171e ("staging: most: remove device from interface
structure") moved registration of driver-provided struct device to
the most subsystem.

Dim2 used to register the same struct device to provide a custom device
attribute. This causes double-registration of the same struct device.

Fix that by moving the custom attribute to driver's dev_groups.
This moves attribute to the platform_device object, which is a better
location for platform-specific attributes anyway.

Fixes: 723de0f9171e ("staging: most: remove device from interface structure")
Acked-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Link: https://lore.kernel.org/r/20211011061117.21435-1-nikita.yoush@cogentembedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: odm SupportPlatform is always ODM_CE
Martin Kaiser [Mon, 11 Oct 2021 20:11:59 +0000 (22:11 +0200)]
staging: r8188eu: odm SupportPlatform is always ODM_CE

Remove the SupportPlatform entry of struct odm_dm_struct and any code
that depends on SupportPlatform != ODM_CE.

Merge functions in places where there was a "top-level function" that
would select a "sub-function" based on SupportPlatform.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211011201159.10252-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: odm BoardType is never set
Martin Kaiser [Mon, 11 Oct 2021 20:11:58 +0000 (22:11 +0200)]
staging: r8188eu: odm BoardType is never set

odm BoardType is never set, so it's always 0 (ODM_BOARD_NORMAL).
Remove dead code and the BoardType itself.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211011201159.10252-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm_SwAntDivInit
Martin Kaiser [Mon, 11 Oct 2021 20:11:57 +0000 (22:11 +0200)]
staging: r8188eu: remove odm_SwAntDivInit

This function is empty, it can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211011201159.10252-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: SupportICType is always ODM_RTL8188E
Martin Kaiser [Mon, 11 Oct 2021 20:11:56 +0000 (22:11 +0200)]
staging: r8188eu: SupportICType is always ODM_RTL8188E

SupportICType in struct odm_dm_struct is always ODM_RTL8188E. Remove the
component and code that is executed only for other types.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211011201159.10252-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove LastMinUndecoratedPWDBForDM
Martin Kaiser [Mon, 11 Oct 2021 20:11:55 +0000 (22:11 +0200)]
staging: r8188eu: remove LastMinUndecoratedPWDBForDM

LastMinUndecoratedPWDBForDM in struct dm_priv is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211011201159.10252-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove rtl8188e_deinit_dm_priv
Martin Kaiser [Mon, 11 Oct 2021 20:11:54 +0000 (22:11 +0200)]
staging: r8188eu: remove rtl8188e_deinit_dm_priv

This function is empty and can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211011201159.10252-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: simplify rtl8188e_HalDmWatchDog
Martin Kaiser [Mon, 11 Oct 2021 20:11:53 +0000 (22:11 +0200)]
staging: r8188eu: simplify rtl8188e_HalDmWatchDog

Now that we don't call dm_CheckStatistics any more, we don't need
fw_cur_in_ps and fw_ps_awake.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211011201159.10252-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove dm_CheckStatistics
Martin Kaiser [Mon, 11 Oct 2021 20:11:52 +0000 (22:11 +0200)]
staging: r8188eu: remove dm_CheckStatistics

The dm_CheckStatistics function is empty. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211011201159.10252-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm ext lna info
Martin Kaiser [Sun, 10 Oct 2021 17:52:04 +0000 (19:52 +0200)]
staging: r8188eu: remove odm ext lna info

The ext lna info is never set. Remove it and fix up the one place
where it's read.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm ext pa info
Martin Kaiser [Sun, 10 Oct 2021 17:52:03 +0000 (19:52 +0200)]
staging: r8188eu: remove odm ext pa info

The ext pa info is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm ext trsw info
Martin Kaiser [Sun, 10 Oct 2021 17:52:02 +0000 (19:52 +0200)]
staging: r8188eu: remove odm ext trsw info

The ext trsw info is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm hct test info
Martin Kaiser [Sun, 10 Oct 2021 17:52:01 +0000 (19:52 +0200)]
staging: r8188eu: remove odm hct test info

The "in hct test" variable is never set, it's always 0.

Remove the variable and fix up the one place where it was used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm wifi test info
Martin Kaiser [Sun, 10 Oct 2021 17:52:00 +0000 (19:52 +0200)]
staging: r8188eu: remove odm wifi test info

The wifi test info is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm dualmac smart concurrent info
Martin Kaiser [Sun, 10 Oct 2021 17:51:59 +0000 (19:51 +0200)]
staging: r8188eu: remove odm dualmac smart concurrent info

The dualmac smart concurrent info is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm cut version info
Martin Kaiser [Sun, 10 Oct 2021 17:51:58 +0000 (19:51 +0200)]
staging: r8188eu: remove odm cut version info

The cut version info is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm fab version info
Martin Kaiser [Sun, 10 Oct 2021 17:51:57 +0000 (19:51 +0200)]
staging: r8188eu: remove odm fab version info

The fab version info is set but not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: RfOnOffDetect is unused
Martin Kaiser [Sun, 10 Oct 2021 17:51:56 +0000 (19:51 +0200)]
staging: r8188eu: RfOnOffDetect is unused

Remove the RfOnOffDetect function, which is not used.

Suggested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove specific device table
Martin Kaiser [Sun, 10 Oct 2021 17:51:55 +0000 (19:51 +0200)]
staging: r8188eu: remove specific device table

This driver implements a mechanism to set additional configuration flags
per supported usb device.

None of the supported devices uses these additional flags. Remove the data
types and the code to process the flags.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove an unused define
Martin Kaiser [Sun, 10 Oct 2021 17:51:54 +0000 (19:51 +0200)]
staging: r8188eu: remove an unused define

_HCI_INTF_C_ is not used and can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211010175204.24029-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vt6655: fix camelcase in byLocalID
Tommaso Merciai [Sun, 10 Oct 2021 21:59:45 +0000 (23:59 +0200)]
staging: vt6655: fix camelcase in byLocalID

Replace camel case variable name for variable byLocalID
with snake case equivalent.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Link: https://lore.kernel.org/r/20211010220014.148785-1-tomm.merciai@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: hal: remove duplicate check
Saurav Girepunje [Sun, 10 Oct 2021 07:08:45 +0000 (12:38 +0530)]
staging: rtl8723bs: hal: remove duplicate check

Remove 'bPerformance' from if condition check. As on previous
if condition it is already check for same variable.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YWKRfYpTioAmTWa0@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove enum _RTL8712_RF_MIMO_CONFIG_
Michael Straube [Sat, 9 Oct 2021 10:44:19 +0000 (12:44 +0200)]
staging: r8188eu: remove enum _RTL8712_RF_MIMO_CONFIG_

The enum _RTL8712_RF_MIMO_CONFIG_ is not used, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211009104419.8811-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: replace MACADDRLEN with ETH_ALEN
Michael Straube [Sat, 9 Oct 2021 10:44:18 +0000 (12:44 +0200)]
staging: r8188eu: replace MACADDRLEN with ETH_ALEN

Replace the custom constant MACADDRLEN with in-kernel ETH_ALEN.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211009104419.8811-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove unused macros and defines from rtl8188e_hal.h
Michael Straube [Sat, 9 Oct 2021 10:44:17 +0000 (12:44 +0200)]
staging: r8188eu: remove unused macros and defines from rtl8188e_hal.h

Remove unused macros and defines from rtl8188e_hal.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211009104419.8811-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove some dead code
Michael Straube [Fri, 8 Oct 2021 17:26:21 +0000 (19:26 +0200)]
staging: r8188eu: remove some dead code

In this driver SupportICType is ODM_RTL8188E and SupportInterface is
ODM_ITRF_USB. Remove an if statement that is never true and remove
function odm_DIGbyRSSI_LPS() which is used only in this dead if block.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211008172621.8721-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove unused defines from rtw_sreset.h
Michael Straube [Fri, 8 Oct 2021 10:02:09 +0000 (12:02 +0200)]
staging: r8188eu: remove unused defines from rtw_sreset.h

Remove unused defines from rtw_sreset.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211008100209.28801-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: rename rtl8188eu_set_hal_ops()
Michael Straube [Thu, 7 Oct 2021 10:39:43 +0000 (12:39 +0200)]
staging: r8188eu: rename rtl8188eu_set_hal_ops()

After the removal of struct hal_ops function rtl8188eu_set_hal_ops()
only allocates memory for adapt->HalData. Rename the function to
rtl8188eu_alloc_haldata() to reflect what it actually does.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211007103943.8433-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove hal_ops
Michael Straube [Thu, 7 Oct 2021 10:39:42 +0000 (12:39 +0200)]
staging: r8188eu: remove hal_ops

Remove the last pointer hal_deinit from struct hal_ops and call
rtl8188eu_hal_deinit() directly. Remove the now empty struct
hal_ops.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211007103943.8433-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove hal_init from hal_ops
Michael Straube [Thu, 7 Oct 2021 10:39:41 +0000 (12:39 +0200)]
staging: r8188eu: remove hal_init from hal_ops

Remove hal_init from struct hal_ops and call rtl8188eu_hal_init()
directly.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211007103943.8433-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove GetHwRegHandler from hal_ops
Michael Straube [Thu, 7 Oct 2021 10:39:40 +0000 (12:39 +0200)]
staging: r8188eu: remove GetHwRegHandler from hal_ops

Remove GetHwRegHandler from struct hal_ops and remove the wrapper
rtw_hal_get_hwreg(). Call GetHwReg8188EU() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211007103943.8433-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove SetHwRegHandler from hal_ops
Michael Straube [Thu, 7 Oct 2021 10:39:39 +0000 (12:39 +0200)]
staging: r8188eu: remove SetHwRegHandler from hal_ops

Remove SetHwRegHandler from struct hal_ops and remove the wrapper
rtw_hal_set_hwreg(). Call SetHwReg8188EU() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211007103943.8433-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: merge two signal scale mapping functions
Martin Kaiser [Wed, 6 Oct 2021 09:09:49 +0000 (11:09 +0200)]
staging: r8188eu: merge two signal scale mapping functions

Keep the odm_SignalScaleMapping function and remove
odm_SignalScaleMapping_92CSeries.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211006090949.1694-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: Odm PatchID is always 0
Martin Kaiser [Wed, 6 Oct 2021 09:09:48 +0000 (11:09 +0200)]
staging: r8188eu: Odm PatchID is always 0

PatchID is a copy of the hal customer id that is always 0.

Remove PatchID from struct odm_dm_struct and the code that is
executed only for PatchID != 0.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211006090949.1694-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: hal data's customer id is always 0
Martin Kaiser [Wed, 6 Oct 2021 09:09:47 +0000 (11:09 +0200)]
staging: r8188eu: hal data's customer id is always 0

CustomerID in struct hal_data_8188e is never set, it remains at the
default value 0.

Remove CustomerID and fix the two places where it was used.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211006090949.1694-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: support interface is always usb
Martin Kaiser [Tue, 5 Oct 2021 20:08:21 +0000 (22:08 +0200)]
staging: r8188eu: support interface is always usb

We set ODM_CMNINFO_INTERFACE to ODM_ITRF_USB as this driver supports
only usb. Therefore, dm_odm->SupportInterface is always ODM_ITRF_USB.

Simplify some if conditions accordingly. Remove/replace two empty
functions.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211005200821.19783-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: interface type is always usb
Martin Kaiser [Tue, 5 Oct 2021 20:08:20 +0000 (22:08 +0200)]
staging: r8188eu: interface type is always usb

This driver only supports chips that connect via usb. Remove
interface_type from struct adapter, use a constant in the one
place where the interface type is needed.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211005200821.19783-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: chip_type is write-only
Martin Kaiser [Tue, 5 Oct 2021 20:08:19 +0000 (22:08 +0200)]
staging: r8188eu: chip_type is write-only

chip_type in struct adapter is never read. Remove the component
and the code to initialise it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211005200821.19783-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: HardwareType is write-only
Martin Kaiser [Tue, 5 Oct 2021 20:08:18 +0000 (22:08 +0200)]
staging: r8188eu: HardwareType is write-only

HardwareType in struct adapter is never read, 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/20211005200821.19783-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove two write-only hal components
Martin Kaiser [Tue, 5 Oct 2021 20:08:17 +0000 (22:08 +0200)]
staging: r8188eu: remove two write-only hal components

RegTxPause and RegBcnCtrlVal from struct hal_data_8188e are set but never
read. Remove them.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211005200821.19783-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove unused IntrMask
Martin Kaiser [Tue, 5 Oct 2021 20:08:16 +0000 (22:08 +0200)]
staging: r8188eu: remove unused IntrMask

The IntrMask array 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/20211005200821.19783-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove write-only HwRxPageSize
Martin Kaiser [Tue, 5 Oct 2021 20:08:15 +0000 (22:08 +0200)]
staging: r8188eu: remove write-only HwRxPageSize

HwRxPageSize from struct hal_data_8188e is set but never read. Remove
the component and the code to initialise it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211005200821.19783-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove unused led component
Martin Kaiser [Tue, 5 Oct 2021 20:08:14 +0000 (22:08 +0200)]
staging: r8188eu: remove unused led component

bSWLedCtrl in struct LED_871x is not used. Remove it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211005200821.19783-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove an obsolete comment
Martin Kaiser [Tue, 5 Oct 2021 20:08:13 +0000 (22:08 +0200)]
staging: r8188eu: remove an obsolete comment

The function that this comment describes is not present in the
r8188eu driver. The comment can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20211005200821.19783-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vt6655: fix camelcase in PortOffset
Tommaso Merciai [Tue, 5 Oct 2021 20:56:59 +0000 (22:56 +0200)]
staging: vt6655: fix camelcase in PortOffset

Replace camel case variable PortOffset with snake case
variable port_offset.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Link: https://lore.kernel.org/r/20211005205702.14029-4-tomm.merciai@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vt6655: fix camelcase in ldBmThreshold
Tommaso Merciai [Tue, 5 Oct 2021 20:56:58 +0000 (22:56 +0200)]
staging: vt6655: fix camelcase in ldBmThreshold

Replace camel case variable ldBmThreshold with snake case
variable dbm_threshold. ldBmThreshold is in hungarian notation, where
"l" is for long and "dbm" is for decibel-milliwatt (signal strenght).
This variable contain's signal strenght threshold in dbm.

References:
 - https://en.wikipedia.org/wiki/Hungarian_notation
 - https://www.rapidtables.com/electric/dBm.html

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Link: https://lore.kernel.org/r/20211005205702.14029-3-tomm.merciai@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vt6655: fix camelcase in bShortSlotTime
Tommaso Merciai [Tue, 5 Oct 2021 20:56:57 +0000 (22:56 +0200)]
staging: vt6655: fix camelcase in bShortSlotTime

Replace camel case variable bShortSlotTime with snake case variable
short_slot_time. bShortSlotTime is a boolean variable, if true short
slot time is enabled, false not. Short Slot Time reduces the slot time
from 20 microseconds to 9 microseconds, where the slot time is
the maximum theoretical time for a frame to travel a network.

References:
 - http://cciew.blogspot.com/2011/02/short-slot-time.html
 - https://www.cse.wustl.edu/~jain/cse574-16/ftp/j_05lan4.pdf
 - https://www.networkdatapedia.com/post/2013/09/16/ \
   configuring-short-slot-time-to-improve-wifi-performance
 - https://en.wikipedia.org/wiki/Slot_time

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Link: https://lore.kernel.org/r/20211005205702.14029-2-tomm.merciai@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMIPS: asm: pci: define arch-specific 'pci_remap_iospace()' dependent on 'CONFIG_PCI_D...
Sergio Paracuellos [Fri, 8 Oct 2021 09:53:11 +0000 (11:53 +0200)]
MIPS: asm: pci: define arch-specific 'pci_remap_iospace()' dependent on 'CONFIG_PCI_DRIVERS_GENERIC'

Some MIPS defconfigs that don't define 'CONFIG_PCI_DRIVERS_GENERIC' but
define 'CONFIG_PCI_DRIVERS_LEGACY' or none of them, can fail when they are
built since definition for 'pci_remap_iospace' is being done in include
file 'arch/mips/include/asm/pci.h' and the specific function implemented
in 'arch/mips/pci/pci-generic.c'. MIPS PCI drivers that don't use generic
PCI core APIs don't really need 'pci_remap_iospace' to be defined at all.
Hence, change definition for 'pci_remap_iospace' to be dependent on the
preprocessor 'CONFIG_PCI_DRIVERS_GENERIC' definition to avoid possible
build problems.

Fixes: 9f76779f2418 ("MIPS: implement architecture-specific 'pci_remap_iospace()'")
CC: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20211008095311.26475-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-dts: properly define 'cpc' and 'mc' nodes
Sergio Paracuellos [Sat, 2 Oct 2021 06:07:06 +0000 (08:07 +0200)]
staging: mt7621-dts: properly define 'cpc' and 'mc' nodes

'cpc' and 'mc' nodes correspond with the MIPS 'Cluster Power Controller'
and 'MIPS Common Device Memory Map' which are present in some MIPS related
boards. There is already bindings documentation for these two located in:
- Documentation/devicetree/bindings/power/mti,mips-cpc.yaml
- Documentation/devicetree/bindings/bus/mti,mips-cdmm.yaml

Hence, properly update compatible strings and align nodes with already
mainlined bindings documentation. Also, move their definition to a proper
place since both of them are not related with the palmbus at all.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20211002060706.30511-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: mt7621-pci: properly adjust base address for the IO window
Sergio Paracuellos [Sat, 25 Sep 2021 20:32:24 +0000 (22:32 +0200)]
staging: mt7621-pci: properly adjust base address for the IO window

The value to adjust in the bridge register RALINK_PCI_IOBASE must take into
account the raw value from DT, not only the translated linux port number.
As long as io_offset is zero, the two are the same, but if you were to use
multiple host bridge in the system, or pick a different bus address in DT,
you can have a nonzero io_offset. At this means to take into account the
bus address which is used to calculate this offset, substracting it from
the IO resource start address.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210925203224.10419-7-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMIPS: implement architecture-specific 'pci_remap_iospace()'
Sergio Paracuellos [Sat, 25 Sep 2021 20:32:23 +0000 (22:32 +0200)]
MIPS: implement architecture-specific 'pci_remap_iospace()'

To make PCI IO work we need to properly virtually map IO cpu physical address
and set this virtual address as the address of the first PCI IO port which
is set using function 'set_io_port_base()'.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210925203224.10419-6-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoPCI: Allow architecture-specific pci_remap_iospace()
Sergio Paracuellos [Sat, 25 Sep 2021 20:32:22 +0000 (22:32 +0200)]
PCI: Allow architecture-specific pci_remap_iospace()

pci_remap_iospace() was originally meant as an architecture specific helper
but it moved into generic code after all architectures had the same
requirements. MIPS has different requirements so it should not be shared.

The way for doing this will be using a macro 'pci_remap_iospace' defined
for those architectures that need a special treatment. Hence, put core API
function inside preprocesor conditional code for 'pci_remap_iospace'
definition.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210925203224.10419-5-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMIPS: ralink: set PCI_IOBASE to 'mips_io_port_base'
Sergio Paracuellos [Sat, 25 Sep 2021 20:32:21 +0000 (22:32 +0200)]
MIPS: ralink: set PCI_IOBASE to 'mips_io_port_base'

By default MIPS architecture use function 'set_io_port_base()' to set the
virtual address of the first IO port. This function at the end sets variable
'mips_io_port_base' with the desired address. To align things and allow
to change first IO port location address for PCI, set PCI_IOBASE definition
as 'mips_io_port_base'.

Fixes: 222b27713d7f ("MIPS: ralink: Define PCI_IOBASE")
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210925203224.10419-4-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoRevert "staging: mt7621-pci: set end limit for 'ioport_resource'"
Sergio Paracuellos [Sat, 25 Sep 2021 20:32:20 +0000 (22:32 +0200)]
Revert "staging: mt7621-pci: set end limit for 'ioport_resource'"

This reverts commit 50fb34eca2944fd67493717c9fbda125336f1655.

Since IO_SPACE_LIMIT is not really being changed there is no
real need to adjust the ioport_resource end limit.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210925203224.10419-3-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoRevert "MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT"
Sergio Paracuellos [Sat, 25 Sep 2021 20:32:19 +0000 (22:32 +0200)]
Revert "MIPS: ralink: don't define PC_IOBASE but increase IO_SPACE_LIMIT"

This reverts commit 159697474db41732ef3b6c2e8d9395f09d1f659e.

There is no real need to increase IO_SPACE_LIMIT if PCI_IOBASE
is properly set to 'mips_io_port_base'. Hence revert this commit
first before doing anything else.

Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210925203224.10419-2-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: core: remove duplicate condition check
Saurav Girepunje [Sun, 3 Oct 2021 12:15:27 +0000 (17:45 +0530)]
staging: r8188eu: core: remove duplicate condition check

Remove the same expression (!memcmp(pIE->data, BROADCOM_OUI2, 3))
on both the side of "||" .

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVme3xtnCHN/hOjS@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: hal: remove assignment to itself
Saurav Girepunje [Sun, 3 Oct 2021 11:42:28 +0000 (17:12 +0530)]
staging: r8188eu: hal: remove assignment to itself

Remove assignment of 'pHalData->TRxAntDivType' to itself.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVmXJFSCCU3cvG6y@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: core: remove unused variable local variable
Saurav Girepunje [Sat, 2 Oct 2021 14:13:25 +0000 (19:43 +0530)]
staging: r8188eu: core: remove unused variable local variable

Remove unused local variable macAddr.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVhpBWhNt7mwfNKU@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: core: remove unused variable pAdapter
Saurav Girepunje [Sat, 2 Oct 2021 16:34:23 +0000 (22:04 +0530)]
staging: r8188eu: core: remove unused variable pAdapter

Remove unused variable pAdapter in Efuse_Read1ByteFromFakeContent.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YViKDzqX5isFX+gv@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: Use kmemdup() to replace kmalloc + memcpy
Kai Song [Sun, 3 Oct 2021 07:28:41 +0000 (15:28 +0800)]
staging: r8188eu: Use kmemdup() to replace kmalloc + memcpy

fix memdup.cocci warning:
drivers/staging/r8188eu/os_dep/ioctl_linux.c:4452:33-40: WARNING opportunity for kmemdup

Generated by: scripts/coccinelle/api/memdup.cocci

Signed-off-by: Kai Song <songkai01@inspur.com>
Link: https://lore.kernel.org/r/20211003072841.215903-1-songkai01@inspur.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: core: remove power_saving_wk_hdl function
Saurav Girepunje [Sat, 2 Oct 2021 14:42:44 +0000 (20:12 +0530)]
staging: r8188eu: core: remove power_saving_wk_hdl function

Remove function power_saving_wk_hdl is it just calling rtw_ps_processor.
Instead of power_saving_wk_hdl() call  rtw_ps_processor().

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVhv5JiHovfdpNGg@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove rtl8188e_silentreset_for_specific_platform()
Michael Straube [Thu, 30 Sep 2021 17:55:46 +0000 (19:55 +0200)]
staging: r8188eu: remove rtl8188e_silentreset_for_specific_platform()

Function rtl8188e_silentreset_for_specific_platform() is empty.
Remove it and remove code that does nothing other than using the
unwanted DBG_88E macro now.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210930175546.11175-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8712: Statements should start on a tabstop
Dawid Esterhuizen [Thu, 30 Sep 2021 14:16:16 +0000 (16:16 +0200)]
staging: rtl8712: Statements should start on a tabstop

This path fixes four checkpatch.pl warnings:

Statements should start on a tabstop

Signed-off-by: Dawid Esterhuizen <desterhuizen@gmail.com>
Link: https://lore.kernel.org/r/YVXGsMZDGmdGjErJ@kkobus.whirley.local
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove inirp_deinit from struct hal_ops
Michael Straube [Wed, 29 Sep 2021 19:26:57 +0000 (21:26 +0200)]
staging: r8188eu: remove inirp_deinit from struct hal_ops

Remove inirp_deinit from struct hal_ops and remove the wrappers
rtw_hal_inirp_deinit() and rtl8188eu_inirp_deinit(). Call
rtw_read_port_cancel() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210929192657.9569-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove inirp_init from struct hal_ops
Michael Straube [Wed, 29 Sep 2021 19:26:56 +0000 (21:26 +0200)]
staging: r8188eu: remove inirp_init from struct hal_ops

Remove inirp_init from struct hal_ops and remove its wrapper
rtw_hal_inirp_init(). Call rtl8188eu_inirp_init() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210929192657.9569-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove free_recv_priv from struct hal_ops
Michael Straube [Wed, 29 Sep 2021 19:26:55 +0000 (21:26 +0200)]
staging: r8188eu: remove free_recv_priv from struct hal_ops

Remove free_recv_priv from struct hal_ops and remove its wrapper
rtw_hal_free_recv_priv(). Call rtl8188eu_free_recv_priv() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210929192657.9569-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove init_recv_priv from struct hal_ops
Michael Straube [Wed, 29 Sep 2021 19:26:54 +0000 (21:26 +0200)]
staging: r8188eu: remove init_recv_priv from struct hal_ops

Remove init_recv_priv from struct hal_ops and remove its wrapper
rtw_hal_init_recv_priv(). Call rtl8188eu_init_recv_priv() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210929192657.9569-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove init_xmit_priv from struct hal_ops
Michael Straube [Wed, 29 Sep 2021 19:26:53 +0000 (21:26 +0200)]
staging: r8188eu: remove init_xmit_priv from struct hal_ops

Remove init_xmit_priv from struct hal_ops an remove its wrapper
rtw_hal_init_xmit_priv(). Call rtl8188eu_init_xmit_priv() directly
instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210929192657.9569-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove GetHalDefVarHandler from struct hal_ops
Michael Straube [Wed, 29 Sep 2021 19:26:52 +0000 (21:26 +0200)]
staging: r8188eu: remove GetHalDefVarHandler from struct hal_ops

Remove GetHalDefVarHandler from struct hal_ops and remove its wrapper
rtw_hal_get_def_var(). Call GetHalDefVar8188EUsb() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210929192657.9569-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove SetHalDefVarHandler from struct hal_ops
Michael Straube [Wed, 29 Sep 2021 19:26:51 +0000 (21:26 +0200)]
staging: r8188eu: remove SetHalDefVarHandler from struct hal_ops

Remove SetHalDefVarHandler from struct hal_ops and remove its wrapper
rtw_hal_set_def_var(). Call SetHalDefVar8188EUsb() directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210929192657.9569-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm_GlobalAdapterCheck()
Michael Straube [Tue, 28 Sep 2021 13:19:30 +0000 (15:19 +0200)]
staging: r8188eu: remove odm_GlobalAdapterCheck()

Function odm_GlobalAdapterCheck() is empty, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210928131930.8866-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove odm_DynamicBBPowerSaving()
Michael Straube [Tue, 28 Sep 2021 13:19:29 +0000 (15:19 +0200)]
staging: r8188eu: remove odm_DynamicBBPowerSaving()

SupportICType is ODM_RTL8188E in this driver. So function
odm_DynamicBBPowerSaving() does nothing, remove it. It is the only
user of odm_1R_CCA(), remove that function as well.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210928131930.8866-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192u: remove unused static variable
Saurav Girepunje [Sat, 2 Oct 2021 21:24:04 +0000 (02:54 +0530)]
staging: rtl8192u: remove unused static variable

remove unused static variable channels.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVjN9FT4KjLGX/Zg@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8192e: remove unused variable ieee
Saurav Girepunje [Sun, 3 Oct 2021 10:05:56 +0000 (15:35 +0530)]
staging: rtl8192e: remove unused variable ieee

Remove unused local variable ieee from ActivateBAEntry().

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVmAhOSRB8yc/iwU@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: Replace zero-length array with flexible-array member
Gustavo A. R. Silva [Wed, 29 Sep 2021 19:36:58 +0000 (14:36 -0500)]
staging: r8188eu: Replace zero-length array with flexible-array member

One-element and zero-length arrays are deprecated and should be
replaced with flexible-array members[1].

Replace zero-length array with flexible-array member and make use
of the struct_size() helper in kmalloc().

[1] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78
Link: https://github.com/KSPP/linux/issues/160
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20210929193658.GA339070@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: core: remove reassignment of same value to variable
Saurav Girepunje [Sun, 3 Oct 2021 16:18:28 +0000 (21:48 +0530)]
staging: rtl8723bs: core: remove reassignment of same value to variable

Remove reassignment of same value to variable pstat->auth_seq.
On if (seq == 1) assigning the value 2. At the end of if statement
also assigning the value pstat->auth_seq = seq + 1 that is again
assigning the value 2.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVnX1HIYoisW621x@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: core: remove condition never execute
Saurav Girepunje [Sun, 3 Oct 2021 15:58:28 +0000 (21:28 +0530)]
staging: rtl8723bs: core: remove condition never execute

Remove condition which never get execute.
as pattrib->mdata is always zero before if condition check.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVnTJCoz2qsXDXGc@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: Replace zero-length array with flexible-array member
Gustavo A. R. Silva [Wed, 29 Sep 2021 19:41:18 +0000 (14:41 -0500)]
staging: rtl8723bs: Replace zero-length array with flexible-array member

One-element and zero-length arrays are deprecated and should be
replaced with flexible-array members[1].

Replace zero-length array with flexible-array member and make use
of the struct_size() helper.

[1] https://www.kernel.org/doc/html/v5.10/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/78
Link: https://github.com/KSPP/linux/issues/160
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20210929194118.GA340431@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()
Longji Guo [Wed, 29 Sep 2021 11:06:13 +0000 (19:06 +0800)]
staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()

kfree(NULL) is safe and the check 'if (pstat->passoc_req)' before kfree
is not necessary.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Longji Guo <guolongji@uniontech.com>
Link: https://lore.kernel.org/r/20210929110613.29979-1-guolongji@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vchiq_arm: move platform structs to vchiq_arm.c
Stefan Wahren [Sun, 3 Oct 2021 12:32:49 +0000 (14:32 +0200)]
staging: vchiq_arm: move platform structs to vchiq_arm.c

After merging vchiq_2835_arm.c into vchiq_arm.c some platform structs
doesn't need to exported anymore. So move them into the C file.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1633264369-998-4-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vchiq_arm: drop unnecessary declarations
Stefan Wahren [Sun, 3 Oct 2021 12:32:48 +0000 (14:32 +0200)]
staging: vchiq_arm: drop unnecessary declarations

vchiq_arm.h contains some unnecessary declarations, so drop them.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1633264369-998-3-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vchiq_arm: re-order vchiq_arm_init_state
Stefan Wahren [Sun, 3 Oct 2021 12:32:47 +0000 (14:32 +0200)]
staging: vchiq_arm: re-order vchiq_arm_init_state

This moves vchiq_arm_init_state() above its caller, so we can drop the
now unnecessary forward declaration and make the function static.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1633264369-998-2-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: vt6655: fix camelcase in pbyCxtBuf
Tommaso Merciai [Fri, 1 Oct 2021 20:25:01 +0000 (22:25 +0200)]
staging: vt6655: fix camelcase in pbyCxtBuf

Replace camel case variable name for variable pbyCxtBuf
with snake case equivalent, in mac.h

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Link: https://lore.kernel.org/r/20211001202504.410383-1-tomm.merciai@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: Remove unused macros and defines from odm.h
Larry Finger [Mon, 27 Sep 2021 21:45:27 +0000 (16:45 -0500)]
staging: r8188eu: Remove unused macros and defines from odm.h

This header defines a number of symbols/macros that are not used and can
be removed. In addition, it defines a number of synonym symbols that are
used interchangeably in the source. Only one is now selected.

In addition to the above, a number of comments that have no meaning for
this chip have been removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210927214527.5341-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: most: dim2: use if statements instead of ?: expressions
Nikita Yushchenko [Mon, 27 Sep 2021 16:06:49 +0000 (19:06 +0300)]
staging: most: dim2: use if statements instead of ?: expressions

For better maintainability, replace conditional expressions with if
statements in the drivers' probe routine.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Link: https://lore.kernel.org/r/20210927160649.29209-1-nikita.yoush@cogentembedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: most: dim2: force fcnt=3 on Renesas GEN3
Nikita Yushchenko [Mon, 27 Sep 2021 15:58:05 +0000 (18:58 +0300)]
staging: most: dim2: force fcnt=3 on Renesas GEN3

Per Renesas datasheet, MLBC0 register's fcnt field in the embedded
dim2 module must be never set to value different from 3.

Enforce that, via an optional field in struct dim2_platform_data.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Link: https://lore.kernel.org/r/20210927155804.27877-1-nikita.yoush@cogentembedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove mutex 'usb_vendor_req_mutex'
Pavel Skripkin [Fri, 24 Sep 2021 12:27:05 +0000 (14:27 +0200)]
staging: r8188eu: remove mutex 'usb_vendor_req_mutex'

Remove mutex 'usb_vendor_req_mutex'.

It was used to protect a shared buffer for USB requests and, since that
buffer is removed in previous patch, this mutex is now useless.

Furthermore, because it was used to serialize the calls to the Core USB
API, we thoroughly tested the enabling of concurrent firing of USB requests
without the mutex and found no problems of any kind in common use cases.

Co-developed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-17-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove shared buffer for USB requests
Pavel Skripkin [Fri, 24 Sep 2021 12:27:04 +0000 (14:27 +0200)]
staging: r8188eu: remove shared buffer for USB requests

Remove the shared buffer for USB requests because it is not necessary
and use a local on stack variable since the new Core USB API does not
have the constraints of usb_control_msg().

Co-developed-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-16-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: call new usb_write() from rtw_write{8,16,32,N}()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:27:03 +0000 (14:27 +0200)]
staging: r8188eu: call new usb_write() from rtw_write{8,16,32,N}()

Create and call new usb_write() instead of usbctrl_vendorreq() from
inside rtw_write{8,16,32,N}().

In old code, rtw_write{8,16,32,N}() called usbctrl_vendorreq() which in
turn uses usb_control_msg() from within a "while" loop to build a control
URB, send it off and wait for completion. usbctrl_vendorreq() was used
for both receiving and sending messages, depending on the "requesttype"
argument which is passed by callers.

Compared to usbctrl_vendorreq(), which manages both reads and writes
from and to the USB endpoint, the new usb_write() manages only writes.
For this purpose it uses the newer USB Core usb_control_msg_send() API.
The latter is preferred according both to suggestions by Greg Kroah-Hartman
and also to its actual design.

A noteworthy feature of usb_control_msg_send() is that the data pointer
can be made to a reference on the stack because it does not have the
restriction that usb_control_msg() has where the data pointer must be to
dynamically allocated memory.

usbctrl_vendorreq() used a "while" loop that we considered unnecessary
so that it is not in the new usb_write(). Furthermore, the latter has no
redundant checking, less obvious comments, no debug prints, and it manages
errors before success case. All in all, usb_write() is simpler than
usbctrl_vendorreq() and uses less lines of code.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-15-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: call new usb_read() from rtw_read{8,16,32}()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:27:02 +0000 (14:27 +0200)]
staging: r8188eu: call new usb_read() from rtw_read{8,16,32}()

Create and call new usb_read() instead of usbctrl_vendorreq() from
inside rtw_read{8,16,32}().

In old code, rtw_read{8,16,32}() called usbctrl_vendorreq() which in
turn uses usb_control_msg() from within a "while" loop to build a control
URB, send it off and wait for completion. usbctrl_vendorreq() was used for
both receiving and sending messages, depending on the "requesttype"
argument which was passed by callers.

Compared to usbctrl_vendorreq(), which managed both reads and writes
from and to the USB endpoint, the new usb_read() manages only reads. For
this purpose it uses the newer USB Core usb_control_msg_recv() API. The
latter is preferred according both to a suggestion by Greg Kroah-Hartman
and also to its actual design.

Two noteworthy features of usb_control_msg_recv() are that (1) the data
pointer can be made to a reference on the stack because it does not have
the restriction that usb_control_msg() has where the data pointer must be
to dynamically allocated memory, and that (2) the whole message must be
properly received from the device in order for this function to be
successfuli (if a device returns less than the expected amount of data,
then the function will fail).

usbctrl_vendorreq() uses a "while" loop that we considered unnecessary
so that it is not in the new usb_read(). Furthermore, the latter has no
redundant checking, less obvious comments, and it manages errors before
success cases. All in all, usb_read() is simpler than
usbctrl_vendorreq() and uses less lines of code.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-14-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: Remove a test from usbctrl_vendorreq()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:27:01 +0000 (14:27 +0200)]
staging: r8188eu: Remove a test from usbctrl_vendorreq()

Remove an unnecessary 'if' test from usbctrl_vendorreq() because
"length" is never greater than MAX_VENDOR_REQ_CMD_SIZE.

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-13-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: change the type of a variable in rtw_read16()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:27:00 +0000 (14:27 +0200)]
staging: r8188eu: change the type of a variable in rtw_read16()

Change the type of "data" from __le32 to __le16. The size of the data
that usbctrl_vendorreq() will read is two bytes in little endian order,
so the most suitable type is __le16.

With the old code, since the two most significant bytes of data are not
initialized, KMSan can likely detect the reading of uninitialized data,
so this change can prevent the checker from complaining.

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-12-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove a bitwise AND from rtw_writeN()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:26:59 +0000 (14:26 +0200)]
staging: r8188eu: remove a bitwise AND from rtw_writeN()

Remove an unnecessary bitwise AND because "length" can never be greater
than 0xffff since VENDOR_CMD_MAX_DATA_LEN is defined as '254'.

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-11-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove a buffer from rtw_writeN()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:26:58 +0000 (14:26 +0200)]
staging: r8188eu: remove a buffer from rtw_writeN()

Remove the unnecessary buffer "u8 buf[VENDOR_CMD_MAX_DATA_LEN]" and
pass directly "data" to usbctrl_vendorreq().

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-10-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: change the type of a variable in rtw_write16()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:26:57 +0000 (14:26 +0200)]
staging: r8188eu: change the type of a variable in rtw_write16()

Change the type of "data" from __le32 to __le16 in rtw_write16(). The
argument "val", which is u16, after being conditionally swapped to little
endian, is assigned to "data"; therefore, __le16 is the most suitable type
for "data". Remove the bitwise AND of "val" with 0xffff because it is
redundant. Use cpu_to_le16() because "data" is __le16.

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-9-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove casts from rtw_{read,write}*()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:26:56 +0000 (14:26 +0200)]
staging: r8188eu: remove casts from rtw_{read,write}*()

Remove unnecessary casts from rtw_read{8,16,32}() and from
rtw_write{8,16,32,N}().

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-8-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: rename symbols in rtw_read*() and rtw_write*()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:26:55 +0000 (14:26 +0200)]
staging: r8188eu: rename symbols in rtw_read*() and rtw_write*()

Rename variables in rtw_read{8.16.32}() and in rtw_write{8,16,32,N}()
because of unnecessary 'p' (that probably stand for "pointer to") and
'w' (that probably stands for "word"):

pio_priv => io_priv;
pintfhdl => intf;
wvalue => value.

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-7-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove a comment from usbctrl_vendorreq()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:26:54 +0000 (14:26 +0200)]
staging: r8188eu: remove a comment from usbctrl_vendorreq()

Remove an unnecessary comment from usbctrl_vendorreq().

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-6-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: reorder comments in usbctrl_vendorreq()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:26:53 +0000 (14:26 +0200)]
staging: r8188eu: reorder comments in usbctrl_vendorreq()

Reorder comments in usbctrl_vendorreq() to follow Linux coding style.
Delete two of them because they are "obvious".

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-5-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agostaging: r8188eu: remove test in usbctrl_vendorreq()
Fabio M. De Francesco [Fri, 24 Sep 2021 12:26:52 +0000 (14:26 +0200)]
staging: r8188eu: remove test in usbctrl_vendorreq()

Remove unnecessary test for "!io_buf" in usbctrl_vendorreq(). This test
is not necessary because io_buf has been assigned with the address of
a region of dynamically allocated memory (dvobj->usb_alloc_vendor_req_buf)
by rtw_init_intf_priv() in os_dep/usb_intf.c.

Co-developed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210924122705.3781-4-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>