Larry Finger [Thu, 5 Aug 2021 18:37:16 +0000 (13:37 -0500)]
staging: r8188eu: Remove more empty routines
After removing some empty routines in os_dep/osdep_service.c, new routines
become empty. These include rtw_mfree_stainfo(),
_rtw_free_sta_xmit_priv_lock(), and rtw_mfree_recv_priv_lock.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210805183717.23007-5-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 5 Aug 2021 18:37:15 +0000 (13:37 -0500)]
staging: r8188eu: Remove all calls to _rtw_spinlock_free()
This routine is empty, thus all calls to it can be removed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210805183717.23007-4-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 5 Aug 2021 18:37:14 +0000 (13:37 -0500)]
staging: r8188eu: Remove wrapper around vfree
This call is so simple that there is no need, or use, for a wrapper.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210805183717.23007-3-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 5 Aug 2021 18:37:13 +0000 (13:37 -0500)]
staging: r8188eu: Remove wrappers for kalloc() and kzalloc()
These wrappers involve an in_interrupt() call, which is not frowned on
in the kernel. These changes decrease the size of the driver by a trivial
amount.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210805183717.23007-2-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Thu, 5 Aug 2021 13:11:08 +0000 (15:11 +0200)]
staging: r8188eu: Fix incorrect types in arguments
GCC + Sparse emit warnings of passing incorrect type in arguments of
some functions because of different base types. Fix them by changing
the types of the parameters of the above-mentioned functions.
In the meantime, remove the unnecessary casts of those arguments
which are then passed to memcpy() within those same functions.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210805131108.19775-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Thu, 5 Aug 2021 14:09:41 +0000 (16:09 +0200)]
staging: r8188eu: fix build error
Remove unnecessary label to fix build error introduced with
commit
b398ff88aa36 ("staging: r8188eu: remove return from void functions")
drivers/staging/r8188eu/hal/rtl8188e_dm.c:182:1: error: label at end of compound statement
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210805140941.9130-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Thu, 5 Aug 2021 12:06:09 +0000 (14:06 +0200)]
staging: r8188eu: Remove unneeded comments in rtw_mp_ioctl.h
After commit
85143bdc731b ("staging: r8188eu: include: Remove unused
const definitions"), some comments are not anymore needed. Remove them
too. In the while, remove also a line with a void comment.
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210805120609.28588-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Mon, 2 Aug 2021 00:55:17 +0000 (02:55 +0200)]
staging: r8188eu: core: Remove rtw_mfree_all_stainfo()
Remove rtw_mfree_all_stainfo() and the only line of code that calls
it. This function simply takes a spinlock and iterates over a list
with no purpose. That iteration has no side effects.
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210802005517.12815-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Wed, 4 Aug 2021 14:32:18 +0000 (16:32 +0200)]
staging: r8188eu: Fix cast between incompatible function type
Fix sparse warnings of casts between incompatible function
types from ‘void (*)(void *)’ to ‘void (*)(long unsigned int)’
[-Wcast-function-type].
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210804143218.13665-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Len Baker [Sun, 1 Aug 2021 08:51:55 +0000 (10:51 +0200)]
staging/fbtft: Fix braces coding style
Add braces to the "for" loop. This way, the kernel coding style is
followed.
Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210801085155.3170-4-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Len Baker [Sun, 1 Aug 2021 08:51:54 +0000 (10:51 +0200)]
staging/fbtft: Remove unnecessary variable initialization
Remove the initialization of the variable "i" since it is written a few
lines later.
Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210801085155.3170-3-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Len Baker [Sun, 1 Aug 2021 08:51:53 +0000 (10:51 +0200)]
staging/fbtft: Remove all strcpy() uses
strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy() but in
this case it is simpler to use the "%*ph" format specifier.
Moreover, with the "0x%02X " in the sprintf followed by the strcat, the
msg buffer (now removed) can print 128/5 values (25 hex values). So, the
"%*ph" replacement won't cut output earlier than requested since this
format specifier can print up to 64 bytes.
Signed-off-by: Len Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210801085155.3170-2-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Wed, 4 Aug 2021 15:01:10 +0000 (15:01 +0000)]
staging: rtl8723bs: remove unused BT structures
remove static BT debugging structures no longer in use.
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/20210804144812.715695-1-hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Scott J. Crouch [Wed, 4 Aug 2021 00:13:34 +0000 (10:13 +1000)]
staging: rtl8723bs: Remove initialisation of globals to 0
This fixes the following checkpatch.pl errors:
ERROR: do not initialise globals to {0,NULL}
Signed-off-by: Scott J. Crouch <scottjcrouch@gmail.com>
Link: https://lore.kernel.org/r/20210804001335.16742-1-scottjcrouch@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 3 Aug 2021 23:05:35 +0000 (00:05 +0100)]
staging: r8188eu: remove RT_TRACE calls from hal/usb_ops_linux.c
Remove RT_TRACE macro calls from hal/usb_ops_linux.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210803230535.74254-9-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 3 Aug 2021 23:05:34 +0000 (00:05 +0100)]
staging: r8188eu: remove RT_TRACE calls from hal/usb_halinit.c
Remove RT_TRACE macro calls from hal/usb_halinit.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210803230535.74254-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 3 Aug 2021 23:05:33 +0000 (00:05 +0100)]
staging: r8188eu: remove RT_TRACE calls from hal/rtl8188e_mp.c
Remove RT_TRACE macro calls from hal/rtl8188e_mp.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210803230535.74254-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 3 Aug 2021 23:05:32 +0000 (00:05 +0100)]
staging: r8188eu: remove RT_TRACE calls from hal/rtl8188e_hal_init.c
Remove RT_TRACE macro calls from hal/rtl8188e_hal_init.c, so that ultimately
the macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210803230535.74254-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 3 Aug 2021 23:05:31 +0000 (00:05 +0100)]
staging: r8188eu: remove RT_TRACE calls from hal/hal_intf.c
Remove RT_TRACE macro calls from hal/hal_intf.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210803230535.74254-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 3 Aug 2021 23:05:30 +0000 (00:05 +0100)]
staging: r8188eu: remove RT_TRACE calls from hal/HalPwrSeqCmd.c
Remove RT_TRACE macro calls from hal/HalPwrSeqCmd.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210803230535.74254-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 3 Aug 2021 23:05:29 +0000 (00:05 +0100)]
staging: r8188eu: remove RT_TRACE calls from hal/rtl8188eu_recv.c
Remove RT_TRACE macro calls from hal/rtl8188eu_recv.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210803230535.74254-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 3 Aug 2021 23:05:28 +0000 (00:05 +0100)]
staging: r8188eu: remove RT_TRACE calls from hal/rtl8188eu_xmit.c
Remove RT_TRACE macro calls from hal/rtl8188eu_xmit.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210803230535.74254-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Tue, 3 Aug 2021 13:52:23 +0000 (08:52 -0500)]
staging: r8188eu: Remove some bit manipulation macros
This driver defines a set of macros that get or set a bitfield in the
RX and TX descriptors. Most of these have been replaced by the appropriate
use of the system macros BIT() or GENMASK().
While reworking these routines, I also fixed camel case variables and
missing spaces. Some comments were also converted to the
drivers/net/wireless preferred format.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210803135223.12543-11-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Tue, 3 Aug 2021 13:52:22 +0000 (08:52 -0500)]
staging: r8188eu: Remove some unused and ugly macros
This driver contains a number of macros that are intended to do endian
conversion. The first step in getting rid of them is to delete the
ones that are not used.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210803135223.12543-10-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Tue, 3 Aug 2021 13:52:21 +0000 (08:52 -0500)]
staging: r8188eu: Remove wrapper around do_div
Wrapper routine rtw_modular64() contains only a call to do_div() and
is used once in the code. Remove the wrapper.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210803135223.12543-9-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Tue, 3 Aug 2021 13:52:20 +0000 (08:52 -0500)]
staging: r8188eu: Remove rtw_division64()
This wrapper is never used.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210803135223.12543-8-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lukas Bulwahn [Tue, 3 Aug 2021 07:18:11 +0000 (09:18 +0200)]
MAINTAINERS: update STAGING - REALTEK RTL8188EU DRIVERS
Commit
55dfa29b43d2 ("staging: rtl8188eu: remove rtl8188eu driver from
staging dir") removes ./drivers/staging/rtl8188eu, but misses to adjust
the STAGING - REALTEK RTL8188EU DRIVERS section in MAINTAINERS.
Hence, ./scripts/get_maintainer.pl --self-test=patterns complains:
no file matches F: drivers/staging/rtl8188eu/
A refurnished rtl8188eu driver is available in ./drivers/staging/r8188eu/
and there is no existing section in MAINTAINERS for that directory.
So, reuse the STAGING - REALTEK RTL8188EU DRIVERS section and point to the
refurnished driver with its current developers and maintainers according
to the current git log.
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20210803071811.8142-1-lukas.bulwahn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Mon, 2 Aug 2021 19:27:19 +0000 (14:27 -0500)]
staging: r8188eu: Remove 4 empty routines from os_sep/service.c
Routines rtw_suspend_lock_init(), rtw_suspend_lock_uninit(),
rtw_lock_suspend(), and rtw_unlock_suspend() do not conti=ain any code.
Simplify by removing them.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210802192721.23110-5-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Mon, 2 Aug 2021 19:27:18 +0000 (14:27 -0500)]
staging: r8188eu: Remove wrappers for atomic operations
These wrappers were useful when this driver had the hooks for Windows,
but are no longer needed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210802192721.23110-4-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Mon, 2 Aug 2021 01:10:25 +0000 (03:10 +0200)]
staging: r8188eu: include: Remove unused const definitions
Remove unused const definitions. Issues detected by sparse. Remove the
'#ifdef' and '#endif' preprocessor directives that surround them.
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210802011025.23887-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Mon, 2 Aug 2021 01:00:56 +0000 (03:00 +0200)]
staging: r8188eu: Remove set but unused variables
Remove set but unused variables. Issues detected by sparse.
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210802010056.20543-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 1 Aug 2021 21:03:54 +0000 (23:03 +0200)]
staging: r8188eu: remove empty function odm_DynamicPrimaryCCA()
Function odm_DynamicPrimaryCCA() does nothing, remove it.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210801210354.25218-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 1 Aug 2021 21:03:53 +0000 (23:03 +0200)]
staging: r8188eu: remove return from void functions
Remove return from void functions to clear checkpatch warnings.
WARNING: void function return statements are not generally useful
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210801210354.25218-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Thu, 5 Aug 2021 10:43:38 +0000 (12:43 +0200)]
Revert "staging: r8188eu: Fix different base types in assignments and parameters"
This reverts commit
56febcc2595e2bf2546c5bb4c35740ce883771a2.
It's not correct and instead of fixing it up, let's just revert it for
now.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210802203020.9679-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sun, 1 Aug 2021 19:04:36 +0000 (20:04 +0100)]
staging: r8188eu: remove RT_TRACE calls from core/rtw_mp_ioctl.c
Remove RT_TRACE macro calls from core/rtw_mp_ioctl.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210801190437.82017-15-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sun, 1 Aug 2021 19:04:35 +0000 (20:04 +0100)]
staging: r8188eu: remove RT_TRACE calls from core/rtw_led.c
Remove RT_TRACE macro calls from core/rtw_led.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210801190437.82017-14-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sun, 1 Aug 2021 19:04:27 +0000 (20:04 +0100)]
staging: r8188eu: remove RT_TRACE calls from core/rtw_io.c
Remove RT_TRACE macro calls from core/rtw_io.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210801190437.82017-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sun, 1 Aug 2021 19:04:26 +0000 (20:04 +0100)]
staging: r8188eu: remove RT_TRACE calls from core/rtw_ieee80211.c
Remove RT_TRACE macro calls from core/rtw_ieee80211.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210801190437.82017-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sun, 1 Aug 2021 19:04:25 +0000 (20:04 +0100)]
staging: r8188eu: remove RT_TRACE calls from core/rtw_wlan_util.c
Remove RT_TRACE macro calls from core/rtw_wlan_util.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210801190437.82017-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sun, 1 Aug 2021 19:04:24 +0000 (20:04 +0100)]
staging: r8188eu: remove RT_TRACE calls from core/rtw_pwrctrl.c
Remove RT_TRACE macro calls from core/rtw_pwrctrl.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210801190437.82017-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Aiuto [Sun, 1 Aug 2021 13:46:29 +0000 (15:46 +0200)]
staging: rtl8723bs: remove unused macros
remove unused macros detected by -Wunused-macros
gcc option.
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210801134629.23433-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 1 Aug 2021 08:46:14 +0000 (10:46 +0200)]
staging: r8188eu: clean up comparsions to NULL in core directory
Clean up comparsions to NULL in the core directory reported by
checkpatch.
x == NULL -> !x
x != NULL -> x
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210801084614.4328-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 1 Aug 2021 08:46:13 +0000 (10:46 +0200)]
staging: r8188eu: clean up comparsions to NULL in hal directory
Clean up comparsions to NULL in the hal directory reported by
checkpatch.
x == NULL -> !x
x != NULL -> x
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210801084614.4328-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Mon, 2 Aug 2021 14:30:39 +0000 (16:30 +0200)]
Revert "staging: r8188eu: remove rtw_buf_free() function"
This reverts commit
c7e88ecbe328e2bcd892d84c4b26eff86cb776ef as it's
broken because somehow I forgot how pointers work...
Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 23:56:48 +0000 (00:56 +0100)]
staging: r8188eu: remove RT_PRINT_DATA macro
Remove RT_PRINT_DATA definition from include/rtw_debug.h, and its
two calling statements in hal/hal_com.c, as this code was not written
with best practices in mind and is safer to simply remove.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731235648.67642-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 13:38:09 +0000 (14:38 +0100)]
staging: rtl8188eu: remove rtl8188eu driver from staging dir
This driver was deprecated with the introduction of the r8188eu driver,
based upon Realtek sources that were modified for CFG80211 support and
other fixes on GitHub by Larry Finger. As that driver is now progressing
at pace, we should remove this one.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731133809.196681-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 13:38:04 +0000 (14:38 +0100)]
staging: r8188eu: correct set/defined but unused warnings from debug cleanup
The recent include/odm_debug.h removal series caused a few kernel test
robot warnings. This patch fixes them as well as an existing warning
related to an array within include/rtw_security.h not being used.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731133804.196631-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel test robot [Sat, 31 Jul 2021 12:18:43 +0000 (20:18 +0800)]
staging: r8188eu: fix duplicated inclusion
Generated by: scripts/checkincludes.pl
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20210731121843.GA54722@fdce12c5ae77
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:37 +0000 (01:39 +0100)]
staging: r8188eu: remove include/odm_debug.h
Remove include/odm_debug.h in its entirety. To do this, first:
(1) Remove DebugLevel and DebugComponents members from the struct
odm_dm_struct definition, and any uses of these elsewhere in
the driver.
(2) Remove the function ODM_InitDebugSetting from hal/odm_debug.c
whilst leaving the file in place for now as it contains a global
which is still used and will be removed by further cleanup code.
Also remove all of its callers. All the function does is set the
members mentioned above.
(3) Remove the now redundant constants and their usages:
ODM_CMNINFO_DBG_LEVEL
ODM_CMNINFO_DBG_COMP
HW_DEF_ODM_DBG_FLAG
HW_DEF_FA_CNT_DUMP
This includes usage within a few hexadecimal ioctl switch cases
in os_dep/ioctl_linux.c (although only the call itself within
0x11 as it contains additional code currently).
(4) Finally, remove the file itself and its inclusion within
include/odm_precomp.h, as none of the remaining content is used
from anywhere else in the driver.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-15-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:36 +0000 (01:39 +0100)]
staging: r8188eu: remove DbgPrint and RT_PRINTK macro definitions
Remove DbgPrint and RT_PRINTK macro definitions from include/odm_debug.h,
as they are called from nowhere and are therefore superfluous. Also
remove comment in core/rtw_xmit.c referring to DbgPrint so that future
confusion is prevented.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-14-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:35 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_TRACE macro definition
Remove ODM_RT_TRACE macro definition from include/odm_debug.h, as
it is called from nowhere and is therefore superfluous.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-13-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:34 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_TRACE calls from hal/odm.c
Remove ODM_RT_TRACE calls from hal/odm.c, as by removing these calls
in this file and others, we can ultimately then remove the macro
definition itself, which does not follow best practice.
Also remove three empty functions and their calls from hal/odm.c, as
they only contained ODM_RT_TRACE calls, and remove the corresponding
include/odm_precomp.h declarations.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-12-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:33 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_TRACE calls from hal/odm_RegConfig8188E.c
Remove ODM_RT_TRACE calls from hal/odm_RegConfig8188E.c, as by removing these
calls in this file and others, we can ultimately then remove the macro
definition itself, which does not follow best practice.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-11-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:32 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_TRACE calls from hal/odm_RTL8188E.c
Remove ODM_RT_TRACE calls from hal/odm_RTL8188E.c, as by removing these
calls in this file and others, we can ultimately then remove the macro
definition itself, which does not follow best practice.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-10-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:31 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_TRACE calls from hal/odm_HWConfig.c
Remove ODM_RT_TRACE calls from hal/odm_HWConfig.c, as by removing these
calls in this file and others, we can ultimately then remove the macro
definition itself, which does not follow best practice.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-9-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:30 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_TRACE calls from hal/HalPhyRf_8188e.c
Remove ODM_RT_TRACE calls from hal/HalPhyRf_8188e.c, as by removing these
calls in this file and others, we can ultimately then remove the macro
definition itself, which does not follow best practice.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:29 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_TRACE calls from hal/Hal8188ERateAdaptive.c
Remove ODM_RT_TRACE calls from hal/Hal8188ERateAdaptive.c, as by removing
these calls in this file and others, we can ultimately then remove the
macro definition itself, which does not follow best practice.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:28 +0000 (01:39 +0100)]
staging: r8188eu: remove ASSERT ifndef and macro definition
Remove ASSERT ifndef and macro definition from include/odm_debug.h, as
these are unused and therefore superfluous.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:27 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_TRACE_F macro definition
Remove ODM_RT_TRACE_F macro definition from include/odm_debug.h, as
it is called from nowhere and is therefore superfluous.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-5-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:26 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_RT_ASSERT macro definition and caller
Remove ODM_RT_ASSERT macro definition from include/odm_debug.h and
its one caller in hal/odm.c, as this debug code is against best
practice.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-4-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:25 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_dbg_* macro definitions
Remove ODM_dbg_* macro definitions from include/odm_debug.h, as
they are called from nowhere and are therefore superfluous.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-3-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Sat, 31 Jul 2021 00:39:24 +0000 (01:39 +0100)]
staging: r8188eu: remove ODM_PRINT_ADDR macro definition
Remove ODM_PRINT_ADDR macro definition from include/odm_debug.h, as
it is called from nowhere and is therefore superfluous.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210731003937.68615-2-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Fri, 30 Jul 2021 20:41:53 +0000 (22:41 +0200)]
staging: r8188eu: add missing spaces after ',' and before braces
Add missing spaces to clear checkpatch errors.
ERROR: space required before the open parenthesis '('
ERROR: space required before the open brace '{'
ERROR: space required after that ',' (ctx:ExV)
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210730204153.27270-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Fri, 30 Jul 2021 20:41:52 +0000 (22:41 +0200)]
staging: r8188eu: remove spaces before ',' and ')'
Remove spaces to clear checkpatch errors.
ERROR: space prohibited before that ',' (ctx:WxW)
ERROR: space prohibited before that close parenthesis ')'
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210730204153.27270-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Fri, 30 Jul 2021 18:14:52 +0000 (20:14 +0200)]
staging: r8188eu: Fix different base types in assignments and parameters
Fix sparse warnings of different base types in assignments
and in passing function parameters.
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210730181452.23062-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Aiuto [Fri, 30 Jul 2021 14:54:08 +0000 (16:54 +0200)]
staging: rtl8723bs: put condition parentheses at the end of a line
put the closing parenthese at the end of a line
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/295a41c98cd475ae25f9288d99a929b75492db3f.1627656773.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Aiuto [Fri, 30 Jul 2021 14:54:07 +0000 (16:54 +0200)]
staging: rtl8723bs: align condition to match open parentheses
fix following checkpatch issue:
CHECK: Alignment should match open parenthesis
54: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:609:
+ if (target->reserved[0] != 2 &&
+ target->reserved[0] >=
pnetwork->network.reserved[0]
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/941bd42ef6b7d76e80685b133046669a0ca82d8e.1627656773.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Aiuto [Fri, 30 Jul 2021 14:54:06 +0000 (16:54 +0200)]
staging: rtl8723bs: remove unnecessary parentheses
fix the following checkpatch issues:
CHECK: Unnecessary parentheses around
'pnetwork->network.ie_length > target->ie_length'
33: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:604:
+ if ((pnetwork->network.ie_length >
target->ie_length) && (target->reserved[0] == 1))
CHECK: Unnecessary parentheses around
'target->reserved[0] == 1'
33: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:604:
+ if ((pnetwork->network.ie_length >
target->ie_length) && (target->reserved[0] == 1))
CHECK: Unnecessary parentheses around
'target->reserved[0] != 2'
39: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:608:
+ if ((target->reserved[0] != 2) &&
+ (target->reserved[0] >=
pnetwork->network.reserved[0])
) {
CHECK: Unnecessary parentheses around
'target->reserved[0] >= pnetwork->network.reserved[0]'
39: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:608:
+ if ((target->reserved[0] != 2) &&
+ (target->reserved[0]
>= pnetwork->network.reserved[0])
) {
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/fca83a857ebb158cf395ea31f1834c04402c39e4.1627656773.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Aiuto [Fri, 30 Jul 2021 14:54:05 +0000 (16:54 +0200)]
staging: rtl8723bs: fix camel case issue in struct wlan_bssid_ex
fix camel case issue in field Reserved in struct wlan_bssid_ex
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/a70fd91a46fd2c75eb27824ea57ae0d87d65bf81.1627656773.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 14:39:21 +0000 (16:39 +0200)]
staging: r8188eu: fix include directory mess
The driver seems to want to include a specific directory for all include
files on the build path, but that breaks when trying to build only the
module directory, or when building with "O=" option.
Fix this up by making all includes for the driver be relative locations.
Reported-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210730144227.1770212-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:17 +0000 (11:24 +0200)]
staging: r8188eu: remove rtw_usb_control_msg() macro
It is a wrapper around usb_control_msg() that does nothing, so remove
the macro and just call the correct USB function instead in the one
place it is used.
Link: https://lore.kernel.org/r/20210730092417.1014392-12-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:16 +0000 (11:24 +0200)]
staging: r8188eu: remove rtw_usb_bulk_msg() macro
No one is using this wrapper macro, so just remove it as it is
pointless.
Link: https://lore.kernel.org/r/20210730092417.1014392-11-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:15 +0000 (11:24 +0200)]
staging: r8188eu: remove include/nic_spec.h
No one was including this file, so just remove it.
Link: https://lore.kernel.org/r/20210730092417.1014392-10-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:14 +0000 (11:24 +0200)]
staging: r8188eu: remove unused enum _NIC_VERSION
None of these enumerated values were used anywhere in the driver, so
just remove them all.
Link: https://lore.kernel.org/r/20210730092417.1014392-9-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:13 +0000 (11:24 +0200)]
staging: r8188eu: remove rtw_buf_free() function
It is just a wrapper around kfree(), so just replace all calls with
kfree() instead. The pointer is also set to NULL and the length set to
0 to emulate the original logic, just to be "safe" as I do not have a
device to test with, but odds are that can be removed later on.
Link: https://lore.kernel.org/r/20210730092417.1014392-8-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:12 +0000 (11:24 +0200)]
staging: r8188eu: remove rtw_mfree2d() function
It is just a wrapper around kfree(), so remove it and just call kfree()
instead.
Link: https://lore.kernel.org/r/20210730092417.1014392-7-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:11 +0000 (11:24 +0200)]
staging: r8188eu: remove include/Hal8188EReg.h
No one is using the defines in this file, so remove it as it is not
needed anywhere.
Link: https://lore.kernel.org/r/20210730092417.1014392-6-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:10 +0000 (11:24 +0200)]
staging: r8188eu: remove include/autoconf.h
No one uses this file, so just remove it.
Also remove the pointless Makefile rule that was attempting to create
it.
Link: https://lore.kernel.org/r/20210730092417.1014392-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:09 +0000 (11:24 +0200)]
staging: r8188eu: remove include/h2clbk.h
No one uses this file, so remove it from the tree.
Link: https://lore.kernel.org/r/20210730092417.1014392-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:08 +0000 (11:24 +0200)]
staging: r8188eu: move ODM_GetRightChnlPlaceforIQK()
ODM_GetRightChnlPlaceforIQK() is only called in one place, so move the
call to the single location and make the file static.
This lets us remove the hal/HalPhyRf.c and include/HalPhyRf.h files as
they are now empty.
Link: https://lore.kernel.org/r/20210730092417.1014392-3-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:07 +0000 (11:24 +0200)]
staging: r8188eu: move ODM_TARGET_CHNL_NUM_2G_5G
The ODM_TARGET_CHNL_NUM_2G_5G define is only used in one place, so move
it to the .c file it is used in instead of being in a .h file.
Link: https://lore.kernel.org/r/20210730092417.1014392-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Fri, 30 Jul 2021 09:24:06 +0000 (11:24 +0200)]
staging: r8188eu: remove empty ODM_ResetIQKResult() function
ODM_ResetIQKResult() is empty and does nothing, so remove it.
Link: https://lore.kernel.org/r/20210730092417.1014392-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Aiuto [Fri, 30 Jul 2021 13:40:48 +0000 (15:40 +0200)]
staging: rtl8723bs: remove unused BIT macros definitions
BIT(x) macro used all over the driver is defined in
include/vsdo/bit.h as
- #define BIT(nr) (UL(1) << (nr))
which is safer than the local BIT macros declared.
Local macros shift a signed integer which brings
unespected results. For example:
(unsigned long)(1 << 31) => 0xffffffff80000000
shift.c:
int main() {
printf("%lx\n", (unsigned long)(1 << 31));
printf("%lx\n", (unsigned long)(1U << 31));
return 0;
}
...
$ ./shift
ffffffff80000000
80000000
...
So just remove redundant, less safe macro declarations.
Suggested-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210730134048.8736-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Fri, 30 Jul 2021 13:02:04 +0000 (15:02 +0200)]
staging: r8188eu: clean up comparsions to NULL in os_dep directory
Clean up comparsions to NULL in the os_dep directory reported by
checkpatch.
x == NULL -> !x
x != NULL -> x
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210730130204.18229-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Fri, 30 Jul 2021 10:37:16 +0000 (12:37 +0200)]
staging: r8188eu: Remove no more used functions and variables
Remove the functions and variables from rtw_security.c that are no more
necessary since the patch that replaces getcrc32() with crc32_le().
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210730103716.27210-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Fri, 30 Jul 2021 10:37:15 +0000 (12:37 +0200)]
staging: r8188eu: Replace a custom function with crc32_le()
Use crc32_le() in place of the custom getcrc32().
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210730103716.27210-2-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Fri, 30 Jul 2021 09:09:48 +0000 (11:09 +0200)]
staging: r8188eu: simplify odm_evm_db_to_percentage()
Use clamp() to simplify odm_evm_db_to_percentage().
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210730090948.32759-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Fri, 30 Jul 2021 09:09:47 +0000 (11:09 +0200)]
staging: r8188eu: rename parameter of odm_evm_db_to_percentage()
Rename parameter of odm_evm_db_to_percentage() to avoid camel case.
Value -> value
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210730090948.32759-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Fri, 30 Jul 2021 09:09:46 +0000 (11:09 +0200)]
staging: r8188eu: rename odm_EVMdbToPercentage()
Rename odm_EVMdbToPercentage() to avoid camel case.
odm_EVMdbToPercentage() -> odm_evm_db_to_percentage()
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210730090948.32759-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Fri, 30 Jul 2021 00:38:22 +0000 (19:38 -0500)]
staging: r8188eu: Fix sleeping function called from invalid context
The driver can call rtw_addbareq_cmd() from an interrupt routine. resulting
in the following splat:
[21760.582207] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:201
[21760.582219] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/0
[21760.582224] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G C O 5.14.0-rc2-00135-g774ba5f0db67 #3
[21760.582228] Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.50 09/29/2014
[21760.582230] Call Trace:
[21760.582232] <IRQ>
[21760.582233] dump_stack_lvl+0x34/0x44
[21760.582245] ? rtw_addbareq_cmd+0x2a/0xba [r8188eu]
[21760.582306] ___might_sleep.cold+0x88/0x95
[21760.582311] kmem_cache_alloc_trace+0x25a/0x2d0
[21760.582315] rtw_addbareq_cmd+0x2a/0xba [r8188eu]
[21760.582368] rtw_issue_addbareq_cmd+0xda/0x17f [r8188eu]
[21760.582404] rtw_dump_xframe+0xa6/0x266 [r8188eu]
[21760.582433] xmitframe_direct+0x40/0x57 [r8188eu]
[21760.582459] pre_xmitframe+0x72/0x110 [r8188eu]
[21760.582485] rtl8188eu_hal_xmit+0xa/0xb [r8188eu]
[21760.582508] rtw_hal_xmit+0x1b/0x1c [r8188eu]
[21760.582539] rtw_xmit+0xd6/0x1cb [r8188eu]
[21760.582564] rtw_xmit_entry+0xe4/0x1d2 [r8188eu]
[21760.582584] xmit_one.constprop.0+0x98/0x170
[21760.582588] dev_hard_start_xmit+0x40/0x90
[21760.582591] sch_direct_xmit+0xfa/0x230
[21760.582596] __dev_xmit_skb+0x27c/0x530
[21760.582598] __dev_queue_xmit+0x327/0x4e0
[21760.582602] ip_finish_output2+0x279/0x5c0
[21760.582605] __ip_queue_xmit+0x167/0x3f0
[21760.582607] __tcp_transmit_skb+0x4ff/0x9a0
[21760.582610] tcp_rcv_established+0x5c1/0x6f0
[21760.582613] tcp_v4_do_rcv+0x13e/0x240
[21760.582616] tcp_v4_rcv+0xbad/0xc70
[21760.582618] ? ip_rcv_finish_core.constprop.0+0x13c/0x2f0
[21760.582621] ip_protocol_deliver_rcu+0x30/0x1f0
[21760.582623] ip_local_deliver_finish+0x4b/0x60
[21760.582625] __netif_receive_skb_one_core+0x63/0x90
[21760.582628] process_backlog+0x8f/0x140
[21760.582631] __napi_poll+0x2e/0x180
[21760.582634] net_rx_action+0x11b/0x260
[21760.582637] __do_softirq+0xcb/0x2f5
[21760.582640] irq_exit_rcu+0x9e/0xc0
[21760.582643] common_interrupt+0x83/0xa0
[21760.582647] </IRQ>
[21760.582647] asm_common_interrupt+0x1e/0x40
[21760.582650] RIP: 0010:cpuidle_enter_state+0xdf/0x5c0
[21760.582655] Code: 49 89 c6 0f 1f 44 00 00 31 ff e8 4c a1 98 ff 45 84 ff 74 12 9c 58 f6 c4 02 0f 85 10 03 00 00 31 ff e8 d5 73 9f ff fb 45 85 ed <0f> 88 59 01 00 00 4d 63 e5 49 83 fc 09 0f 87 05 04 00 00 4b 8d 04
Fix by changing kmalloc() flags argument from GFP_KERNEL to GFP_ATOMIC.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210730003822.12471-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Agam Kohli [Thu, 29 Jul 2021 18:12:08 +0000 (14:12 -0400)]
Staging: rt18712: hal_init: removed filename from beginning comment block
Fixed a coding style issue
Signed-off-by: Agam Kohli <agamkohli9@gmail.com>
Link: https://lore.kernel.org/r/YQLveNI2UrnpeeAt@Agam.localdomain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 17:09:30 +0000 (12:09 -0500)]
staging: r8188eu: Add "fallthrough" statement to quiet compiler
Compiler gcc11, and possibly others, emit a warning when a fall-through
case is found in a switch statement. Add a "fallthrough" statement to
eliminate this warning.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729170930.23171-7-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 17:09:29 +0000 (12:09 -0500)]
staging: r8188eu: Remove header file include/rtw_version.h
This file contains only the definition of the driver version. This statement
is moved into a header called by all the affected source files, and the now
empty header is deleted.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729170930.23171-6-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 17:09:28 +0000 (12:09 -0500)]
staging: r8188eu: Remove header file include/usb_hal.h
This header only includes one prototype and one define statement. The
new definition is used once, thus it can be removed. The prototype is
moved to a header that is already called by the supplier and the user
of that routine, thus the small header is removed.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729170930.23171-5-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 17:09:27 +0000 (12:09 -0500)]
staging: r8188eu: Remove include/rtw_qos.h
This header file merely defines a single struct. Move that definition
to the header file that uses it, and delete rtw_qos.h.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729170930.23171-4-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 17:09:26 +0000 (12:09 -0500)]
staging: r8188eu: Remove tests of kernel version
In the GitHub repository from which this driver was derived, old kernels
had to be supported. Now that the driver is included in the kernel,
this code can be removed as well as all mention of version.h.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729170930.23171-3-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 17:09:25 +0000 (12:09 -0500)]
staging: r8188eu: Remove empty header file
File include/drv_types_linux.h is empty. Remove it.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729170930.23171-2-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 16:48:14 +0000 (11:48 -0500)]
staging: r8188eu: Convert copyright header info to SPDX format, part 6
Before this driver can be incorporated in the drivers/net/wireless tree,
the copyright info in all files must be converted to SPDX notation.
This patch converts the C source files in hal/.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729164814.32097-7-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 16:48:13 +0000 (11:48 -0500)]
staging: r8188eu: Convert header copyright info to SPDX format, part 5
Before this driver can be incorporated in the drivers/net/wireless tree,
the copyright info in all files must be converted to SPDX notation.
This patch converts the 9 C source files in os_dep/.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729164814.32097-6-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Larry Finger [Thu, 29 Jul 2021 16:48:12 +0000 (11:48 -0500)]
staging: r8188eu: Convert header copyright info to SPDX format, part 4
Before this driver can be incorporated in the drivers/net/wireless tree,
the copyright info in all files must be converted to SPDX notation.
This patch converts the 23 C source files in core/.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210729164814.32097-5-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>