platform/kernel/linux-starfive.git
2 years agostaging: r8188eu: assoc_rsp and assoc_rsp_len are not used
Martin Kaiser [Sun, 15 May 2022 15:54:01 +0000 (17:54 +0200)]
staging: r8188eu: assoc_rsp and assoc_rsp_len are not used

The assoc_rsp buffer in struct mlme_priv is not used. There's no need to
store an incoming association response after receiving an processing it.

Remove the buffer pointer and its length from struct mlme_priv.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: last_rx_mgnt_pkts is set but not used
Martin Kaiser [Sun, 15 May 2022 15:54:00 +0000 (17:54 +0200)]
staging: r8188eu: last_rx_mgnt_pkts is set but not used

last_rx_mgnt_pkts in struct stainfo_stats is set but not used.
Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: simplify error handling in recv_func_prehandle
Martin Kaiser [Sun, 15 May 2022 15:53:59 +0000 (17:53 +0200)]
staging: r8188eu: simplify error handling in recv_func_prehandle

Simplify the error handling in recv_func_prehandle. There's no need to
goto exit, this would be the next statement anyway.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove obsolete comments
Martin Kaiser [Sun, 15 May 2022 15:53:58 +0000 (17:53 +0200)]
staging: r8188eu: remove obsolete comments

Remove some comments in HalPwrSeqCmd.c that contain no useful information.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211 helper to check for beacon
Martin Kaiser [Sun, 15 May 2022 15:53:57 +0000 (17:53 +0200)]
staging: r8188eu: use ieee80211 helper to check for beacon

Use the ieee80211_is_beacon helper to check if the incoming frame is a
beacon frame.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use defines for addba response status
Martin Kaiser [Sun, 15 May 2022 15:27:59 +0000 (17:27 +0200)]
staging: r8188eu: use defines for addba response status

Replace the numeric values with defines from ieee80211.h.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515152759.335889-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use the tid in delba processing
Martin Kaiser [Sat, 14 May 2022 16:47:40 +0000 (18:47 +0200)]
staging: r8188eu: use the tid in delba processing

Extract the tid from the delba frame regardless of the recipient/initiator
setting. Use the extracted tid when we process the delba frame.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: check for initiator vs recipient
Martin Kaiser [Sat, 14 May 2022 16:47:39 +0000 (18:47 +0200)]
staging: r8188eu: check for initiator vs recipient

For an incoming delba message, the code checks if the delba was sent by
the data initiator or by the data recipient.

Rewrite this check using the ieee80211 helpers, making the code easier to
understand.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use BIT(tid) instead of manual shift
Martin Kaiser [Sat, 14 May 2022 16:47:38 +0000 (18:47 +0200)]
staging: r8188eu: use BIT(tid) instead of manual shift

Use BIT(tid) instead of 1 << tid when we process an addba response.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: replace if with ternary operator
Martin Kaiser [Sat, 14 May 2022 16:47:37 +0000 (18:47 +0200)]
staging: r8188eu: replace if with ternary operator

Replace an if statement with a ternary operator, making the code a tiny
bit shorter.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: merge process_addba_req into OnAction_back
Martin Kaiser [Sat, 14 May 2022 16:47:36 +0000 (18:47 +0200)]
staging: r8188eu: merge process_addba_req into OnAction_back

The process_addba_req function is called only by OnAction_back. Merge the
two functions.

OnAction_back has already checked that psta != NULL, we can drop the check
in process_addba_req before merging the functions. We can also simplify
the parsing of the tid by using struct ieee80211.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: read addba resp tid from ieee80211_mgmt
Martin Kaiser [Sat, 14 May 2022 16:47:35 +0000 (18:47 +0200)]
staging: r8188eu: read addba resp tid from ieee80211_mgmt

Use the same code as ieee80211_process_addba_resp to calculate the tid
from the capability field of an addba response message.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: get addba resp status from ieee80211_mgmt
Martin Kaiser [Sat, 14 May 2022 16:47:34 +0000 (18:47 +0200)]
staging: r8188eu: get addba resp status from ieee80211_mgmt

Read the addba response status from struct ieee80211_mgmt instead of
parsing the incoming frame ourselves.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix block comment format
Soumya Negi [Fri, 13 May 2022 07:51:07 +0000 (00:51 -0700)]
staging: r8188eu: Fix block comment format

Adhere to Linux coding style. Fix the below checkpatch warning:
 WARNING: Block comments should align the * on each line

Signed-off-by: Soumya Negi <soumya.negi97@gmail.com>
Link: https://lore.kernel.org/r/20220513075107.23285-1-soumya.negi97@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: Fix alignment to match open parenthesis
Soumya Negi [Fri, 13 May 2022 02:55:53 +0000 (19:55 -0700)]
staging: rtl8723bs: Fix alignment to match open parenthesis

Adhere to Linux coding style. Fixes checkpatch warnings:
CHECK: Alignment should match open parenthesis
CHECK: line length of 101 exceeds 100 columns

Signed-off-by: Soumya Negi <soumya.negi97@gmail.com>
Link: https://lore.kernel.org/r/20220513025553.13634-1-soumya.negi97@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace VNSvOutPortB with iowrite8
Philipp Hortmann [Sun, 8 May 2022 19:30:03 +0000 (21:30 +0200)]
staging: vt6655: Replace VNSvOutPortB with iowrite8

Replace macro VNSvOutPortB with iowrite8 because it replaces
just one line.
The name of macro and the arguments use CamelCase which
is not accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/38611512677a18f63d9266cde1d20758c0feeb6e.1651957741.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace MACvTransmitBCN with VNSvOutPortB
Philipp Hortmann [Sun, 8 May 2022 19:29:58 +0000 (21:29 +0200)]
staging: vt6655: Replace MACvTransmitBCN with VNSvOutPortB

Replace macro MACvTransmitBCN with VNSvOutPortB and as it
was the only user, it can now be removed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/698ce973d92065846a9db4339f017cd9e094706e.1651957741.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace MACvStart with VNSvOutPortB
Philipp Hortmann [Sun, 8 May 2022 19:29:53 +0000 (21:29 +0200)]
staging: vt6655: Replace MACvStart with VNSvOutPortB

Replace macro MACvStart with VNSvOutPortB and as it
was the only user, it can now be removed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/d998305b4dec2827b0e13e49938e68a32517c487.1651957741.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop redundant if check
Vihas Makwana [Sun, 8 May 2022 18:24:01 +0000 (23:54 +0530)]
staging: r8188eu: drop redundant if check

The check for ETH_P_IP is already performed in the outer if block
and inner if check is redundant. So drop the check.

Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220508182400.22433-1-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: read back action code from ieee80211_mgmt
Martin Kaiser [Sun, 8 May 2022 16:14:51 +0000 (18:14 +0200)]
staging: r8188eu: read back action code from ieee80211_mgmt

Read the back action code from struct ieee80211_mgmt.

struct ieee80211_mgmt contains an "action" union. Each of its members
starts with an 8-bit action code. Treat the union as addba_req when we
read the action code although we do not yet know if it is an addba_req.
This approach is similar to ieee80211_iface_process_skb.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use back action codes from ieee80211.h
Martin Kaiser [Sun, 8 May 2022 16:14:50 +0000 (18:14 +0200)]
staging: r8188eu: use back action codes from ieee80211.h

Use the defines from ieee80211.h for the back action codes.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: read destination address from ieee80211_mgmt
Martin Kaiser [Sun, 8 May 2022 16:14:49 +0000 (18:14 +0200)]
staging: r8188eu: read destination address from ieee80211_mgmt

For management frames, addr1 is the destination address (da). Read this
address from struct ieee80211_mgmt instead of calling a driver-specific
macro.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: don't check the category in OnAction_back
Martin Kaiser [Sun, 8 May 2022 16:14:48 +0000 (18:14 +0200)]
staging: r8188eu: don't check the category in OnAction_back

Do not check the category in OnAction_back. OnAction has already checked
the category before calling OnAction_back.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: read addr2 from ieee80211_mgmt
Martin Kaiser [Sun, 8 May 2022 16:14:47 +0000 (18:14 +0200)]
staging: r8188eu: read addr2 from ieee80211_mgmt

Define a struct ieee80211_mgmt variable in the OnAction_back function. Use
it to read addr2. For management frames, addr2 is the source address (sa).

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192u: make const array queuetopipe const, reduces object code size
Colin Ian King [Sat, 7 May 2022 18:34:14 +0000 (19:34 +0100)]
staging: rtl8192u: make const array queuetopipe const, reduces object code size

Don't populate the const array queuetopipe on the stack, instead make it
static.  Also makes the object code smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220507183414.26633-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused IEEE_* defines
Martin Kaiser [Mon, 2 May 2022 20:06:52 +0000 (22:06 +0200)]
staging: r8188eu: remove unused IEEE_* defines

The IEEE_* defines in the driver's ieee80211.h header file are not used.
Remove them.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use standard category defines
Martin Kaiser [Mon, 2 May 2022 20:06:51 +0000 (22:06 +0200)]
staging: r8188eu: use standard category defines

Replace some of the driver-specific defines for action categories with the
defines from ieee80211.h.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211_mgmt for action category
Martin Kaiser [Mon, 2 May 2022 20:06:50 +0000 (22:06 +0200)]
staging: r8188eu: use ieee80211_mgmt for action category

Use the struct ieee80211_mgmt from ieee80211.h to read the action
category. There's no need to parse the incoming frame ourselves.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: replace OnAction_tbl with switch-case
Martin Kaiser [Mon, 2 May 2022 20:06:49 +0000 (22:06 +0200)]
staging: r8188eu: replace OnAction_tbl with switch-case

OnAction_tbl has only three entries. It's simpler to use a switch
statement instead of iterating over the table.

We can then remove the table itself and struct action_handler, which was
used only for the table entries.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove an unused category define
Martin Kaiser [Mon, 2 May 2022 20:06:48 +0000 (22:06 +0200)]
staging: r8188eu: remove an unused category define

RTW_WLAN_CATEGORY_TDLS is not used. Remove the define.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove action_handler string
Martin Kaiser [Mon, 2 May 2022 20:06:47 +0000 (22:06 +0200)]
staging: r8188eu: remove action_handler string

Remove the unused str component from struct action_handler and the
corresponding entries in OnAction_tbl.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused action handler prototypes
Martin Kaiser [Mon, 2 May 2022 20:06:46 +0000 (22:06 +0200)]
staging: r8188eu: remove unused action handler prototypes

For some action categories, we removed the handler function, but we forgot
the prototypes. Remove them as well.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: action category wmm is not used
Martin Kaiser [Mon, 2 May 2022 20:06:45 +0000 (22:06 +0200)]
staging: r8188eu: action category wmm is not used

The r8188eu driver does not handle the wmm action category. Remove the
empty handler function, the entry in OnAction_tbl and the define for the
category.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: action category ht is not used
Martin Kaiser [Mon, 2 May 2022 20:06:44 +0000 (22:06 +0200)]
staging: r8188eu: action category ht is not used

The r8188eu driver does not handle the ht action category. Remove the
empty handler function, the entry in OnAction_tbl and the define for the
category.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace unused return value of vt6655_get_current_tsf
Philipp Hortmann [Sun, 1 May 2022 20:25:41 +0000 (22:25 +0200)]
staging: vt6655: Replace unused return value of vt6655_get_current_tsf

Replace unused return value with u64 to increase readability,
reduce address and dereference operators and omit pqwCurrTSF that
uses CamelCase which is not accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/62c83d78627196ec0ce2f5a562cb080a1c87a05a.1651435890.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Rename function CARDbGetCurrentTSF
Philipp Hortmann [Sun, 1 May 2022 20:25:35 +0000 (22:25 +0200)]
staging: vt6655: Rename function CARDbGetCurrentTSF

The name of the function uses CamelCase which
is not accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/2b92db8d67e8dd1fc85b45efe3b32d2199371190.1651435890.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Added missing BE support in CARDbGetCurrentTSF
Philipp Hortmann [Sun, 1 May 2022 19:12:29 +0000 (21:12 +0200)]
staging: vt6655: Added missing BE support in CARDbGetCurrentTSF

Added missing big-endian support in CARDbGetCurrentTSF.

Reported-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/25c80e3eb889ef2e530f26b4a97a9f5fe88e01ab.1651431640.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace VNSvInPortD with ioread32
Philipp Hortmann [Sun, 1 May 2022 19:12:23 +0000 (21:12 +0200)]
staging: vt6655: Replace VNSvInPortD with ioread32

Replace macro VNSvInPortD with ioread32 and as it was
the only user, it can now be removed.
The name of macro and the arguments use CamelCase which
is not accepted by checkpatch.pl

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/3945d32053898e5f9771d6f742ae118ca56943ce.1651431640.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove broken rtw_p2p_get function.
Charlie Sands [Sat, 30 Apr 2022 04:28:59 +0000 (00:28 -0400)]
staging: r8188eu: Remove broken rtw_p2p_get function.

Removes broken and unsafe rtw_p2p_get function and all of the code
associated with it from the r8188eu driver.

Signed-off-by: Charlie Sands <charlies256@protonmail.com>
Link: https://lore.kernel.org/r/Ymy7C/A2q+VzfBhO@sckzor-linux.localdomain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop redundant check in _rtw_free_mlme_priv
Vihas Makwana [Wed, 27 Apr 2022 16:57:49 +0000 (22:27 +0530)]
staging: r8188eu: drop redundant check in _rtw_free_mlme_priv

There's a NULL check on pmlmepriv in rtw_mlme.c:112 which makes no sense
as rtw_free_mlme_priv_ie_data() dereferences it unconditionally and it
would have already crashed at this point.
Remove this redundant check.

Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220427165748.10584-1-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused else condition
Jaehee Park [Wed, 27 Apr 2022 15:32:03 +0000 (11:32 -0400)]
staging: r8188eu: remove unused else condition

rtw_select_and_join_from_scanned_queue() cannot return '2' so this
else condition is unused. Remove this unnecessary else statement.

Suggested-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/20220427153203.GA503502@jaehee-ThinkPad-X1-Extreme
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused semaphore "allrxreturnevt"
Vihas Makwana [Wed, 27 Apr 2022 19:00:54 +0000 (00:30 +0530)]
staging: r8188eu: remove unused semaphore "allrxreturnevt"

The semaphore allrxreturnevt of struct recv_priv is initialized but not
used anywhere in the code.
Remove the initialization and the structure member.

Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220427190054.17841-1-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: greybus: correct typo in comment
Nickalas Cason [Sat, 30 Apr 2022 23:01:39 +0000 (19:01 -0400)]
staging: greybus: correct typo in comment

Correct misspelling in comment. Issue found with checkpatch.

Signed-off-by: Nickalas Cason <nickalas@cason.dev>
Link: https://lore.kernel.org/r/20220430230139.7i772mvejlhevamn@desktop
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vc04_services: Re-use generic struct s32_fract
Andy Shevchenko [Wed, 4 May 2022 09:29:15 +0000 (12:29 +0300)]
staging: vc04_services: Re-use generic struct s32_fract

Instead of custom data type re-use generic struct s32_fract.
No changes intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220504092915.72021-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace MACvReadISR with VNSvInPortD
Philipp Hortmann [Wed, 27 Apr 2022 05:42:18 +0000 (07:42 +0200)]
staging: vt6655: Replace MACvReadISR with VNSvInPortD

Replace macro MACvReadISR with VNSvInPortD and as it was the only
user, it can now be removed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/ddd403a3f590cb81403197442b12c3986c98ba25.1651036713.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace MACvReadMIBCounter with VNSvInPortD
Philipp Hortmann [Wed, 27 Apr 2022 05:42:13 +0000 (07:42 +0200)]
staging: vt6655: Replace MACvReadMIBCounter with VNSvInPortD

Replace macro MACvReadMIBCounter with VNSvInPortD and as it
was the only user, it can now be removed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e1b7156e2c689cf53c738642fd9b33816ec89f92.1651036713.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace VNSvInPortW with ioread16
Philipp Hortmann [Sun, 24 Apr 2022 07:44:05 +0000 (09:44 +0200)]
staging: vt6655: Replace VNSvInPortW with ioread16

Replace macro VNSvInPortW with ioread16.
The name of macro and the arguments use CamelCase which
is not accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/2d55e245cc530ffafe53384df03691d1b29b495c.1650784817.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Remove u16 cast for u16 return value
Solomon Tan [Sat, 23 Apr 2022 13:01:50 +0000 (21:01 +0800)]
staging: rtl8192e: Remove u16 cast for u16 return value

Remove explicit u16 cast of the function Mk16 return value.
The variable hi does not need to be casted explicitly to u16 as it will
already be casted implicitly.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-8-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Remove u16 cast for u32 parameter
Solomon Tan [Sat, 23 Apr 2022 13:01:49 +0000 (21:01 +0800)]
staging: rtl8192e: Remove u16 cast for u32 parameter

The explicit u16 cast is not necessary because rtl92e_eeprom_read's
second parameter is defined to be u32.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-7-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Remove unnecessary u16 argument cast
Solomon Tan [Sat, 23 Apr 2022 13:01:48 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u16 argument cast

Remove the explicit u16 casts for u16 argument in the function call. This
function has declared its parameter to be of type u16, so the argument
given to that parameter will be automatically coerced to u16. Therefore,
an explicit cast is unnecessary.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-6-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Remove unnecessary u16 assignment cast
Solomon Tan [Sat, 23 Apr 2022 13:01:47 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u16 assignment cast

Remove the explicit casts in assignment statements for u16 variables.
Because these variables are declared as u16, there is implicit
conversion to u16 during the assignment, so an explicit cast is
unnecessary.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-5-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Remove unnecessary u8 cast in comparison
Solomon Tan [Sat, 23 Apr 2022 13:01:46 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u8 cast in comparison

Since the macro VERSION_8190_BD is defined to be 0x3, and the structure
members card_8192_version and IC_Cut are both u8, an explicit u8 cast is
unnecessary.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-4-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Remove unnecessary u8 argument cast
Solomon Tan [Sat, 23 Apr 2022 13:01:45 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u8 argument cast

Remove the unnecessary explicit u8 casts for u8 arguments in function
calls. These functions have declared their parameters to be of type u8,
so the arguments given to those parameters will be automatically coerced
to u8. Therefore, an explicit cast is unnecessary.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-3-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Remove unnecessary u8 assignment cast
Solomon Tan [Sat, 23 Apr 2022 13:01:44 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u8 assignment cast

Remove the explicit casts in assignment statements for u8 variables.
Because these variables are declared as u8, there is implicit conversion
to u8 during the assignment, so an explicit cast is unnecessary.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-2-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop unnecessary wrapper _rtw_dequeue_cmd
Vihas Makwana [Fri, 22 Apr 2022 19:32:23 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_dequeue_cmd

Drop unnecessary wrapper _rtw_dequeue_cmd and move its logic to
rtw_dequeue_cmd.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-8-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop unnecessary wrapper _rtw_alloc_network
Vihas Makwana [Fri, 22 Apr 2022 19:32:22 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_alloc_network

Drop unnecessary wrapper _rtw_alloc_network and move its logic to
rtw_alloc_network.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-7-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop unnecessary wrapper _rtw_free_mlme_priv
Vihas Makwana [Fri, 22 Apr 2022 19:32:21 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_free_mlme_priv

Drop unnecessary wrapper _rtw_free_mlme_priv and move its logic to
rtw_free_mlme_priv.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-6-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop unnecessary wrapper _rtw_init_mlme_priv
Vihas Makwana [Fri, 22 Apr 2022 19:32:20 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_init_mlme_priv

Drop unnecessary wrapper _rtw_init_mlme_priv and move its logic to
rtw_init_mlme_priv.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-5-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop unnecessary wrapper _rtw_init_evt_priv
Vihas Makwana [Fri, 22 Apr 2022 19:32:19 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_init_evt_priv

Drop unnecessary wrapper _rtw_init_evt_priv and move its logic to
rtw_init_evt_priv.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-4-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop unnecessary wrapper _rtw_init_cmd_priv
Vihas Makwana [Fri, 22 Apr 2022 19:32:18 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_init_cmd_priv

Drop unnecessary wrapper _rtw_init_cmd_priv and move its logic to
rtw_init_cmd_priv.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-3-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: drop unnecessary wrapper _rtw_free_cmd_priv
Vihas Makwana [Fri, 22 Apr 2022 19:32:17 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_free_cmd_priv

Drop unnecessary wrapper _rtw_free_cmd_priv and move its logic to
rtw_free_cmd_priv.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-2-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: greybus: tools: fix spelling
Vaibhav Nagare [Mon, 25 Apr 2022 13:31:11 +0000 (19:01 +0530)]
staging: greybus: tools: fix spelling

Fixed the spelling mistake of appendation to appending.

Signed-off-by: Vaibhav Nagare <vnagare@redhat.com>
Link: https://lore.kernel.org/r/20220425133111.118257-1-vnagare@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vc04_services: Re-add dependency on HAS_DMA to BCM2835_VCHIQ
Geert Uytterhoeven [Mon, 25 Apr 2022 12:18:25 +0000 (14:18 +0200)]
staging: vc04_services: Re-add dependency on HAS_DMA to BCM2835_VCHIQ

Thanks to stubs for the NO_DMA=y case, drivers that use the DMA API can
be compile-tested on systems that do not support DMA.  Hence the
dependency of BCM2835_VCHIQ on HAS_DMA was dropped to increase compile
coverage.

Unfortunately compilers became smarter, leading to new failures.
E.g. for a CONFIG_SUN3=y allmodconfig kernel with gcc 9.4.0:

    drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c: In function â€˜free_pagelist’:
    arch/m68k/include/asm/string.h:72:25: warning: argument 2 null where non-null expected [-Wnonnull]
       72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
  |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:614:4: note: in expansion of macro â€˜memcpy’
      614 |    memcpy((char *)kmap(pages[0]) +
  |    ^~~~~~
    arch/m68k/include/asm/string.h:72:25: note: in a call to built-in function â€˜__builtin_memcpy’
       72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
  |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:614:4: note: in expansion of macro â€˜memcpy’
      614 |    memcpy((char *)kmap(pages[0]) +
  |    ^~~~~~

This happens because the compiler can trace back the source pointer to a
allocation by dma_alloc_attrs(), which always returns NULL if NO_DMA=y.

Avoid this reinstating the dependency of the BCM2835_VCHIQ symbol on
HAS_DMA, and by restricting the selection of BCM2835_VCHIQ.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/da55bd87eebf1a969dc8ccd807843319833f6c40.1650888813.git.geert@linux-m68k.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agoRevert "staging: r8188eu: use in-kernel ieee channel"
Solomon Tan [Mon, 25 Apr 2022 05:28:03 +0000 (13:28 +0800)]
Revert "staging: r8188eu: use in-kernel ieee channel"

This reverts commit 0afaa121813ed602bd203759c339cb639493f8c2 as changing
rtw_ieee80211_channel to ieee80211_channel causes a memcpy bug as
reported in:
https://lore.kernel.org/linux-staging/67e2d10b-7f0f-9c5a-ce31-376b83ffba9e@gmail.com/
due to their size differences.

Fixes: 0afaa121813e ("staging: r8188eu: use in-kernel ieee channel")
Reported-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220425052802.2419-1-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: bcm2835-audio: delete TODO
Adrien Thierry [Wed, 20 Apr 2022 17:44:00 +0000 (13:44 -0400)]
staging: bcm2835-audio: delete TODO

Delete TODO since all tasks were completed:

1 - fixed here:
https://lore.kernel.org/all/20220408150359.26661-1-athierry@redhat.com/

2 - there are no remaining checkpatch.pl errors or warnings

Signed-off-by: Adrien Thierry <athierry@redhat.com>
Link: https://lore.kernel.org/r/20220420174401.305964-1-athierry@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192u: Fix signedness bug in ieee80211_check_auth_response()
Haowen Bai [Fri, 22 Apr 2022 02:10:35 +0000 (10:10 +0800)]
staging: rtl8192u: Fix signedness bug in ieee80211_check_auth_response()

The ieee80211_check_auth_response() function has a signedness bug because
it's a declared as a u16 but it return -ENOMEM.  When you look at it more
closely it returns a mix of error codes including 0xcafe, -ENOMEM, and
a->status which is WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG.  This is a mess.

Clean it up to just return standard kernel error codes.  We can print
out the a->status before returning a regular error code.  The printks
in the caller need to be adjusted as well.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650593435-9017-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove unneeded variable ret in rtw_suspend()
Wan Jiabing [Fri, 22 Apr 2022 02:10:38 +0000 (10:10 +0800)]
staging: r8188eu: Remove unneeded variable ret in rtw_suspend()

Fix the following coccicheck error:
drivers/staging/r8188eu/os_dep/usb_intf.c:202:5-8: Unneeded variable: "ret". Return "0" on line 242

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20220422021046.121870-1-wanjiabing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: fieldbus: Fix the error handling path in anybuss_host_common_probe()
Christophe JAILLET [Fri, 22 Apr 2022 06:48:18 +0000 (08:48 +0200)]
staging: fieldbus: Fix the error handling path in anybuss_host_common_probe()

If device_register() fails, device_unregister() should not be called
because it will free some resources that are not allocated.
put_device() should be used instead.

Fixes: 308ee87a2f1e ("staging: fieldbus: anybus-s: support HMS Anybus-S bus")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/5401a519608d6e1a4e7435c20f4f20b0c5c36c23.1650610082.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vchiq:remove unneeded flush_workqueue
ran jianping [Fri, 22 Apr 2022 09:33:40 +0000 (09:33 +0000)]
staging: vchiq:remove unneeded flush_workqueue

All work currently pending will be done first by calling destroy_workqueue,
so there is no need to flush it explicitly.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ran jianping <ran.jianping@zte.com.cn>
Link: https://lore.kernel.org/r/20220422093340.2781311-1-ran.jianping@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: fix the index check in mgt_dispatcher
Martin Kaiser [Fri, 22 Apr 2022 14:09:58 +0000 (16:09 +0200)]
staging: r8188eu: fix the index check in mgt_dispatcher

In mgt_dispatcher, we check that index is a valid index for the
mlme_sta_tbl array. The valid indices for this array are from 0 to
ARRAY_SIZE(mlme_sta_tbl) - 1.

An invalid index is >= ARRAY_SIZE(mlme_sta_tbl). Fix the off by one error
in the check.

Fixes: db84803cd8de ("staging: r8188eu: use ARRAY_SIZE for mlme_sta_tbl")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220422140958.239767-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vme: Move 'vme/devices/' to 'vme_user/'
Bruno Moreira-Guedes [Thu, 21 Apr 2022 14:59:34 +0000 (11:59 -0300)]
staging: vme: Move 'vme/devices/' to 'vme_user/'

In <db3b9e990e75573402cda22faf933760f076c033> ("Staging: VME: move VME
drivers out of staging") the vme code, board and bridge drivers were
moved out of the staging tree, remaining only the VME user device
driver.

Since this driver is the only one remaining in staging, such multi-level
structure confuses more than helps. The current structure is as follows:

 - drivers/staging/vme/
                       Makefile
                       devices/
                               Kconfig
                               Makefile
                               vme_user.c
                               vme_user.h

The top-level Makefile has the only function of calling another Makefile
into the devices/ subdirectory. This latter only compiles the vme_user
driver, since there is no other in the staging tree.

This patch removes the unnecessary Makefile from the 'vme/' dir, move
the contents of 'vme/devices' into the 'vme/' dir, and renames it to
'vme_user/' (the driver name), allowing a straightforward understanding
of this driver's contents. Furthermore, it updates the MAINTAINERS file
to properly reflect the new paths.

Signed-off-by: Bruno Moreira-Guedes <codeagain@codeagain.dev>
Link: https://lore.kernel.org/r/2cd7de9a426c443a5ea618682d605ecfd751d798.1650544175.git.codeagain@codeagain.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vme: Add VME_BUS dependency to Kconfig
Bruno Moreira-Guedes [Thu, 21 Apr 2022 14:59:02 +0000 (11:59 -0300)]
staging: vme: Add VME_BUS dependency to Kconfig

The KConfig file for VME_USER ('drivers/staging/vme/devices/Kconfig')
sourced at "drivers/vme/boards/KConfig" misses a `depends on` line for
VME_BUS, which is unnoticeable for menuconfig users who aren't be able
to select it through this interface without setting the CONFIG_VME_BUS
option because it's nested on VME_BUS menu entry.

A patch to move appropriately this driver to the "Staging" submenu
([PATCH 1/3], originally sent as a single patch submitted at
https://lore.kernel.org/linux-staging/3fbc5325e94b9ae0666a1f5a56a4e5372bfcea1d.camel@codeagain.dev/T/#t),
however, unveiled this missing `depends on` line, since it moved the
`source` line for VME_USER's KConfig to somewhere else, allowing it to
be compiled without the support for VME_BUS. While it compiles fine and
seems to initialize the driver fine (tested both as module and as built-
in), it seems to make no sense having VME_USER without VME_BUS.

This patches addresses it by adding the VME_BUS to the `depends on` line
at "drivers/staging/vme/devices/Kconfig".

Signed-off-by: Bruno Moreira-Guedes <codeagain@codeagain.dev>
Link: https://lore.kernel.org/r/00de5644d7c2f8c8878eccf86b761e0602732089.1650544175.git.codeagain@codeagain.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vme: Move vme_user to staging KConfig
Bruno Moreira-Guedes [Thu, 21 Apr 2022 14:58:24 +0000 (11:58 -0300)]
staging: vme: Move vme_user to staging KConfig

Currently, the VME_USER driver is in the staging tree Kconfig, unlike
other VME drivers already moved to the main portions of the kernel tree.
Its configuration is, however, nested into the VME_BUS config option,
which might be misleading.

Since the staging tree "[...] is used to hold stand-alone drivers and
filesystem that are not ready to be merged into the main portion of the
Linux kernel tree [...]"(from
https://lore.kernel.org/all/20090320172502.GA14647@kroah.com/T/),
staging drivers should appear nested into the Main Menu -> Device
Drivers -> Staging Drivers to make sure the user don't pick it without
being fully aware of its staging status as it could be the case in
Menu -> Device Drivers -> VME bridge support (the current location).

With this change menuconfig users will clearly know this is not a driver
in the main portion of the kernel tree and decide whether to build it or
not with that clearly in mind.

This change goes into the same direction of commit
<4b4cdf3979c32fa3d042d150f49449c74d048553> ("STAGING: Move staging
drivers back to staging-specific menu")

Signed-off-by: Bruno Moreira-Guedes <codeagain@codeagain.dev>
Link: https://lore.kernel.org/r/f6e6d1d2b02385f11848022f154007ef191181c1.1650544175.git.codeagain@codeagain.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use in-kernel ieee channel
Solomon Tan [Thu, 21 Apr 2022 23:52:38 +0000 (07:52 +0800)]
staging: r8188eu: use in-kernel ieee channel

Use the in-kernel structure and flags instead of defining a separate
one. The rtw_ieee80211_channel structure and flags can be replaced by
the ieee80211_channel defined in include/net/cfg80211.h since the flags
serve the same purpose and the ieee80211_channel struct includes the
elements used in the rtw_ieee80211_channel struct.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220421235237.4218-1-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: correct typo in comments
Jaehee Park [Thu, 21 Apr 2022 19:20:31 +0000 (15:20 -0400)]
staging: r8188eu: correct typo in comments

Correct misspellings in the comments. Issue found with checkpatch.

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/56b25e4394396823d52f1fe1b312c5a307aea0fc.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: replace spaces with tabs
Jaehee Park [Thu, 21 Apr 2022 19:20:30 +0000 (15:20 -0400)]
staging: r8188eu: replace spaces with tabs

Use tabs instead of spaces. Issue found with checkpatch.
WARNING: suspect code indent for conditional statements

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/fd4a66013be081bc5adb491c6dc7774362d1ac82.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove 'added by' author comments
Jaehee Park [Thu, 21 Apr 2022 19:20:28 +0000 (15:20 -0400)]
staging: r8188eu: remove 'added by' author comments

Author comments "Added by Albert" and "Added by Annie" are sprinkled
through the file. These comments are not useful and can be removed.

Suggested-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/dd22bbe6b018aadec620d1ef8215e19852099f7c.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove spaces before tabs
Jaehee Park [Thu, 21 Apr 2022 19:20:27 +0000 (15:20 -0400)]
staging: r8188eu: remove spaces before tabs

Delete spaces before tabs in the comments. Issue found with checkpatch.
WARNING: please, no space before tabs

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/1b1e8cda03ca5d3fdf26c511da76258f7a2ab8d5.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary braces in single statement block
Jaehee Park [Thu, 21 Apr 2022 19:20:26 +0000 (15:20 -0400)]
staging: r8188eu: remove unnecessary braces in single statement block

Remove braces for single statement block to minimize the number of
empty lines, without loss of readability. Issue found with checkpatch.
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/b96ae957e2ddc519e56813a1c56e770168f67a2d.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove OnAction_dls
Martin Kaiser [Thu, 21 Apr 2022 20:08:04 +0000 (22:08 +0200)]
staging: r8188eu: remove OnAction_dls

Remove the empty function OnAction_dls and its entry in OnAction_tbl.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200805.192083-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove OnAction_qos
Martin Kaiser [Thu, 21 Apr 2022 20:08:03 +0000 (22:08 +0200)]
staging: r8188eu: remove OnAction_qos

Remove the empty function OnAction_qos and its entry in OnAction_tbl.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200805.192083-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: on_action_spct does nothing
Martin Kaiser [Thu, 21 Apr 2022 20:08:02 +0000 (22:08 +0200)]
staging: r8188eu: on_action_spct does nothing

One of the entries in OnAction_tbl refers to on_action_spct. This function
reads some information but it performs no action. Remove on_action_spct
and its entry in OnAction_tbl.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200805.192083-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove dummy entries from OnAction_tbl
Martin Kaiser [Thu, 21 Apr 2022 20:08:01 +0000 (22:08 +0200)]
staging: r8188eu: remove dummy entries from OnAction_tbl

Unlike mlme_sta_tbl, OnAction_tbl is an array of structs.

OnAction iterates over the array to find the entry for a specific action
category. No action is performed if a category has no entry.

We can remove the entries that point to the dummy function DoReserved.
These were the last users of DoReserved, the function itself can be
removed as well.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200805.192083-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove OnAtim
Martin Kaiser [Thu, 21 Apr 2022 20:04:49 +0000 (22:04 +0200)]
staging: r8188eu: remove OnAtim

Remove the empty OnAtim function. We can set the function pointer in
mlme_sta_tbl to NULL if no action is required for this management frame
subtype.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200449.191983-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Fix signedness bug in rtllib_rx_assoc_resp()
Haowen Bai [Thu, 21 Apr 2022 08:21:17 +0000 (16:21 +0800)]
staging: rtl8192e: Fix signedness bug in rtllib_rx_assoc_resp()

The rtllib_rx_assoc_resp() function has a signedness bug because it's
a declared as a u16 but it return -ENOMEM.  When you look at it more
closely it returns a mix of error codes including 0xcafe, -ENOMEM, and
a->status which is WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG.  This is a mess.

Clean it up to just return standard kernel error codes.  We can print
out the a->status before returning a regular error code.  The printks
in the caller need to be adjusted as well.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650529277-7893-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Drop redundant memset
Haowen Bai [Thu, 21 Apr 2022 09:20:43 +0000 (17:20 +0800)]
staging: r8188eu: Drop redundant memset

The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy. So we drop redundant memset.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650532843-28132-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove leftover code for other chips
Artur Bujdoso [Thu, 21 Apr 2022 06:52:19 +0000 (08:52 +0200)]
staging: rtl8723bs: remove leftover code for other chips

Clean up unreferenced definitions in hal headers and code.

Signed-off-by: Artur Bujdoso <artur.bujdoso@gmail.com>
Link: https://lore.kernel.org/r/YmD/I19v8sJLrOQo@crux
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192u: change get_key functions to return 0 instead of -1
Rebecca Mckeever [Wed, 20 Apr 2022 12:23:28 +0000 (07:23 -0500)]
staging: rtl8192u: change get_key functions to return 0 instead of -1

Currently, these three get_key functions return -1 when the provided len
value is less a specific key length value, which can result in buffer
overflow depending on how the returned value is used. These functions are
used in three places in ieee80211/ieee80211_wx.c:

  ieee80211_wx_get_encode() :
    The behavior of this function will be unchanged.

  ieee80211_wx_get_encode_ext() :
    The result of the get_key function is written to ext->key_len,
    resulting in a buffer overflow if the result is negative.

  ieee80211_wx_set_encode() :
    The behavior of this function will change. When len is less than the
    key length value, it will set a default key of all 0.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/Yl/7QPKXer7YtXOs@bertie
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192e: Remove space after cast
Solomon Tan [Tue, 19 Apr 2022 12:43:19 +0000 (20:43 +0800)]
staging: rtl8192e: Remove space after cast

This patch addresses the checkpatch.pl flag that there should not be a
space after a cast.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220419124318.8028-1-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agodrivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop()
Duoming Zhou [Sun, 17 Apr 2022 14:16:41 +0000 (22:16 +0800)]
drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop()

There is a deadlock in rtllib_beacons_stop(), which is shown
below:

   (Thread 1)              |      (Thread 2)
                           | rtllib_send_beacon()
rtllib_beacons_stop()      |  mod_timer()
 spin_lock_irqsave() //(1) |  (wait a time)
 ...                       | rtllib_send_beacon_cb()
 del_timer_sync()          |  spin_lock_irqsave() //(2)
 (wait timer to stop)      |  ...

We hold ieee->beacon_lock in position (1) of thread 1 and
use del_timer_sync() to wait timer to stop, but timer handler
also need ieee->beacon_lock in position (2) of thread 2.
As a result, rtllib_beacons_stop() will block forever.

This patch extracts del_timer_sync() from the protection of
spin_lock_irqsave(), which could let timer handler to obtain
the needed lock.

Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20220417141641.124388-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agodrivers: staging: rtl8192u: Fix deadlock in ieee80211_beacons_stop()
Duoming Zhou [Sun, 17 Apr 2022 13:54:07 +0000 (21:54 +0800)]
drivers: staging: rtl8192u: Fix deadlock in ieee80211_beacons_stop()

There is a deadlock in ieee80211_beacons_stop(), which is shown below:

   (Thread 1)              |      (Thread 2)
                           | ieee80211_send_beacon()
ieee80211_beacons_stop()   |  mod_timer()
 spin_lock_irqsave() //(1) |  (wait a time)
 ...                       | ieee80211_send_beacon_cb()
 del_timer_sync()          |  spin_lock_irqsave() //(2)
 (wait timer to stop)      |  ...

We hold ieee->beacon_lock in position (1) of thread 1 and use
del_timer_sync() to wait timer to stop, but timer handler
also need ieee->beacon_lock in position (2) of thread 2.
As a result, ieee80211_beacons_stop() will block forever.

This patch extracts del_timer_sync() from the protection of
spin_lock_irqsave(), which could let timer handler to obtain
the needed lock.

Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Link: https://lore.kernel.org/r/20220417135407.109536-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8192u: compare strcmp result to zero
Rebecca Mckeever [Sat, 16 Apr 2022 10:24:34 +0000 (05:24 -0500)]
staging: rtl8192u: compare strcmp result to zero

Add " == 0" to the condition in both else if branches to address a
possible bug. strcmp returns 0 when its arguments are equal, which
evaluates to false, often leading to errors when used in if statements.

Currently, the statement in the first else if branch does not execute
when its arguments are equal, but it does execute when crypt->ops->name
equals any string other than "WEP" or "TKIP".

Similarly, the second else if branch does not execute when its arguments
are equal, and it only executes when crypt->ops->name equals "TKIP".
The else branch never executes.

It is unlikely that this is working as intended.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/20220416102434.97567-1-remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: iio: ad2s1210: remove redundant assignment to variable negative
Colin Ian King [Mon, 18 Apr 2022 13:46:03 +0000 (14:46 +0100)]
staging: iio: ad2s1210: remove redundant assignment to variable negative

Variable negative is being assigned a value that is never read, it is
being re-assigned later. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/staging/iio/resolver/ad2s1210.c:502:3: warning: Value stored
to 'negative' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220418134603.81336-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace VNSvInPortB with ioread8
Philipp Hortmann [Sat, 16 Apr 2022 08:00:55 +0000 (10:00 +0200)]
staging: vt6655: Replace VNSvInPortB with ioread8

Replace macro VNSvInPortB with ioread8. Avoid cast of the return
value is possible with one exception.
The name of macro and the arguments use CamelCase which
is not accepted by checkpatch.pl

Since there are more than one checkpatch issue per line,
more steps are rquired to fix.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/fd71797d9d55d53f95c5c4e2df826bf85dd4626a.1650094595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Replace MACvGPIOIn with VNSvInPortB
Philipp Hortmann [Sat, 16 Apr 2022 08:00:50 +0000 (10:00 +0200)]
staging: vt6655: Replace MACvGPIOIn with VNSvInPortB

Replace macro MACvGPIOIn with VNSvInPortB.
Next patch will replace all macros VNSvInPortB with ioread8.
The names of macros and the arguments use CamelCase which
is not accepted by checkpatch.pl

Since there are more than one checkpatch issue per line,
more steps are rquired to fix.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/0a3c3eb0d4dad544fa281b34c5a70d4a3ab2d9f1.1650094595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8712: Remove unnecessary int typecast
Solomon Tan [Sun, 17 Apr 2022 16:54:48 +0000 (16:54 +0000)]
staging: rtl8712: Remove unnecessary int typecast

This patch gets rid of the following error from checkpatch.pl:
WARNING: Unnecessary typecast of c90 int constant.

Signed-off-by: Solomon Tan <solomonbstoner@protonmail.ch>
Link: https://lore.kernel.org/r/YlxGTMBsLqdOIrpC@ArchDesktop
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: qlge: add blank line after function declaration
Soumya Negi [Sat, 16 Apr 2022 19:17:45 +0000 (12:17 -0700)]
staging: qlge: add blank line after function declaration

Adhere to linux coding style. Reported by checkpatch:
CHECK: Please use a blank line after function/struct/union/enum declarations

Signed-off-by: Soumya Negi <soumya.negi97@gmail.com>
Link: https://lore.kernel.org/r/20220416191745.7079-1-soumya.negi97@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Delete tmacro.h
Philipp Hortmann [Sat, 16 Apr 2022 19:16:22 +0000 (21:16 +0200)]
staging: vt6655: Delete tmacro.h

Relocate the only macro MAKEWORD that is in use and remove file
tmacro.h. File needs to be changed anyhow because of use of CamelCase
which is not accepted by checkpatch.pl. Reduced code provides
a better overview.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20220416191622.GA11596@matrix-ESPRIMO-P710
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: Remove the drivers for the Unisys s-Par
Fabio M. De Francesco [Thu, 14 Apr 2022 10:32:17 +0000 (12:32 +0200)]
staging: Remove the drivers for the Unisys s-Par

The Unisys sub-tree of drivers/staging contains three drivers for the
"Unisys Secure Partition" (s-Par(R)): visorhba, visorinput, visornic.

They have no maintainers, in fact the only one that is listed in
MAINTAINERS has an unreacheable email address. During 2021 and 2022
several patches have been submitted to these drivers but nobody at
Unisys cared of reviewing the changes. Probably, also the
"sparmaintainer" internal list of unisys.com is not anymore read by
interested Unisys' engineers.

Therefore, remove the drivers/staging/unisys directory and delete the
relevant entries in the MAINTAINERS, Kconfig, Makefile files, then
remove also the drivers/visorbus directory which is not anymore needed
(it contained the driver for the virtualized bus for the Unisys s-Par
firmware).

Cc: David Kershner <david.kershner@unisys.com>
Cc: <sparmaintainer@unisys.com>
Cc: Ken Cox <jkc@redhat.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20220414103217.32058-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use in-kernel ieee80211 header structures
Michael Straube [Mon, 18 Apr 2022 18:09:16 +0000 (20:09 +0200)]
staging: r8188eu: use in-kernel ieee80211 header structures

The structures

rtw_ieee80211_hdr
rtw_ieee80211_hdr_3addr
rtw_ieee80211_hdr_3addr_qos

in drivers/staging/r8188eu/include/ieee80211.h just duplicate the
in-kernel structures from include/linux/ieee80211.h.

ieee80211_hdr
ieee80211_hdr_3addr
ieee80211_qos_hdr

Remove the rtw_ prefixed structures and use the in-kernel versions.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220418180916.11311-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>