platform/kernel/linux-rpi.git
2 years agostaging: r8188eu: cur_ant is set but never used
Michael Straube [Tue, 5 Apr 2022 10:49:07 +0000 (12:49 +0200)]
staging: r8188eu: cur_ant is set but never used

In rtw_select_and_join_from_scanned_queue() the local variable cur_ant
is set but never used. Remove the variable and related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220405104910.9769-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused macros from ieee80211.h
Michael Straube [Tue, 5 Apr 2022 06:08:13 +0000 (08:08 +0200)]
staging: r8188eu: remove unused macros from ieee80211.h

Remove unused macros from ieee80211.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220405060813.8448-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unncessary ternary operator
Michael Straube [Tue, 5 Apr 2022 06:08:12 +0000 (08:08 +0200)]
staging: r8188eu: remove unncessary ternary operator

There are some uses of ternary operator where it explicitly sets
true or false but the condition already evaluates to true or false.
In this cases the ternary operator is redundant and can be removed.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220405060813.8448-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Rename constant definitions with CamelCase
Philipp Hortmann [Mon, 4 Apr 2022 20:48:42 +0000 (22:48 +0200)]
staging: vt6655: Rename constant definitions with CamelCase

Rename constant definitions with CamelCase in mac.h as
they are not accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/19cfb3ec78eaba8e839578b1ea5a6eb09e8c09be.1649103348.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vt6655: Remove unused macros in mac.h
Philipp Hortmann [Mon, 4 Apr 2022 20:48:35 +0000 (22:48 +0200)]
staging: vt6655: Remove unused macros in mac.h

Remove unused macros with do-while(0) loop or CamelCase in mac.h as
they are not accepted by checkpatch.pl

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/78f72d0aa3d1bdddf3c415fd4c458399aa5e7cbf.1649103348.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove space after function name
Sevinj Aghayeva [Tue, 5 Apr 2022 03:16:12 +0000 (23:16 -0400)]
staging: rtl8723bs: remove space after function name

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: space prohibited between function name and open parenthesis

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/86494fef795f1c3e28c55e556d68b407dadd1488.1649128267.git.sevinj.aghayeva@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove redundant else branches
Sevinj Aghayeva [Tue, 5 Apr 2022 03:16:09 +0000 (23:16 -0400)]
staging: rtl8723bs: remove redundant else branches

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: else is not generally useful after a break or return

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/fcb50e467d5ac81becf222379bcc21136966b86b.1649128267.git.sevinj.aghayeva@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove return from a function returning void
Sevinj Aghayeva [Tue, 5 Apr 2022 03:16:10 +0000 (23:16 -0400)]
staging: rtl8723bs: remove return from a function returning void

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: void function return statements are not generally useful

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/d1aa09f34cd192e284048999ba8e20d26a224483.1649128267.git.sevinj.aghayeva@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove redundant braces in if statements
Sevinj Aghayeva [Tue, 5 Apr 2022 03:16:08 +0000 (23:16 -0400)]
staging: rtl8723bs: remove redundant braces in if statements

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/5f3a013af7ca5ac02b4d680fa22a23049f5712db.1649128267.git.sevinj.aghayeva@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: combine both sides of conditional statement
Rebecca Mckeever [Tue, 5 Apr 2022 01:10:44 +0000 (20:10 -0500)]
staging: rtl8723bs: combine both sides of conditional statement

Both sides of conditional statement are the same except for the comment.
Additional instances found with git grep.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/23cfd782614e09f57a514aab68407183702b0a2c.1649120568.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove handlerOS independent comment
Rebecca Mckeever [Tue, 5 Apr 2022 01:10:43 +0000 (20:10 -0500)]
staging: rtl8723bs: remove handlerOS independent comment

The "need to make timeout handlerOS independent" comment is incorrect.
Remove the comment to avoid misleading developers.
Additional instances found with git grep.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/416ed753b7b3062cc8c674dea9028fc901e85426.1649120568.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: simplify control flow
Sevinj Aghayeva [Sun, 3 Apr 2022 22:42:07 +0000 (18:42 -0400)]
staging: rtl8723bs: simplify control flow

Checkpatch issues "WARNING: else is not generally useful after a break
or return" for the following code:

while (1) {
do_join_r = rtw_do_join(padapter);
if (do_join_r == _SUCCESS) {
break;
} else {
rtw_dec_to_roam(padapter);

if (rtw_to_roam(padapter) > 0) {
continue;
} else {
rtw_indicate_disconnect(padapter);
break;
}
}
}

We simplify this code in multiple steps. First, we remove do_join_r
variable because it is only used right after it is assigned. Second,
we remove the unnecessary else statement right after break:

while (1) {
if (rtw_do_join(padapter) == _SUCCESS)
break;
rtw_dec_to_roam(padapter);

if (rtw_to_roam(padapter) > 0) {
continue;
} else {
rtw_indicate_disconnect(padapter);
break;
}
}

Next, we move the call to rtw_do_join into the while test because the
while will loop only until the call is successful:

while (rtw_do_join(padapter) != _SUCCESS) {
rtw_dec_to_roam(padapter);
if (rtw_to_roam(padapter) > 0) {
continue;
} else {
rtw_indicate_disconnect(padapter);
break;
}
}

Finally, looking at the code above, it is clear that the code will
break out of the loop if rtw_to_roam call is <= 0. Hence:

while (rtw_do_join(padapter) != _SUCCESS) {
rtw_dec_to_roam(padapter);
if (rtw_to_roam(padapter) <= 0) {
rtw_indicate_disconnect(padapter);
break;
}
}

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220403224207.GA397480@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8712: simplify control flow
Sevinj Aghayeva [Sun, 3 Apr 2022 16:53:25 +0000 (12:53 -0400)]
staging: rtl8712: simplify control flow

The function iterates an index from 0 to NUM_PMKID_CACHE and returns
the first index for which the condition is true. If no such index is
found, the function returns -1. Current code has a complex control
flow that obfuscates this simple task. Replace it with a loop.

Also, given the shortened function body, replace the long variable
name psecuritypriv with a short variable name p.

Reported by checkpatch:

WARNING: else is not generally useful after a break or return

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220403165325.GA374638@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: simplify control flow
Sevinj Aghayeva [Sun, 3 Apr 2022 16:42:50 +0000 (12:42 -0400)]
staging: r8188eu: simplify control flow

The function iterates an index from 0 to NUM_PMKID_CACHE and returns
the first index for which the condition is true. If no such index is
found, the function returns -1. Current code has a complex control
flow that obfuscates this simple task. Replace it with a loop.

Also, given the shortened function body, replace the long variable
name psecuritypriv with a short variable name p.

Reported by checkpatch:

WARNING: else is not generally useful after a break or return

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220403164250.GA371601@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8712: remove Unnecessary parentheses
Alaa Mohamed [Mon, 4 Apr 2022 21:19:42 +0000 (23:19 +0200)]
staging: rtl8712: remove Unnecessary parentheses

Reported by checkpatch:

CHECK: Unnecessary parentheses

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Link: https://lore.kernel.org/r/20220404211942.11446-1-eng.alaamohamedsoliman.am@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8712: Fix multiple line dereference
Alaa Mohamed [Mon, 4 Apr 2022 21:00:10 +0000 (23:00 +0200)]
staging: rtl8712: Fix multiple line dereference

Reported by checkpatch:

WARNING: Avoid multiple line dereference

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Link: https://lore.kernel.org/r/20220404210010.9795-1-eng.alaamohamedsoliman.am@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary blank lines
Alaa Mohamed [Mon, 4 Apr 2022 14:52:17 +0000 (16:52 +0200)]
staging: r8188eu: remove unnecessary blank lines

Reported by checkpatch:

CHECK: Blank lines aren't necessary before a close brace '}'

Acked_by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Link: https://lore.kernel.org/r/20220404145217.15069-1-eng.alaamohamedsoliman.am@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Add line after declarations
Alaa Mohamed [Mon, 4 Apr 2022 14:39:17 +0000 (16:39 +0200)]
staging: r8188eu: Add line after declarations

Reported by checkpatch:

WARNING: Missing a blank line after declarations

Acked_by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Link: https://lore.kernel.org/r/19d8f316e43d16c9341f7fe94e68534cf60cc05c.1649082939.git.eng.alaamohamedsoliman.am@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ps_flag is never set
Michael Straube [Mon, 4 Apr 2022 08:21:42 +0000 (10:21 +0200)]
staging: r8188eu: ps_flag is never set

The field ps_flag in struct pwrctrl_priv is never set. It stays at its
default value 0. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220404082142.4639-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: pwr_state_check_cnts is always zero
Michael Straube [Mon, 4 Apr 2022 08:21:41 +0000 (10:21 +0200)]
staging: r8188eu: pwr_state_check_cnts is always zero

The field pwr_state_check_cnts in struct pwrctrl_priv is set to 0 and
never changed. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220404082142.4639-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: pnp_bstop_trx is never set
Michael Straube [Mon, 4 Apr 2022 08:21:40 +0000 (10:21 +0200)]
staging: r8188eu: pnp_bstop_trx is never set

The field pnp_bstop_trx in struct pwrctrl_priv is never set. It stays
at its default value 0. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220404082142.4639-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: reg_rfoff is never set
Michael Straube [Mon, 4 Apr 2022 08:21:39 +0000 (10:21 +0200)]
staging: r8188eu: reg_rfoff is never set

The field reg_rfoff in struct pwrctrl_priv is never set. It stays at
its default value 0. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220404082142.4639-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused fields from struct pwrctrl_priv
Michael Straube [Mon, 4 Apr 2022 08:21:38 +0000 (10:21 +0200)]
staging: r8188eu: remove unused fields from struct pwrctrl_priv

There are some unused fields in the pwrctrl_priv structure.
Remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220404082142.4639-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8712: Fix multiple blank lines warning from .c files
Sathish Kumar [Mon, 4 Apr 2022 03:52:13 +0000 (09:22 +0530)]
staging: rtl8712: Fix multiple blank lines warning from .c files

This patch fixes the checkpatch.pl warnings like:
CHECK: Please don't use multiple blank lines
+
+
from rtl871x_ioctl_rtl.c, rtl871x_ioctl_set.c, rtl871x_recv.c,
and rtl871x_security.c

Signed-off-by: Sathish Kumar <skumark1902@gmail.com>
Link: https://lore.kernel.org/r/20220404035213.2609-1-skumark1902@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8712: Fix multiple blank lines warning from .h files
Sathish Kumar [Mon, 4 Apr 2022 03:47:06 +0000 (09:17 +0530)]
staging: rtl8712: Fix multiple blank lines warning from .h files

This patch fixes the checkpatch.pl warnings like:
CHECK: Please don't use multiple blank lines
+
+
from rtl8712_*.h, rtl871x_*.h, sta_info.h, and wifi.h

Signed-off-by: Sathish Kumar <skumark1902@gmail.com>
Link: https://lore.kernel.org/r/20220404034706.2384-1-skumark1902@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: add blank line between functions
Rebecca Mckeever [Sun, 3 Apr 2022 19:17:06 +0000 (14:17 -0500)]
staging: r8188eu: add blank line between functions

Conform to Linux kernel coding style.
Noticed when completing a different patch.

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/ccacca6f679a879ad2032dc0aeb0b0156e3a847b.1649011311.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: combine both sides of conditional statement
Rebecca Mckeever [Sun, 3 Apr 2022 19:17:05 +0000 (14:17 -0500)]
staging: r8188eu: combine both sides of conditional statement

Both sides of conditional statement are the same except for the comment.
Additional instance found with git grep.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/d33c51bc3a20fa25e4737b258f3b1c42cc8124e3.1649011311.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove handlerOS independent comment
Rebecca Mckeever [Sun, 3 Apr 2022 19:17:04 +0000 (14:17 -0500)]
staging: r8188eu: remove handlerOS independent comment

The "need to make timeout handlerOS independent" comment is incorrect.
Remove the comment to avoid misleading developers.
Additional instance found with git grep.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/7d0d2253d86f46bc0def0447de424727d70f03a7.1649011311.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove the bretry variable
Martin Kaiser [Sun, 3 Apr 2022 16:54:38 +0000 (18:54 +0200)]
staging: r8188eu: remove the bretry variable

Remove the bretry variable. It's set and used only once. Call the
ieee80211 helper directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: don't call get_hdr_bssid
Martin Kaiser [Sun, 3 Apr 2022 16:54:37 +0000 (18:54 +0200)]
staging: r8188eu: don't call get_hdr_bssid

Do not call get_hdr_bssid from validate_recv_data_frame.

We already distinguish between the four cases for to_ds, from_ds. Copy
the bssid address as described in the "DS bit usage" table in
include/linux/ieee80211.h.

Eventually, we should remove get_hdr_bssid (and other similar
driver-specific parsing functions).

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove psa, pda
Martin Kaiser [Sun, 3 Apr 2022 16:54:36 +0000 (18:54 +0200)]
staging: r8188eu: remove psa, pda

Remove the psa, pda variables. They are set and read only once.
We can use the ieee80211 helpers directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: ra and ta do not depend on to_ds, from_ds
Martin Kaiser [Sun, 3 Apr 2022 16:54:35 +0000 (18:54 +0200)]
staging: r8188eu: ra and ta do not depend on to_ds, from_ds

The "DS bit usage" table in include/linux/ieee80211.h shows that
ra is always addr1 and ta is always addr2.

We can set pattrib->ra and pattrib->ta regardless of the to_ds and
from_ds bits.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove to_fr_ds from struct rx_pkt_attrib
Martin Kaiser [Sun, 3 Apr 2022 16:54:34 +0000 (18:54 +0200)]
staging: r8188eu: remove to_fr_ds from struct rx_pkt_attrib

to_fr_ds in struct rx_pkt_attrib stores the values of the to_ds and
from_ds bits of an incoming data frame. to_fr_ds is set by parsing the
frame control bytes and it's used only in validate_recv_data_frame.

Remove to_fr_ds from struct rx_pkt_attrib and use the ieee80211 helpers
to distinguish between the four different cases for to_ds, from_ds.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: don't copy ra and ta before we fail
Martin Kaiser [Sun, 3 Apr 2022 16:54:33 +0000 (18:54 +0200)]
staging: r8188eu: don't copy ra and ta before we fail

In validate_recv_data_frame, we return an error if both to_ds and
from_ds are set in the incoming data frame. There's no need to populate
patrib->ra and ta before we return. The caller will free the received
frame, including pattrib.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: to_fr_ds cannot be 3 here
Martin Kaiser [Sun, 3 Apr 2022 16:54:32 +0000 (18:54 +0200)]
staging: r8188eu: to_fr_ds cannot be 3 here

Remove two unnecessary ternary operators in validate_recv_data_frame.
pattrib->to_fr_ds cannot be 3 in these places. If it was 3, we'd already
have returned an error to the caller.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: simplify error handling
Martin Kaiser [Sun, 3 Apr 2022 16:54:31 +0000 (18:54 +0200)]
staging: r8188eu: simplify error handling

Simplify the error handling in validate_recv_data_frame. The function does
not have to do any cleanup for errors, we can return immediately.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211 helper for retry bit
Martin Kaiser [Sun, 3 Apr 2022 16:54:30 +0000 (18:54 +0200)]
staging: r8188eu: use ieee80211 helper for retry bit

Use the ieee80211 helper to check if the retry bit is set in the incoming
data frame.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211 helper for destination address
Martin Kaiser [Sun, 3 Apr 2022 16:54:29 +0000 (18:54 +0200)]
staging: r8188eu: use ieee80211 helper for destination address

Use the ieee80211_get_DA helper to get a pointer to the destination
address of the incoming data frame.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211 helper for source address
Martin Kaiser [Sun, 3 Apr 2022 16:54:28 +0000 (18:54 +0200)]
staging: r8188eu: use ieee80211 helper for source address

Use the ieee80211_get_SA helper to get a pointer to the source
address of the incoming data frame.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403165438.357728-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211 struct for aid
Martin Kaiser [Sun, 3 Apr 2022 16:45:26 +0000 (18:45 +0200)]
staging: r8188eu: use ieee80211 struct for aid

Remove the GetAid macro and map the frame data to a struct
ieee80211_pspoll instead. We can then read the aid component.

psta->aid is in host endianness and has a 0x3FFF mask applied. We have to
convert our read value as well and apply the mask before we compare it to
psta->aid.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403164526.357371-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211 structs for addresses
Martin Kaiser [Sun, 3 Apr 2022 16:45:25 +0000 (18:45 +0200)]
staging: r8188eu: use ieee80211 structs for addresses

Map the incoming frame data to a struct ieee80211_hdr and extract
the addresses.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403164526.357371-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: exit straight away if we have no pspoll frame
Martin Kaiser [Sun, 3 Apr 2022 16:45:24 +0000 (18:45 +0200)]
staging: r8188eu: exit straight away if we have no pspoll frame

validate_recv_ctrl_frame wraps nearly all of its code into a large
if (pspoll) { ... } clause.

Revert this condition and exit if the incoming frame is not a pspoll
frame.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403164526.357371-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211 helper to check for pspoll
Martin Kaiser [Sun, 3 Apr 2022 16:45:23 +0000 (18:45 +0200)]
staging: r8188eu: use ieee80211 helper to check for pspoll

Use the ieee80211 helper to check if our incoming ctrl frame is a
pspoll frame.

We can drop the initial ctrl frame check as ieee80211_is_pspoll
checks for a control frame with subtype pspoll.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403164526.357371-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: make validate_recv_ctrl_frame return void
Martin Kaiser [Sun, 3 Apr 2022 16:45:22 +0000 (18:45 +0200)]
staging: r8188eu: make validate_recv_ctrl_frame return void

Make validate_recv_ctrl_frame return void.

At the moment, the function always returns _FAIL, the caller does not
check the return value.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403164526.357371-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use ieee80211 helpers in validate_recv_mgnt_frame
Martin Kaiser [Sun, 3 Apr 2022 16:38:18 +0000 (18:38 +0200)]
staging: r8188eu: use ieee80211 helpers in validate_recv_mgnt_frame

Use the ieee80211 helpers to detect the frame subtype in
and to parse mac addresses in validate_recv_mgnt_frame.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403163818.357173-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: make validate_recv_mgnt_frame return void
Martin Kaiser [Sun, 3 Apr 2022 16:38:17 +0000 (18:38 +0200)]
staging: r8188eu: make validate_recv_mgnt_frame return void

Change the validate_recv_mgnt_frame function to not return a status.

It always returns _SUCCESS, its only caller does not check the
return value.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403163818.357173-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove constant variable
Martin Kaiser [Sun, 3 Apr 2022 16:32:06 +0000 (18:32 +0200)]
staging: r8188eu: remove constant variable

wifi_test_chk_rate is always 1. Remove the variable and the code to
check it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403163206.357004-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary jump
Martin Kaiser [Sun, 3 Apr 2022 16:32:05 +0000 (18:32 +0200)]
staging: r8188eu: remove unnecessary jump

Don't jump to _continue, we go there anyway.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220403163206.357004-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vme_user: Fixed typo in the MODULE_AUTHOR
Bruno Moreira-Guedes [Sun, 3 Apr 2022 22:27:28 +0000 (19:27 -0300)]
staging: vme_user: Fixed typo in the MODULE_AUTHOR

The MODULE_AUTHOR line missed the '>' character in the end of the
author's e-mail address. Just added it.

Signed-off-by: Bruno Moreira-Guedes <codeagain@codeagain.dev>
Link: https://lore.kernel.org/r/20220403222728.276111-1-codeagain@codeagain.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wfx: change variable name to be consistent
Jaehee Park [Fri, 1 Apr 2022 14:53:50 +0000 (10:53 -0400)]
staging: wfx: change variable name to be consistent

Change variable name to be consistent with the naming conventions.
ssidlen was changed to ssid_len and ssidie was changed to ssid_ie to be
consistent. This makes the variables more readable. The other ssid
names in the code are separated by an underscore. For example,
bssid_filter and num_of_ssids have the ssid separated from the rest of
the words with an underscore.

Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220401145350.GA45053@jaehee-ThinkPad-X1-Extreme
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: clean up comment for rtw_pwr_wakeup()
Michael Straube [Sun, 3 Apr 2022 10:37:13 +0000 (12:37 +0200)]
staging: r8188eu: clean up comment for rtw_pwr_wakeup()

Clean up the comment for rtw_pwr_wakeup() by removing obvious
information.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220403103713.12883-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove macro rtw_pwr_wakeup()
Michael Straube [Sun, 3 Apr 2022 10:37:12 +0000 (12:37 +0200)]
staging: r8188eu: remove macro rtw_pwr_wakeup()

After previous cleanups the rtw_pwr_wakeup() macro is just an alias
for _rtw_pwr_wakeup(). Remove the macro and rename _rtw_pwr_wakeup()
to rtw_pwr_wakeup().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220403103713.12883-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove constant parameter from _rtw_pwr_wakeup()
Michael Straube [Sun, 3 Apr 2022 10:37:11 +0000 (12:37 +0200)]
staging: r8188eu: remove constant parameter from _rtw_pwr_wakeup()

The parameter 'ips_deffer_ms' of _rtw_pwr_wakeup() is always
RTW_PWR_STATE_CHK_INTERVAL. Make it local.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220403103713.12883-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unused parameter from _rtw_pwr_wakeup()
Michael Straube [Sun, 3 Apr 2022 10:37:10 +0000 (12:37 +0200)]
staging: r8188eu: remove unused parameter from _rtw_pwr_wakeup()

The parameter 'caller' of _rtw_pwr_wakeup() is not used. Remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220403103713.12883-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_H2C_FW_P2P_PS_OFFLOAD from SetHwReg8188EU()
Michael Straube [Sat, 2 Apr 2022 09:23:32 +0000 (11:23 +0200)]
staging: r8188eu: remove HW_VAR_H2C_FW_P2P_PS_OFFLOAD from SetHwReg8188EU()

The HW_VAR_H2C_FW_P2P_PS_OFFLOAD case in SetHwReg8188EU() just calls a
function. Call the function directly and remove the
HW_VAR_H2C_FW_P2P_PS_OFFLOAD case from SetHwReg8188EU(). This is part
of the ongoing effort to get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220402092332.6627-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_H2C_FW_JOINBSSRPT from SetHwReg8188EU()
Michael Straube [Sat, 2 Apr 2022 09:23:31 +0000 (11:23 +0200)]
staging: r8188eu: remove HW_VAR_H2C_FW_JOINBSSRPT from SetHwReg8188EU()

The HW_VAR_H2C_FW_JOINBSSRPT case in SetHwReg8188EU() just calls a
function. Call the function directly and remove the
HW_VAR_H2C_FW_JOINBSSRPT case from SetHwReg8188EU(). This is part of
the ongoing effort to get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220402092332.6627-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_RPT_TIMER_SETTING from SetHwReg8188EU()
Michael Straube [Sat, 2 Apr 2022 09:23:30 +0000 (11:23 +0200)]
staging: r8188eu: remove HW_VAR_RPT_TIMER_SETTING from SetHwReg8188EU()

Remove the HW_VAR_RPT_TIMER_SETTING case from SetHwReg8188EU() and
move its functionality to rtw_cmd.c where it is actually used. This is
part of the ongoing effort to get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220402092332.6627-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_ANTENNA_DIVERSITY_SELECT from SetHwReg8188EU()
Michael Straube [Sat, 2 Apr 2022 09:23:29 +0000 (11:23 +0200)]
staging: r8188eu: remove HW_VAR_ANTENNA_DIVERSITY_SELECT from SetHwReg8188EU()

Remove the HW_VAR_ANTENNA_DIVERSITY_SELECT case from SetHwReg8188EU()
and move its functionality to rtw_cmd.c where it is actually used.
This is part of the ongoing effort to get rid of the unwanted hal
layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220402092332.6627-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_AMPDU_MIN_SPACE from SetHwReg8188EU()
Michael Straube [Sat, 2 Apr 2022 09:23:28 +0000 (11:23 +0200)]
staging: r8188eu: remove HW_VAR_AMPDU_MIN_SPACE from SetHwReg8188EU()

Remove the HW_VAR_AMPDU_MIN_SPACE case from SetHwReg8188EU() and move
its functionality to rtw_wlan_util.c where it is actually used. This
is part of the ongoing effort to get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220402092332.6627-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_ACK_PREAMBLE from SetHwReg8188EU()
Michael Straube [Sat, 2 Apr 2022 09:23:27 +0000 (11:23 +0200)]
staging: r8188eu: remove HW_VAR_ACK_PREAMBLE from SetHwReg8188EU()

Remove the HW_VAR_ACK_PREAMBLE case from SetHwReg8188EU() and move
its functionality to rtw_wlan_util.c where it is actually used. This
is part of the ongoing effort to get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220402092332.6627-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_BSSID from SetHwReg8188EU()
Michael Straube [Sat, 2 Apr 2022 09:23:26 +0000 (11:23 +0200)]
staging: r8188eu: remove HW_VAR_BSSID from SetHwReg8188EU()

Remove the HW_VAR_BSSID case from SetHwReg8188EU() and move its
functionality to rtw_mlme_ext.c where it is actually used. This is
part of the ongoing effort to get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220402092332.6627-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix misspelling in comment "cacluated" -> "calculated"
白浩文 [Fri, 1 Apr 2022 10:44:41 +0000 (18:44 +0800)]
staging: r8188eu: Fix misspelling in comment "cacluated" -> "calculated"

This patch fixes some spelling typo in error message reported by
checkpatch.pl

WARNING: 'cacluated' may be misspelled - perhaps 'calculated'?

Signed-off-by: 白浩文 <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1648809881-2777-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: sm750fb: Call iounmap() to free mapped bus memory
Fabio M. De Francesco [Sat, 2 Apr 2022 17:56:55 +0000 (19:56 +0200)]
staging: sm750fb: Call iounmap() to free mapped bus memory

If ioremap_wc() fails, the code jumps to the "exit" label and forgets to
free the bus memory mapped into "sm750_dev->pvReg". Mapped bus memory must
always be freed by calling iounmap().

Call iounmap(sm750_dev->pvReg) when the above-mentioned failures happen.

The site of the missing iounmap() has been detected by Smatch.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20220402175655.31512-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Use the ARRAY_SIZE() macro
Fabio M. De Francesco [Sat, 2 Apr 2022 16:34:39 +0000 (18:34 +0200)]
staging: r8188eu: Use the ARRAY_SIZE() macro

Use the ARRAY_SIZE() macro in places where there are open coded
calculations of the size of arrays.

ARRAY_SIZE(arr) makes sure that "arr" is an array, it's safer than
sizeof(arr) / sizeof(arr[0]), and improves readibility.

Detected with the help of Coccinelle.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20220402163439.20457-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Remove redundant code from rtw_free_netdev()
Fabio M. De Francesco [Sat, 2 Apr 2022 14:06:57 +0000 (16:06 +0200)]
staging: r8188eu: Remove redundant code from rtw_free_netdev()

In rtw_free_netdev() there are two redundant tests. The first checks for
a valid pointer to a "struct net_device". This pointer is the argument
of rtw_free_netdev(). The two callers of this function already test this
parameter immediatelly before the calls. The second checks for a valid
pointer to a "struct rtw_netdev_priv_indicator". This pointer is always
valid and, even if it were not, vfree() is a no-op on NULL pointers.

Therefore the above-mentioned two "if" statements are unnecessary and
redundant. For this reason, remove these two tests.

After removing these tests there is no more need of the "RETURN" label.
Therefore, remove also the "RETURN" label.

Cc: Pavel Skripkin <paskripkin@gmail.com>
Cc: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20220402140657.10549-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove spaces before tabs
Rebecca Mckeever [Sat, 2 Apr 2022 08:50:48 +0000 (03:50 -0500)]
staging: r8188eu: remove spaces before tabs

Conform to Linux kernel coding style.

Reported by checkpatch:

WARNING: please, no space before tabs

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/2fd10f393e3bc7381a85d0bfc1ec04a80af4eabb.1648888462.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove unnecessary braces in conditional statements
Rebecca Mckeever [Sat, 2 Apr 2022 08:50:47 +0000 (03:50 -0500)]
staging: r8188eu: remove unnecessary braces in conditional statements

Conform to Linux kernel coding style.

Reported by checkpatch:

WARNING: braces {} are not necessary for single statement blocks
WARNING: braces {} are not necessary for any arm of this statement

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/2b46501bb3965a8cf27e7134407c50551c36b7e8.1648888462.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: format block comments
Rebecca Mckeever [Sat, 2 Apr 2022 08:50:46 +0000 (03:50 -0500)]
staging: r8188eu: format block comments

Add ' * ' or ' ' to beginning of block comment lines
to conform to Linux kernel coding style.

Reported by checkpatch:

WARNING: Block comments use * on subsequent lines

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/0387f3df49d89c17acf96cf072e70c98e81e58f7.1648888462.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: correct misspelling in comment "conider" -> "consider"
Rebecca Mckeever [Sat, 2 Apr 2022 08:50:45 +0000 (03:50 -0500)]
staging: r8188eu: correct misspelling in comment "conider" -> "consider"

Correct spelling typo. Reported by checkpatch:

CHECK: 'conider' may be misspelled - perhaps 'consider'?

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/5799315f84e50db2a7d05b74cd4ed9ec2f28a8e2.1648888461.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove else after return
Rebecca Mckeever [Sat, 2 Apr 2022 08:50:44 +0000 (03:50 -0500)]
staging: r8188eu: remove else after return

Conform to Linux kernel coding style.

Reported by checkpatch:

WARNING: else is not generally useful after a break or return

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/84db0348481b54f58cb0b6200fa9ae471ee06b3b.1648888461.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: place constants on the right side of tests
Rebecca Mckeever [Sat, 2 Apr 2022 08:50:43 +0000 (03:50 -0500)]
staging: r8188eu: place constants on the right side of tests

Conform to Linux kernel coding style.

Reported by checkpatch:

WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/0f3db3586b3668d6d784e075bc52ffd88b0920d2.1648888461.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wlan-ng: Fix Alignment with parenthesis
Alaa Mohamed [Sat, 2 Apr 2022 11:37:33 +0000 (13:37 +0200)]
staging: wlan-ng: Fix Alignment with parenthesis

Fix " CHECK: Alignment should match open parenthesis "
Reported by checkpath

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Link: https://lore.kernel.org/r/08641d36aaee60797f8c68683b013ebf0215ba2e.1648899123.git.eng.alaamohamedsoliman.am@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: wlan-ng: Fix Lines shouldn't end with '('
Alaa Mohamed [Sat, 2 Apr 2022 11:37:32 +0000 (13:37 +0200)]
staging: wlan-ng: Fix Lines shouldn't end with '('

Fix "CHECK: Lines should not end with a '('"
for lines 331 and 485 Reported By checkpatch

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Link: https://lore.kernel.org/r/82bb0ca2bad1bafbaca8ded6fe82b94e4761f648.1648899123.git.eng.alaamohamedsoliman.am@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: simplify control flow
Sevinj Aghayeva [Fri, 1 Apr 2022 11:46:35 +0000 (07:46 -0400)]
staging: rtl8723bs: simplify control flow

The function iterates an index from 0 to NUM_PMKID_CACHE and returns
the first index for which the condition is true. If no such index is
found, the function returns -1. Current code has a complex control
flow that obfuscates this simple task. Replace it with a loop.

Also, given the shortened function body, replace the long variable
name psecuritypriv with a short variable name p.

Reported by checkpatch:

WARNING: else is not generally useful after a break or return

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220401114635.GA567659@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: vc04_services: Convert kmap() to kmap_local_page()
Fabio M. De Francesco [Wed, 30 Mar 2022 19:14:14 +0000 (21:14 +0200)]
staging: vc04_services: Convert kmap() to kmap_local_page()

The use of kmap() is being deprecated in favor of kmap_local_page()
where it is feasible. In file interface/vchiq_arm/vchiq_arm.c,
function free_pagelist() calls kmap() / kunmap() from two places.

With kmap_local_page(), the mapping is per thread, CPU local and not
globally visible. Therefore, free_pagelist() is a function where the
use of kmap_local_page() in place of kmap() is correctly suited.

Convert to kmap_local_page() but, instead of open coding it, use the
memcpy_to_page() helper.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20220330191414.23141-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: refactor rtw_ch2freq()
Michael Straube [Thu, 31 Mar 2022 21:41:46 +0000 (23:41 +0200)]
staging: rtl8723bs: refactor rtw_ch2freq()

Convert the array ch_freq_map to a simple integer array and use
the indices as channel numbers. This simplifies the code and avoids
looping through the array to get the frequency. To avoid out of
bounds array access return a default value for invalid channel values,
like the original code did.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220331214146.15161-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove 5 GHz channels from ch_freq_map
Michael Straube [Thu, 31 Mar 2022 21:41:45 +0000 (23:41 +0200)]
staging: rtl8723bs: remove 5 GHz channels from ch_freq_map

According to the Realtek documentation the chips this driver supports
are 2.4 GHz only chips. Frequencies for 5 GHz channels can be removed
from the ch_freq_map array.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220331214146.15161-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove handlerOS independent comment
Rebecca Mckeever [Thu, 31 Mar 2022 18:19:45 +0000 (13:19 -0500)]
staging: r8188eu: remove handlerOS independent comment

The "need to make timeout handlerOS independent" comment is incorrect.
Remove the comment to avoid misleading developers.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/YkXwwfYBE+P0UObq@bertie
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: use sizeof(*pvar) for allocating structs
Rebecca Mckeever [Thu, 31 Mar 2022 17:16:04 +0000 (12:16 -0500)]
staging: r8188eu: use sizeof(*pvar) for allocating structs

Use sizeof(*pvar) instead of sizeof(struct var) when allocating memory.
This conforms to Linux kernel coding style, improves readability,
and decreases the opportunity for bugs if the pointer variable type is
changed. Issue found by checkpatch messages of the following format:

CHECK: Prefer kzalloc(sizeof(*pvar)...) over kzalloc(sizeof(struct var)...)

Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/YkXh1HBqaHwT38UC@bertie
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: unisys: Remove "struct dentry *eth_debugfs_dir"
Fabio M. De Francesco [Thu, 31 Mar 2022 06:47:51 +0000 (08:47 +0200)]
staging: unisys: Remove "struct dentry *eth_debugfs_dir"

There is no need for "struct dentry *eth_debugfs_dir" which is used for
debug / sysfs directories. Therefore, remove this "struct dentry" and
everything related (i.e., creation and removal).

As a side effect of this change, the code has no more need of the
"cleanup_register_netdev" label, which can also be removed.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20220331064751.29634-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove GetHwReg8188EU()
Michael Straube [Thu, 31 Mar 2022 13:05:22 +0000 (15:05 +0200)]
staging: r8188eu: remove GetHwReg8188EU()

The only call to GetHwReg8188EU() that is left over from previous
cleanups sets a variable that is immediately overwritten. This call
is useless and we can finally remove the GetHwReg8188EU() function.
This is part of the ongoing effort to get rid of the unwanted hal
layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220331130522.6648-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_FWLPS_RF_ON from GetHwReg8188EU()
Michael Straube [Thu, 31 Mar 2022 13:05:21 +0000 (15:05 +0200)]
staging: r8188eu: remove HW_VAR_FWLPS_RF_ON from GetHwReg8188EU()

Move the functionality of the HW_VAR_FWLPS_RF_ON case in
GetHwReg8188EU() to a static function in rtw_pwrctrl.c and remove the
HW_VAR_FWLPS_RF_ON case from GetHwReg8188EU(). This is part of the
ongoing effort to get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220331130522.6648-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU()
Michael Straube [Thu, 31 Mar 2022 13:05:20 +0000 (15:05 +0200)]
staging: r8188eu: remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU()

The HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU() just calls
rtw_read32(). Remove HW_VAR_CHK_HI_QUEUE_EMPTY from GetHwReg8188EU()
and call rtw_read32() directly. Move the call to a new function to
indicate what it actually does. This is part of the ongoing effort to
get rid of the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220331130522.6648-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU()
Michael Straube [Thu, 31 Mar 2022 13:05:19 +0000 (15:05 +0200)]
staging: r8188eu: remove HW_VAR_BCN_VALID from GetHwReg8188EU()

The HW_VAR_BCN_VALID from GetHwReg8188EU() just calls rtw_read8().
Remove HW_VAR_BCN_VALID from GetHwReg8188EU() and call rtw_read8()
directly. Move the call to a new function to indicate what it actually
does. This is part of the ongoing effort to get rid of the unwanted
hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220331130522.6648-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: rename clear_bacon_valid_bit()
Michael Straube [Thu, 31 Mar 2022 13:05:18 +0000 (15:05 +0200)]
staging: r8188eu: rename clear_bacon_valid_bit()

Rename clear_bacon_valid_bit(). Actually it should be
clear_beacon_valid_bit().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220331130522.6648-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: Fix No space before tabs
Alaa Mohamed [Thu, 31 Mar 2022 13:09:48 +0000 (15:09 +0200)]
staging: rtl8723bs: Fix No space before tabs

Fix "WARNING: please, no space before tabs"
reported by checkpatch

Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com>
Link: https://lore.kernel.org/r/20220331130948.74835-1-eng.alaamohamedsoliman.am@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: remove redundant braces in if statements
Sevinj Aghayeva [Thu, 31 Mar 2022 11:32:45 +0000 (07:32 -0400)]
staging: rtl8723bs: remove redundant braces in if statements

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220331113245.GA425141@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove duplicate assignment
Wang Qing [Thu, 31 Mar 2022 12:08:34 +0000 (05:08 -0700)]
staging: r8188eu: remove duplicate assignment

netdev_alloc_skb() has assigned ssi->netdev to skb->dev if successed,
no need to repeat assignment.

Signed-off-by: Wang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1648728514-37390-1-git-send-email-wangqing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: place constants on the right side of tests
Sevinj Aghayeva [Thu, 31 Mar 2022 12:26:18 +0000 (08:26 -0400)]
staging: rtl8723bs: place constants on the right side of tests

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220331122618.GA434796@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: add a check for rtw_cbuf_alloc()
Xiaoke Wang [Wed, 30 Mar 2022 11:30:05 +0000 (19:30 +0800)]
staging: r8188eu: add a check for rtw_cbuf_alloc()

kmalloc() is called by rtw_cbuf_alloc() and it returns pointer of
srtuct rtw_cbuf, NULL for allocation failure. So it is better to check
the return value of it.

Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Link: https://lore.kernel.org/r/tencent_D95ACC78B93B1CDD14C4E13E4A66FF892008@qq.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove the "dump tx packet" fragments
Martin Kaiser [Wed, 30 Mar 2022 20:12:10 +0000 (22:12 +0200)]
staging: r8188eu: remove the "dump tx packet" fragments

Remove the code fragments for printing outgoing packets.

There's only a hal variable HAL_DEF_DBG_DUMP_TXPKT and the bDumpTxPkt
component of struct hal_data_8188e.

The hal variable is set by a private ioctl, it's never read.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220330201210.175941-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove the "dump rx packet" fragments
Martin Kaiser [Wed, 30 Mar 2022 20:12:09 +0000 (22:12 +0200)]
staging: r8188eu: remove the "dump rx packet" fragments

Remove the code fragments for printing incoming packets. There's only a
hal variable HAL_DEF_DBG_DUMP_RXPKT and the bDumpRxPkt component of
struct hal_data_8188e.

The hal variable is set by a private ioctl, it's read in
validate_recv_frame but it's not used.

All of this can be removed, there's no code to dump the packets.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220330201210.175941-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: rtl8723bs: place constants on the right side of tests
Sevinj Aghayeva [Wed, 30 Mar 2022 12:07:09 +0000 (08:07 -0400)]
staging: rtl8723bs: place constants on the right side of tests

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220330120709.GA339788@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix misspelling in comment "writting" -> "writing"
Haowen Bai [Wed, 30 Mar 2022 10:31:15 +0000 (18:31 +0800)]
staging: r8188eu: Fix misspelling in comment "writting" -> "writing"

This patch fixes some spelling typo in error message reported by
checkpatch.pl

WARNING: 'writting' may be misspelled - perhaps 'writing'?

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1648636275-13558-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix misspelling in comment "Tranceiver" -> "Transceiver"
Haowen Bai [Wed, 30 Mar 2022 07:27:21 +0000 (15:27 +0800)]
staging: r8188eu: Fix misspelling in comment "Tranceiver" -> "Transceiver"

This patch fixes some spelling typo in error message reported by
checkpatch.pl

WARNING: 'Tranceiver' may be misspelled - perhaps 'Transceiver'?
WARNING: 'Tranceiver' may be misspelled - perhaps 'Transceiver'?
WARNING: 'Tranceiver' may be misspelled - perhaps 'Transceiver'?
WARNING: 'Tranceiver' may be misspelled - perhaps 'Transceiver'?

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1648625242-12678-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: Fix sparse endianness warnings.
Charlie Sands [Wed, 30 Mar 2022 03:14:05 +0000 (23:14 -0400)]
staging: r8188eu: Fix sparse endianness warnings.

This patch fixes sparse warnings about the endianness of different
integers in the driver.

Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Charlie Sands <sandsch@northvilleschools.net>
Link: https://lore.kernel.org/r/YkPK/QmLAp3BkygY@sckzor-linux.localdomain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_BCN_VALID from SetHwReg8188EU()
Michael Straube [Tue, 29 Mar 2022 20:21:41 +0000 (22:21 +0200)]
staging: r8188eu: remove HW_VAR_BCN_VALID from SetHwReg8188EU()

The HW_VAR_BCN_VALID case in SetHwReg8188EU() just calls rtw_write8().
Remove HW_VAR_BCN_VALID from SetHwReg8188EU() and call rtw_write8()
directly. Move the call to a new function to indicate what it actually
does. This is part of the ongoing effort to getrid of the unwanted hal
layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220329202141.7028-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_TX_RPT_MAX_MACID from SetHwReg8188EU()
Michael Straube [Tue, 29 Mar 2022 20:21:40 +0000 (22:21 +0200)]
staging: r8188eu: remove HW_VAR_TX_RPT_MAX_MACID from SetHwReg8188EU()

The HW_VAR_TX_RPT_MAX_MACID case in SetHwReg8188EU() just calls
rtw_write8(). Remove HW_VAR_TX_RPT_MAX_MACID from SetHwReg8188EU() and
call rtw_write8() directly. Move the call to a new function to indicate
what it actually does. This is part of the ongoing effort to get rid of
the unwanted hal layer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220329202141.7028-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: simplify if-else statement
Michael Straube [Tue, 29 Mar 2022 20:21:39 +0000 (22:21 +0200)]
staging: r8188eu: simplify if-else statement

Simplify a nested if-else statement to a single if-else statement in
rtw_set_threshold(). This improves readability and allows us to
remove the local variable threshold.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220329202141.7028-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2 years agostaging: r8188eu: remove HW_VAR_RXDMA_AGG_PG_TH from SetHwReg8188EU()
Michael Straube [Tue, 29 Mar 2022 20:21:38 +0000 (22:21 +0200)]
staging: r8188eu: remove HW_VAR_RXDMA_AGG_PG_TH from SetHwReg8188EU()

The HW_VAR_RXDMA_AGG_PG_TH case in SetHwReg8188EU() just sets a
variable conditionally and then calls rtw_write8(). Set the variable
in the caller and call rtw_write8() directly. Move the functionality
into a new static function to make the code cleaner. Remove the
HW_VAR_RXDMA_AGG_PG_TH case from SetHwReg8188EU(). This is part of the
ongoing effort to get rid of the unwanted hal layer.

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