Commit graph

1994 commits

Author SHA1 Message Date
Michael Straube
2d90027bdd staging: rtl8188eu: remove unnecessary asignment
Remove unnecessary asignment in SwLedBlink1(). The code path with the
asignment 'pLed->BlinkTimes = 0' is only executed when
'pLed->BlinkTimes' is already zero and the value is not changed between
the test 'if (pLed->BlinkTimes == 0)' and the asignment.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200405112230.31975-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:32 +02:00
Michael Straube
18bcd8a08b staging: rtl8188eu: refactor Efuse_GetCurrentSize()
Refactor while loop in Efuse_GetCurrentSize() to reduce indentation
level and clear line over 80 characters checkpatch warnings.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200329100450.10126-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:29 +02:00
Michael Straube
ab966667bd staging: rtl8188eu: remove unnecessary parentheses
Remove all remaining unnecessary parentheses reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200327185311.16129-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 08:55:28 +02:00
Michael Straube
57e0ff116c staging: rtl8188eu: cleanup long line in odm.c
Cleanup line over 80 characters by removing unnecessary test
'pDM_Odm->RSSI_Min <= 25'. The above test 'pDM_Odm->RSSI_Min > 25'
already guarantees that it is <= 25.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200326084348.15072-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-26 15:45:08 +01:00
Shreeya Patel
69686debe6 Staging: rtl8188eu: hal: Add space around operators
Add space around operators for improving the code
readability.
Reported by checkpatch.pl

git diff -w shows no difference.
diff of the .o files before and after the changes shows no difference.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Link: https://lore.kernel.org/r/20200325160142.3698-1-shreeya.patel23498@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 19:39:24 +01:00
Larry Finger
38ef48f7d4 staging: rtl8188eu: Add ASUS USB-N10 Nano B1 to device table
The ASUS USB-N10 Nano B1 has been reported as a new RTL8188EU device.
Add it to the device tables.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Reported-by: kovi <zraetn@gmail.com>
Cc: Stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200321180011.26153-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-23 11:32:43 +01:00
Greg Kroah-Hartman
6203da9803 Merge 5.6-rc7 into staging-next
We need the staging/iio fixes in here as well

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-23 08:01:20 +01:00
Michael Straube
609ccb3071 staging: rtl8188eu: remove some 5 GHz code
According to the TODO code valid only for 5 GHz should be removed.

- find and remove remaining code valid only for 5 GHz. Most of the obvious
  ones have been removed, but things like channel > 14 still exist.

Remove if statement that checks for channel > 14 from rtw_ieee80211.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200320191305.10425-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-21 10:58:19 +01:00
R Veera Kumar
441f3d8991 staging: rtl8188eu: core: Correct a typo in a comment
Correct a single typo in a comment.
Misspelling found using checkpatch.pl.

Signed-off-by: R Veera Kumar <vkor@vkten.in>
Link: https://lore.kernel.org/r/20200319093301.GA2453@tulip.local
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-19 15:09:11 +01:00
R Veera Kumar
8b9eafef59 staging: rtl8188eu: include: Correct a typo in a comment
Correct a single typo in a comment.
Misspelling found using checkpatch.pl.

Signed-off-by: R Veera Kumar <vkor@vkten.in>
Link: https://lore.kernel.org/r/20200319093715.GA2550@tulip.local
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-19 15:09:10 +01:00
Michael Straube
bb5786b928 staging: rtl8188eu: Add device id for MERCUSYS MW150US v2
This device was added to the stand-alone driver on github.
Add it to the staging driver as well.

Link: https://github.com/lwfinger/rtl8188eu/commit/2141f244c3e7
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200312093652.13918-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-17 14:17:32 +01:00
Shreeya Patel
6e436169a7 Staging: rtl8188eu: rtw_mlme: Add space around operators
Add space around operators for improving the code
readability.
Reported by checkpatch.pl

git diff -w shows no difference.
diff of the .o files before and after the changes shows no difference.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Link: https://lore.kernel.org/r/20200311131742.31068-1-shreeya.patel23498@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-12 09:27:46 +01:00
Takashi Iwai
72e7375caf staging: rtl8188eu: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200311092451.23933-2-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-12 09:23:59 +01:00
Andre Pinto
3394cf0779 staging: rtl8188eu: fix typo s/informations/information
Fix checkpatch check: 'informations' may be misspelled - perhaps
'information'? in rtw_mlme_ext.c:1151.

Signed-off-by: Andre Pinto <andrealmeidap1996@gmail.com>
Link: https://lore.kernel.org/r/20200311012638.18889-1-andrealmeidap1996@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-11 08:08:49 +01:00
Shreeya Patel
d2ac333d2e Staging: rtl8188eu: Add space around operator
Add space around & operator for improving the code
readability.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Acked-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/20200308192152.26403-1-shreeya.patel23498@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-10 10:44:50 +01:00
Greg Kroah-Hartman
c85f15519d Merge 5.6-rc3 into staging-next
We need the staging fixes in here, and it resolves a merge issue in the
MAINTAINERS file.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-24 08:37:48 +01:00
Colin Ian King
49ad571f70 staging: rtl8188eu: remove redundant assignment to cond
Variable cond is initialized to a value that is never read and it
is re-assigned later. The initialization is redundant and can be
removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200223151858.416499-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-23 19:20:49 +01:00
Michael Straube
36be4102b7 staging: rtl8188eu: rename variable pnetdev -> netdev
Rename the local variable pnetdev in rtw_alloc_etherdev_with_old_priv
to avoid hungarian notation and clear the last checkpatch warning in
the file osdep_service.c.

rtl8188eu/os_dep/osdep_service.c:32: WARNING: line over 80 characters

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200210200830.22868-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-10 12:37:21 -08:00
Larry Finger
e40c6d0f87 staging: rtl8188eu: Remove some unneeded goto statements
In routines rtw_hostapd_ioctl() and wpa_supplicant_ioctl(), several
error conditions involve setting a variable indicating the error,
followed by a goto. The code following the target of that goto merely
returns the value. It is simpler, therefore to return the error value
immediately, and eliminate the got  target.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Pietro Oliva <pietroliva@gmail.com>
Link: https://lore.kernel.org/r/20200210180235.21691-6-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-10 10:32:38 -08:00
Larry Finger
4ddf8ab8d1 staging: rtl8188eu: Fix potential overuse of kernel memory
In routine wpa_supplicant_ioctl(), the user-controlled p->length is
checked to be at least the size of struct ieee_param size, but the code
does not detect the case where p->length is greater than the size
of the struct, thus a malicious user could be wasting kernel memory.
Fixes commit a2c60d42d9 ("Add files for new driver - part 16").

Reported by: Pietro Oliva <pietroliva@gmail.com>
Cc: Pietro Oliva <pietroliva@gmail.com>
Cc: Stable <stable@vger.kernel.org>
Fixes commit a2c60d42d9 ("Add files for new driver - part 16").
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20200210180235.21691-4-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-10 10:32:38 -08:00
Larry Finger
499c405b2b staging: rtl8188eu: Fix potential security hole
In routine rtw_hostapd_ioctl(), the user-controlled p->length is assumed
to be at least the size of struct ieee_param size, but this assumption is
never checked. This could result in out-of-bounds read/write on kernel
heap in case a p->length less than the size of struct ieee_param is
specified by the user. If p->length is allowed to be greater than the size
of the struct, then a malicious user could be wasting kernel memory.
Fixes commit a2c60d42d9 ("Add files for new driver - part 16").

Reported by: Pietro Oliva <pietroliva@gmail.com>
Cc: Pietro Oliva <pietroliva@gmail.com>
Cc: Stable <stable@vger.kernel.org>
Fixes: a2c60d42d9 ("staging: r8188eu: Add files for new driver - part 16")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20200210180235.21691-2-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-10 10:32:31 -08:00
Michael Straube
226f912a0f staging: rtl8188eu: remove unnecessary RETURN label
Remove unnecessary RETURN label and use return directly instead. Since
the return type of rtw_free_netdev() is void, remove the return at the
end of the function.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200206085924.21531-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-09 16:23:02 -08:00
Michael Straube
3cdab8823a staging: rtl8188eu: remove unused enum and defines
IQK_BB_REG_NUM_MAX, RTL8711_RF_MAX_SENS, RTL8711_RF_DEF_SENS,
NUM_REGULATORYS and enum _RTL8712_RF_MIMO_CONFIG_ are not used
in the driver code, remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200118173343.32405-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22 09:44:44 +01:00
Michael Straube
2dda060285 staging: rtl8188eu: remove redundant defines
Remove redundant defines from hal8188e_phy_cfg.h and rtl8188e_dm.h.
All of them are defined in odm.h with the same values.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200118173343.32405-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22 09:44:44 +01:00
Michael Straube
0b4d1d0da7 staging: rtl8188eu: remove else after break or return
Remove unnecessary else after break or return to improve readability
and clear checkpatch warnings.

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

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200118173343.32405-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-22 09:44:44 +01:00
Michael Straube
cdb9c044f9 staging: rtl8188eu: cleanup whitespace in rtl8188e_dm.c
Replace tabs with spaces and/or remove spaces to use typical kernel
horizontal whitespace.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200114134422.13598-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 14:59:47 +01:00
Michael Straube
8c26f783d7 staging: rtl8188eu: remove unnecessary parentheses in rtl8188e_dm.c
Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200114134422.13598-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 14:59:47 +01:00
Michael Straube
c085fed4cb staging: rtl8188eu: cleanup long lines in rtl8188e_dm.c
Cleanup lines over 80 characters in rtl8188e_dm.c by adding
appropriate line breaks.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200114134422.13598-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 14:59:47 +01:00
Michael Straube
cdc7fa3232 staging: rtl8188eu: convert rtw_hal_antdiv_before_linked() to bool
Function rtw_hal_antdiv_before_linked() returns boolean values, so
change the return type from u8 to bool.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200114134422.13598-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 14:59:47 +01:00
Michael Straube
c0a6bf0f1a staging: rtl8188eu: refactor rtw_hal_antdiv_before_linked()
Refactor rtw_hal_antdiv_before_linked() to clear checkpatch warnings.

WARNING: line over 80 characters
WARNING: else is not generally useful after a break or return

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200114134422.13598-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 14:59:47 +01:00
Michael Straube
f3c69559b5 staging: rtl8188eu: remove unused parameters from rtw_check_network_type
Parameters 'ratelen' and 'channel' of function rtw_check_network_type are
unused, remove them. Reduces object file size by 62 bytes.

  text    data     bss     dec     hex filename
398525   12896    4688  416109   6596d drivers/staging/rtl8188eu/r8188eu.o
398463   12896    4688  416047   6592f drivers/staging/rtl8188eu/r8188eu.o

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200113212939.9738-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 14:56:36 +01:00
Greg Kroah-Hartman
d40310f657 Merge 5.5-rc6 into staging-next
We need the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-13 07:52:17 +01:00
Michael Straube
b4cf24cc93 staging: rtl8188eu: refactor rtl88eu_dm_update_rx_idle_ant()
Refactor rtl88eu_dm_update_rx_idle_ant() to reduce indentation level
and clear line over 80 characters checkpatch warnings.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200105194936.5477-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-10 10:58:31 +01:00
Michael Straube
0c5e99c920 staging: rtl8188eu: remove else after return
Remove else after return in rtl88eu_dm_antenna_diversity() to improve
readability and clear a checkpatch warning.

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

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200105194936.5477-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-10 10:58:31 +01:00
Arnd Bergmann
c497ae2077 staging: rtl8188: avoid excessive stack usage
The rtl8188 copy of the os_dep support code causes a
warning about a very significant stack usage in the translate_scan()
function:

drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'translate_scan':
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:306:1: error: the frame size of 1560 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]

Use the same trick as in the rtl8723bs copy of the same function, and
allocate it dynamically.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20200104214832.558198-1-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-10 10:58:31 +01:00
Michael Straube
58dcc5bf40 staging: rtl8188eu: Add device code for TP-Link TL-WN727N v5.21
This device was added to the stand-alone driver on github.
Add it to the staging driver as well.

Link: https://github.com/lwfinger/rtl8188eu/commit/b9b537aa25a8
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191228143725.24455-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-03 11:47:00 +01:00
Michael Straube
d1e10852aa staging: rtl8188eu: use break to exit while loop
The variable bContinual in Efuse_PgPacketRead() is only used to break
out of a while loop. Remove the variable and use break instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191220174413.13913-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-03 11:04:58 +01:00
Michael Straube
92ee203469 staging: rtl8188eu: add spaces around operators in rtw_mlme_ext.c
Add missing spaces around operators to improve readability and clear
checkpatch issues.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191214100955.16670-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 14:08:42 +01:00
Michael Straube
dc497b4b0c staging: rtl8188eu: cleanup comparsions to NULL in rtw_mlme_ext.c
Cleanup comparsions to NULL reported by checkpatch.
if (x == NULL) -> if (!x)
if (x != NULL) -> if (x)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191214100955.16670-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 14:08:41 +01:00
Greg Kroah-Hartman
b3bb164aa5 Merge 5.5-rc2 into staging-next
We want the staging driver fixes in here, and this resolves merge issues
with the isdn code that was pointed out in linux-next

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-16 09:06:50 +01:00
Johan Hovold
74ca34118a staging: rtl8188eu: fix interface sanity check
Make sure to use the current alternate setting when verifying the
interface descriptors to avoid binding to an invalid interface.

Failing to do so could cause the driver to misbehave or trigger a WARN()
in usb_submit_urb() that kernels with panic_on_warn set would choke on.

Fixes: c2478d3907 ("staging: r8188eu: Add files for new driver - part 20")
Cc: stable <stable@vger.kernel.org>     # 3.12
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191210114751.5119-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10 13:22:21 +01:00
Michael Straube
a426b982be staging: rtl8188eu: remove return variable from rtw_pwr_unassociated_idle
Function rtw_pwr_unassociated_idle returns boolean values.
Remove the return variable ret and the exit label to simplify the
function a little bit. Return true or false directly instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20191123151635.155138-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10 10:38:38 +01:00
Michael Straube
4905084a07 staging: rtl8188eu: cleanup declarations in rtw_pwrctrl.c
Replace tabs with spaces in declarations to cleanup whitespace.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20191123151635.155138-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10 10:38:37 +01:00
Michael Straube
1544f55add staging: rtl8188eu: remove unnecessary parentheses in rtw_pwrctrl.c
Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20191123151635.155138-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-10 10:38:37 +01:00
Kees Cook
6cfed59848 staging: rtl*: Remove tasklet callback casts
In order to make the entire kernel usable under Clang's Control Flow
Integrity protections, function prototype casts need to be avoided
because this will trip CFI checks at runtime (i.e. a mismatch between
the caller's expected function prototype and the destination function's
prototype). Many of these cases can be found with -Wcast-function-type,
which found that the rtl wifi drivers had a bunch of needless function
casts. Remove function casts for tasklet callbacks in the various drivers.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/201911150926.2894A4F973@keescook
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-16 14:41:02 +01:00
Michael Straube
b711acf0d1 staging: rtl8188eu: replace tabs with spaces - style
Replace tabs with spaces where appropriate to cleanup whitespace.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191027130604.68379-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-28 16:40:26 +01:00
Michael Straube
c534472f8b staging: rtl8188eu: remove return variable from rtw_init_bcmc_stainfo
Remove variable res, that is used to store the return value, from
rtw_init_bcmc_stainfo. Instead return _FAIL or _SUCCESS directly
and remove the now unneeded exit label.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191027130604.68379-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-28 16:40:25 +01:00
Michael Straube
6e845ddd8a staging: rtl8188eu: reduce indentation level in _rtw_free_sta_priv
Reduce indentation level in _rtw_free_sta_priv by returning early if
pstapriv is NULL. Also clears a line over 80 characters checkpatch
warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191027130604.68379-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-28 16:40:25 +01:00
Michael Straube
0c9f72227c staging: rtl8188eu: remove exit label from rtw_alloc_stainfo
Remove exit label from rtw_alloc_stainfo and simply return NULL
instead of goto exit.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191027130604.68379-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-28 16:40:24 +01:00
Michael Straube
48d357f0be staging: rtl8188eu: reduce indentation level in rtw_alloc_stainfo
Remove else-arm from if-else statement. Move the else code out of the
if-else and skip it by adding goto exit to the if block. The exit label
was directly after the else-arm, so there is no change in behaviour.
Reduces indentation level and clears a line over 80 characters
checkpatch warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191026121135.181897-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26 20:45:49 +02:00
Michael Straube
1cafe435a9 staging: rtl8188eu: cleanup long lines in rtw_sta_mgt.c
Cleanup lines over 80 characters in rtw_sta_mgt.c by adding line
breaks where appropriate.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191026121135.181897-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26 20:45:48 +02:00
Michael Straube
dd85035172 staging: rtl8188eu: remove ternary operator
Instead of using ternary operator to set variable res, use the value
of variable match (or the negation) directly to simplify the code and
improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191026121135.181897-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26 20:45:48 +02:00
Michael Straube
4e6f391fde staging: rtl8188eu: convert rtw_access_ctrl to return bool
Function rtw_access_ctrl returns boolean values, so change the return
type to bool. Also convert the local variables that are used for the
return value from u8 to bool.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191026121135.181897-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26 20:45:47 +02:00
Michael Straube
62ab5b4666 staging: rtl8188eu: rename array bcast_addr
Rename array bcast_addr to be more consistent in variable naming.
In other places in this file buffers for broadcast addresses are
named bc_addr as well.

bcast_addr -> bc_addr

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191026121135.181897-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26 20:45:47 +02:00
Michael Straube
da3611f2fa staging: rtl8188eu: convert unsigned char array to u8
Convert array bcast_addr from unsigned char to u8.
Clears a line over 80 characters checkpatch warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191026121135.181897-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26 20:45:46 +02:00
Michael Straube
54c6feca86 staging: rtl8188eu: cleanup comments in rtw_sta_mgt.c
Cleanup comments in rtw_sta_mgt.c to use kernel block comment style
and not exceed 80 characters line length.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191026121135.181897-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-26 20:45:46 +02:00
Michael Straube
79380bbfc3 staging: rtl8188eu: remove code valid only for 5 GHz
Remove code valid only for 5 GHz, according to the TODO.

- find and remove remaining code valid only for 5 GHz. Most of the obvious
  ones have been removed, but things like channel > 14 still exist.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191024155918.13399-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-24 23:17:15 -04:00
Alexandru Ardelean
bb84f28f0d staging: rtl8188eu: make efuse_power_switch() function static
The `rtl8188eu` driver is built as a kmod in order to avoid symbol
conflicts (at link-time) with other Realtek drivers.

Internally, we use this driver as builtin [vs kmod], and we've identified
the `efuse_power_switch()` symbol to be conflicting at link-time with the
one from the `rtlwifi` driver.

An alternative solution would have been to rename the function, but it
doesn't look like it's being used outside of this driver, so just make it
static.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20191016065834.12186-1-alexandru.ardelean@analog.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-24 22:40:39 -04:00
Michael Straube
5ffa18ec0b staging: rtl8188eu: remove blank lines
Remove blank lines to reduce whitespace and improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191015154535.27979-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-15 18:45:11 +02:00
Michael Straube
ec26697cd9 staging: rtl8188eu: convert variables from unsigned char to u8
Convert the local variables max_ampdu_len and min_mpdu_spacing from
unsigned char to u8 and remove unnecessary castings to u8 pointer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191015154535.27979-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-15 18:45:10 +02:00
Michael Straube
b0906aa3f7 staging: rtl8188eu: rename variables to avoid mixed case
Rename local variables to avoid mixed case.

max_AMPDU_len -> max_ampdu_len
min_MPDU_spacing -> min_mpdu_spacing

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191015154535.27979-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-15 18:45:10 +02:00
Michael Straube
51a50b26c6 staging: rtl8188eu: remove unnecessary conversion to bool
Comparsions evaluate to bool, explicit conversion with ternary
operator is overly verbose and unnecessary, so remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191013131249.34422-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 15:36:56 +02:00
Michael Straube
29c03456f1 staging: rtl8188eu: remove braces from single statement if block
Remove braces from single statement if block to comply with kernel
coding style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191013131249.34422-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 15:36:56 +02:00
Greg Kroah-Hartman
27d6e47f8e Merge 5.4-rc3 into staging-next
We want the staging driver fixes in here as well to build on and test
with.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-14 07:07:36 +02:00
Michael Straube
ea60b4eb44 staging: rtl8188eu: remove unnecessary asignment and initialization
Variable badworden is asigned in two subsequent lines. So the first
asignment is useless and not needed. Also the initialization to zero
is not needed. Remove the first asignment and the initialization.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191005141852.88712-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-07 12:25:46 +02:00
Michael Straube
7e6af677d8 staging: rtl8188eu: cleanup comments in update_hw_ht_param
Cleanup comments in update_hw_ht_param to follow kernel coding style
and avoid line length over 80 characters.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191003122514.1760-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-04 10:17:21 +02:00
Michael Straube
5f6bca795f staging: rtl8188eu: cleanup whitespace in update_hw_ht_param
Replace tabs with spaces in declarations and reomve two blank lines in
update_hw_ht_param to cleanup whitespace and improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191003122514.1760-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-04 10:17:21 +02:00
Michael Straube
7e3303fc8c staging: rtl8188eu: rename variables to avoid mixed case
Rename the local varibles max_AMPDU_len and min_MPDU_spacing to avoid
mixed case.

max_AMPDU_len -> max_ampdu_len
min_MPDU_spacing -> min_mpdu_spacing

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191003122514.1760-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-04 10:17:20 +02:00
Michael Straube
b74e124e10 staging: rtl8188eu: convert variables from unsigned char to u8
Convert the local variables max_AMPDU_len and min_MPDU_spacing from
unsigned char to u8 and remove unnecessary castings to u8 pointer.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191003122514.1760-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-04 10:17:20 +02:00
Denis Efremov
22d67a01d8 staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E()
It's incorrect to compare HighestRate with 0x0b twice in the following
manner "if (HighestRate > 0x0b) ... else if (HighestRate > 0x0b) ...". The
"else if" branch is constantly false. The second comparision should be
with 0x03 according to the max_rate_idx in ODM_RAInfo_Init().

Cc: Michael Straube <straube.linux@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Denis Efremov <efremov@linux.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190926073138.12109-1-efremov@linux.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-01 08:22:44 +02:00
Connor Kuehl
955c1532a3 staging: rtl8188eu: fix null dereference when kzalloc fails
If kzalloc() returns NULL, the error path doesn't stop the flow of
control from entering rtw_hal_read_chip_version() which dereferences the
null pointer. Fix this by adding a 'goto' to the error path to more
gracefully handle the issue and avoid proceeding with initialization
steps that we're no longer prepared to handle.

Also update the debug message to be more consistent with the other debug
messages in this function.

Addresses-Coverity: ("Dereference after null check")

Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Link: https://lore.kernel.org/r/20190927214415.899-1-connor.kuehl@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-01 08:22:44 +02:00
Connor Kuehl
228241944a staging: rtl8188eu: fix possible null dereference
Inside a nested 'else' block at the beginning of this function is a
call that assigns 'psta' to the return value of 'rtw_get_stainfo()'.
If 'rtw_get_stainfo()' returns NULL and the flow of control reaches
the 'else if' where 'psta' is dereferenced, then we will dereference
a NULL pointer.

Fix this by checking if 'psta' is not NULL before reading its
'psta->qos_option' data member.

Addresses-Coverity: ("Dereference null return value")

Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190926150317.5894-1-connor.kuehl@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30 21:58:02 +02:00
Connor Kuehl
43821e36e5 staging: rtl8188eu: remove dead code/vestigial do..while loop
The local variable 'bcmd_down' is always set to true almost immediately
before the do-while's condition is checked. As a result, !bcmd_down
evaluates to false which short circuits the logical AND operator meaning
that the second operand is never reached and is therefore dead code.

Furthermore, the do..while loop may be removed since it will always only
execute once because 'bcmd_down' is always set to true, so the
!bcmd_down evaluates to false and the loop exits immediately after the
first pass.

Fix this by removing the loop and its condition variables 'bcmd_down'
and 'retry_cnts'

While we're in there, also fix some checkpatch.pl suggestions regarding
spaces around arithmetic operators like '+'

Addresses-Coverity: ("Logically dead code")

Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Link: https://lore.kernel.org/r/20190924142819.5243-1-connor.kuehl@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30 21:58:01 +02:00
Connor Kuehl
fe11afc326 staging: rtl8188eu: remove unnecessary self-assignment
This is a self-assignment which is redundant. Fix this by removing the
self-assignment.

Addresses-Coverity: ("Self assignment")

Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Link: https://lore.kernel.org/r/20190920094807.9217-1-connor.kuehl@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30 21:57:57 +02:00
Michael Straube
97a0ea7795 staging: rtl8188eu: cleanup long line in rtw_mlme_ext.c
Remove comparsion to NULL and unnecessary parentheses to avoid line
length over 80 characters and follow kernel coding style.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20190912114257.17529-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-30 21:57:57 +02:00
Colin Ian King
0ba4d388d7 staging: rtl8188eu: make two arrays static const, makes object smaller
Don't populate two arrays on the stack but instead make them
static const. Makes the object code smaller by 49 bytes.

Before:
   text	   data	    bss	    dec	    hex	filename
  26821	   5616	      0	  32437	   7eb5	rtl8188eu/core/rtw_ieee80211.o

After:
   text	   data	    bss	    dec	    hex	filename
  26612	   5776	      0	  32388	   7e84	rtl8188eu/core/rtw_ieee80211.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190906173949.21860-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-12 10:35:52 +01:00
Ivan Safonov
39a4916b19 staging: r8188eu: use skb_put_data instead of skb_put/memcpy pair
skb_put_data is shorter and clear.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20190901195301.GA16043@alpha
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-09-03 09:39:53 +02:00
Merwin Trever Ferrao
4f4139e021 Staging: rtl8188eu: core: rtw_security: tidy up crc32_init()
This code generates checkpatch warning:

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

Moving the declaration to the top of the function we can pull the
code back one tab and it makes it more readable.

Signed-off-by: Merwin Trever Ferrao <merwintf@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20190806122849.GA25628@IoT-COE
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-08 18:59:18 +02:00
Saurav Girepunje
fe4e6e0368 staging: rtl8188eu: core: add spaces around '-', '+', '>>','<<' and '*' in rtw_efuse.c
Add spaces around '-', '+', '>>','<<' and '*' to improve readability
and follow kernel coding style.

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/20190803131839.GA14077@saurav
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-05 17:09:48 +02:00
Saurav Girepunje
8ca9d8ad30 staging: rtl8188eu: core: rtw_recv.c: Remove Unnecessary parentheses
Remove Unnecessary parentheses around precvframe->list,
pmlmeext->mlmext_info and precvpriv->free_recv_queue

Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/20190803064408.GA30111@saurav
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-03 09:08:00 +02:00
Colin Ian King
9ba2986ff5 staging: rtl8188eu: remove redundant assignment to variable rtstatus
Variable rtstatus is being initialized with a value that is never read
and rtstatus is being re-assigned a little later on. The assignment is
redundant and hence can be removed.  Also, make rtstatus a bool to
match the function return type.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190731094736.28637-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-31 13:37:13 +02:00
Michael Straube
2c0e81ec21 staging: rtl8188eu: cleanup comparsion to NULL in usb_halinit.c
Use if(!x) instead of if(x == NULL).
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190726180448.2290-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:58:23 +02:00
Michael Straube
1f5bfba56f staging: rtl8188eu: add spaces around '-' and '*' in usb_halinit.c
Add spaces around '-' and '*' to improve readability and follow kernel
coding style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190726180448.2290-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:58:23 +02:00
Michael Straube
8f4686cb7d staging: rtl8188eu: add spaces around '<<' and '>>' in usb_halinit.c
Add spaces around '<<' and '>>' to improve readability and follow
kernel coding style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190726180448.2290-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:58:22 +02:00
Michael Straube
fe6c0d20bb staging: rtl8188eu: add spaces around '|' in usb_halinit.c
Add spaces around '|' to improve readability and follow kernel
coding style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190726180448.2290-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:58:22 +02:00
Michael Straube
6d7ff73611 staging: rtl8188eu: add spaces around '&' in usb_halinit.c
Add spaces around '&' to improve readability and follow kernel
coding style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190726180448.2290-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:58:22 +02:00
Michael Straube
3455db0e05 staging: rtl8188eu: add spaces around '+' in usb_halinit.c
Add spaces around '+' to improve readability and follow kernel
coding style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20190726180448.2290-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:58:22 +02:00
Colin Ian King
36475456f3 staging: rtl8188eu: remove redundant assignment to rtstatus
Variable rtstatus is initialized to a value that is never read and it
is re-assigned later. The initialization is redundant and can be
removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190726124803.11349-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:54:48 +02:00
Michael Straube
c47f77eed0 staging: rtl8188eu: replace hal_EfusePgCheckAvailableAddr()
Function hal_EfusePgCheckAvailableAddr() contains just a single if
test. Remove the function and replace the call to it with the if test.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20190725170922.16465-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-30 09:52:05 +02:00
Nishka Dasgupta
384329ddc4 staging: rtl8188eu: Replace function rtl88eu_phy_rf_config()
Remove function rtl88eu_phy_rf_config as all it does is call
rtl88e_phy_rf6052_config.
Rename rtl88e_phy_rf6052_config to rtl88eu_phy_rf_config and change its
type from static to non-static to maintain compatibility with call
sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-8-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:15 +02:00
Nishka Dasgupta
792d89ee4b staging: rtl8188eu: Replace function rtl88e_phy_rf6052_config()
Remove function rtl88e_phy_rf6052_config as all it does is call
rf6052_conf_para.
Rename rf6052_conf_para to rtl88e_phy_rf6052_config to maintain
compatibility with call site.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-7-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:15 +02:00
Nishka Dasgupta
5cace672b9 staging: rtl8188eu: Replace function rtw_alloc_network()
Change external call site of _rtw_alloc_network to rtw_alloc_network.
Remove function rtw_alloc_network as all it does is call
_rtw_alloc_network.
Rename _rtw_alloc_network to rtw_alloc_network to maintain compatibility
with call sites. Keep its type as non-static (even though the old
rtw_alloc_network was static) as this functionality is used in other
files as well.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-6-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:15 +02:00
Nishka Dasgupta
04c8c19856 staging: rtl8188eu: Remove function rtw_modular64()
Remove function rtw_modular64 as all it does is call do_div.
Replace call to rtw_modular64 with call to do_div.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-5-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Nishka Dasgupta
c6255d2d24 staging: rtl8188eu: Remove function rtw_os_indicate_scan_done()
In function rtw_indicate_scan_done, replace call to
rtw_os_indicate_scan_done with call to indicate_wx_scan_complete_event
as all that rtw_os_indicate_scan_done does is call
indicate_wx_scan_complete_event.
Remove now-unused function rtw_os_indicate_scan_done.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-4-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Nishka Dasgupta
01625b0bbb staging: rtl8188eu: Replace function beacon_timing_control()
Remove function beacon_timing_control as all it does is call
rtw_hal_bcn_related_reg_setting.
Rename rtw_hal_bcn_related_reg_setting to beacon_timing_control for
compatibility with call sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-3-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Nishka Dasgupta
d6a496f937 staging: rtl8188eu: core: Remove function enable_rate_adaptive()
Remove function enable_rate_adaptive as it does nothing except call
Update_RA_Entry.
Modify call site of enable_rate_adaptive to call Update_RA_Entry
instead.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-2-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Nishka Dasgupta
6290da3e43 staging: rtl8188eu: core: Replace function Set_MSR()
Change reference to Set_NETYPE0_MSR to Set_MSR.
Replace the contents of Set_MSR with the contents of Set_NETYPE0_MSR as
Set_MSR does nothing but call Set_NETYPE0_MSR.
Delete Set_NETYPE0_MSR.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Michael Straube
6c90bade52 staging: rtl8188eu: remove unused definitions from hal8188e_phy_reg.h
Remove unused definitions from the file hal8188e_phy_reg.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20190707165649.1558-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:13 +02:00
Hariprasad Kelam
690a993f10 staging/rtl8188eu/os_dep: Remove unneeded variable ret
Below list of functions returns 0 in success and -EINVAL in failure. So
directly return 0 on Success.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:07:03 +02:00
Nishka Dasgupta
01bc283e81 staging: rtl8188eu: Remove declarations of unused functions
Remove the declarations of the following unused functions from
rtw_eeprom.h:
- eeprom_write16
- eeprom_read16
- eeprom_read_sz
- read_eeprom_content
- read_eeprom_content_by_attrib.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:07:03 +02:00