Dave Stevenson [Tue, 25 May 2021 21:57:37 +0000 (23:57 +0200)]
staging: mmal-vchiq: Fix incorrect static vchiq_instance.
For some reason lost in history function vchiq_mmal_init used
a static variable for storing the vchiq_instance.
This value is retrieved from vchiq per instance, so worked fine
until you try to call vchiq_mmal_init multiple times concurrently
when things then go wrong. This seemed to happen quite frequently
if using the cutdown firmware (no MMAL or VCSM services running)
as the vchiq_connect then failed, and one or other vchiq_shutdown
was working on an invalid handle.
Remove the static so that each caller gets a unique vchiq_instance.
Fixes:
7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621979857-26754-1-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Tue, 25 May 2021 21:48:13 +0000 (22:48 +0100)]
staging: rtl8188eu: convert pr_info call to dev_err call ODM_RAStateCheck
Introduce logic to extract struct device pointer from passed in struct
odm_dm_struct pointer argument, and use this to call dev_err instead of
pr_info. As this is an error state if this line is reached, this is not
just information. Also, this is a driver, so dev_err is more
appropriate.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210525214813.6362-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Donggyu Kim [Tue, 25 May 2021 14:01:23 +0000 (23:01 +0900)]
Staging: rtl8723bs: fixed a blank coding style
Fixed a coding style issue - add blank after declation
Signed-off-by: Dongkyu Kim <a29661498@gmail.com>
Link: https://lore.kernel.org/r/20210525140123.15100-1-a29661498@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Harold Mertzweiller [Mon, 24 May 2021 15:21:26 +0000 (17:21 +0200)]
staging: emxx_udc: fix alignment issues
Three function calls can now be properly formatted inside the 100
characters limit.
Signed-off-by: Harold Mertzweiller <harold@mrtz.fr>
Link: https://lore.kernel.org/r/20210524152128.20519-1-harold@mrtz.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Mon, 24 May 2021 19:53:13 +0000 (19:53 +0000)]
staging: rtl8723bs: remove sd_f0_read8()
The sd_f0_read8() function, which is used by the sdio_f0_read8()
function, are not used anywhere in the driver and both can be
safely removed.
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/20210524195144.1943280-1-hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Mon, 24 May 2021 22:45:32 +0000 (23:45 +0100)]
staging: rtl8188eu: remove ASSERT and ODM_RT_ASSERT macros
Remove the ASSERT and ODM_RT_ASSERT macros from include/odm_debug.h
as they are unnecessary.
ASSERT does nothing, compiling to a single empty statement.
ODM_RT_ASSERT is used in only one place, in the ODM_RAStateCheck
function with hal/odm.c - it seems to have been intended as an
assertion of some kind, but given it is always called with false
here, there is little point in it not just being a pr_info() call.
Also, the lines relating to the file, function and line number are
not needed as the pr_info() with the function name and error message
is sufficient should anyone wish to track down this error at a source
level, within what is currently a relatively small function.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210524224532.1230-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shreyansh Chouhan [Mon, 24 May 2021 13:51:05 +0000 (19:21 +0530)]
staging: rtl8723bs: fix suspect indents
Removed extra spaces and indents from core/rtw_wlan_util.c.
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Link: https://lore.kernel.org/r/20210524135105.5550-4-chouhan.shreyansh630@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shreyansh Chouhan [Mon, 24 May 2021 13:51:04 +0000 (19:21 +0530)]
staging: rtl8723bs: remove unnecessary braces from conditionals
Removed the braces from if else statements in core/rtw_wlan_util.c since
the previous commit (
6a257dd6de516573) caused all conditional blocks to
have a single statement in the function check_assoc_AP.
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Link: https://lore.kernel.org/r/20210524135105.5550-3-chouhan.shreyansh630@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shreyansh Chouhan [Mon, 24 May 2021 13:51:03 +0000 (19:21 +0530)]
staging: rtl8723bs: refactor to reduce indents
Reduce the number of indents in rtw_wlan_util.c file by refactoring the
code.
Moved the part of code that rearranged ac paramaters in the function
WMMOnAssocResp to a separate function named sort_wmm_ac_params. It takes
both the array of ac params and their indexes as arguments and sorts them.
Has return type void.
Moved the part of code that checked IE for realtek vendor in the
function check_assoc_AP to a separate function named
get_realtek_assoc_AP_vender. It takes a struct ndis_80211_var_ie * as an
argument and returns u32 realtek vendor.
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Link: https://lore.kernel.org/r/20210524135105.5550-2-chouhan.shreyansh630@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Mon, 24 May 2021 11:34:33 +0000 (13:34 +0200)]
staging: rtl8723bs: core: rtw_mlme_ext.c: Remove set but unused variable
Removed set but unused 'reason_code' variable. Issue detected by GCC
running with the warning option -Wunused-but-set-variable.
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210524113433.25923-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio M. De Francesco [Sun, 23 May 2021 17:45:47 +0000 (19:45 +0200)]
staging: rtl8723bs: hal: Remove set but unused variables
Removed set but unused variables. Issue detected by GCC running with
the warning option -Wunused-but-set-variable. Removed the storage of
the values returned but left the reads because it is possible
that removing them can prevent the hardware from working properly.
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210523174547.20646-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thomas Bracht Laumann Jespersen [Fri, 21 May 2021 19:37:12 +0000 (21:37 +0200)]
staging: rtl8192e: Fix shadowed variable name
Fixes the following sparse warning:
drivers/staging/rtl8192e/rtllib_tx.c:884:32: warning: symbol 'tcb_desc' shadows an earlier one
drivers/staging/rtl8192e/rtllib_tx.c:569:24: originally declared here
Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
Link: https://lore.kernel.org/r/20210521193711.5457-1-t@laumann.xyz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hriday Hegde [Fri, 21 May 2021 15:39:16 +0000 (08:39 -0700)]
staging: rtl8712: Removed unnecessary blank lines
Following lines were fixed as dictated by running checkpatch
CHECK: Please don't use multiple blank lines
65: FILE: drivers/staging/rtl8712/xmit_linux.c:65:
+
CHECK: Blank lines aren't necessary after an open brace '{'
39: FILE: drivers/staging/rtl8712/usb_intf.c:39:
+static const struct usb_device_id rtl871x_usb_id_tbl[] = {
CHECK: Blank lines aren't necessary after an open brace '{'
849: FILE: drivers/staging/rtl8712/rtl871x_xmit.c:849:
+{
CHECK: Please don't use multiple blank lines
260: FILE: drivers/staging/rtl8712/rtl871x_sta_mgt.c:260:
+
Signed-off-by: Hriday Hegde <hridayhegde1999@gmail.com>
Link: https://lore.kernel.org/r/20210521153924.22843-1-hridayhegde1999@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fabio Aiuto [Fri, 21 May 2021 14:41:58 +0000 (16:41 +0200)]
staging: rtl8723bs: moved contexts for arc4 encryption in struct security_priv
moved struct arc4_ctx in struct security_priv to avoid stack allocation
inside encryption routines.
this has been done to fix the following 0-DAY issues:
>> drivers/staging/rtl8723bs/core/rtw_security.c:89:6: warning:
stack frame size of 1120 bytes in function 'rtw_wep_encrypt'
[-Wframe-$
void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
^
>> drivers/staging/rtl8723bs/core/rtw_security.c:145:6:
warning: stack frame size of 1088 bytes in function 'rtw_wep_decrypt'
[-Wframe$
void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
^
>> drivers/staging/rtl8723bs/core/rtw_security.c:514:5:
warning: stack frame size of 1136 bytes in function 'rtw_tkip_encrypt'
[-Wfram$
u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
^
>> drivers/staging/rtl8723bs/core/rtw_security.c:586:5:
warning: stack frame size of 1104 bytes in function 'rtw_tkip_decrypt'
[-Wfram$
u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
^
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210521144158.2440-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Thu, 20 May 2021 06:48:01 +0000 (08:48 +0200)]
staging: rtl8723bs: rename get_ra() due to global symbol collision
Turns out that powerpc already has a get_ra() function, which conflicts
with this staging driver's inlined function (which is just picking a
byte out of an array for some odd reason), so rename it to fix the
powerpc build as that's the more important thing here.
Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20210520064801.1961972-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Thu, 20 May 2021 06:41:44 +0000 (08:41 +0200)]
staging: rtl8723bs: rtl8723b_hal_init.c: fix build warnings about unused variables
0-day keeps spitting out annoying messages:
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:3895:18: warning: variable 'ra_info2' set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:3895:8: warning: variable 'ra_info1' set but not used [-Wunused-but-set-variable]
Oddly, it's not catching all of the "set but not used" variables in this
switch statement. Fix it up just removing the storage of the values
read. Leave the read from the hardware as odds are it is required in
order to keep it working properly as I do not have the hardware to test
with.
I bet the whole case can be removed, but that will have to wait until
later...
Link: https://lore.kernel.org/r/20210520064144.1953251-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Thu, 20 May 2021 06:41:33 +0000 (08:41 +0200)]
staging: rtl8723bs: HalBtc8723b1Ant.c: fix build warnings about unused variables
0-day keeps spitting out annoying messages:
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c:2117:6: warning: variable 'u4Tmp' set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c:2118:17: warning: variable 'u1Tmpb' set but not used [-Wunused-but-set-variable]
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c:2118:5: warning: variable 'u1Tmpa' set but not used [-Wunused-but-set-variable]
So fix this up by just removing the storage of the values read. Leave
the read from the hardware as odds are it is required in order to keep
it working properly as I do not have the hardware to test with.
Link: https://lore.kernel.org/r/20210520064133.1953156-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philippe Dixon [Wed, 19 May 2021 19:39:38 +0000 (12:39 -0700)]
staging: greybus: spi: add blank line after variable declaration
This patch fixes the following checkpatch.pl warning:
WARNING: Missing a blank line after declarations
Reviewed-by: Alex Elder <elder@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Philippe Dixon <philippesdixon@gmail.com>
Link: https://lore.kernel.org/r/20210519193938.GA7131@ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
F.A.Sulaiman [Wed, 19 May 2021 18:19:38 +0000 (23:49 +0530)]
Staging: greybus: fix open parenthesis error in gbphy.c
This patch fix "Alignment should match open parenthesis" checkpatch error.
Acked-by: Alex Elder <elder@linaro.org>
Signed-off-by: "F.A.Sulaiman" <asha.16@itfac.mrt.ac.lk>
Link: https://lore.kernel.org/r/20210519181938.30813-1-asha.16@itfac.mrt.ac.lk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Wed, 19 May 2021 14:16:50 +0000 (17:16 +0300)]
staging: emxx_udc: fix loop in _nbu2ss_nuke()
The _nbu2ss_ep_done() function calls:
list_del_init(&req->queue);
which means that the loop will never exit.
Fixes:
ca3d253eb967 ("Staging: emxx_udc: Iterate list using list_for_each_entry")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YKUd0sDyjm/lkJfJ@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rajat Asthana [Wed, 19 May 2021 13:41:19 +0000 (19:11 +0530)]
staging: greybus: audio: Fix sparse warning.
Sparse complains that:
warning: restricted send_ctl_elem_iface_t degrades to integer.
I have looked at this code, and the code is fine as-is. Normally we
would frown on using the __force directive to silence Sparse warnings
but in this case it's fine. Case statements can't be made into __bitwise
types. We also can't change the type of "ctl->iface" either because that
is part of the user space API.
So just add a (__force int) to make the warning go away.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rajat Asthana <thisisrast7@gmail.com>
Link: https://lore.kernel.org/r/20210519134119.848055-1-thisisrast7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bixuan Cui [Fri, 14 May 2021 08:52:14 +0000 (16:52 +0800)]
staging: comedi: Remove unused variable ‘min_full_scale’ and function 'get_min_full_scales'
The variable ‘min_full_scale’ and function 'get_min_full_scales' are
not used, So delete them.
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Link: https://lore.kernel.org/r/20210514085214.53941-1-cuibixuan@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 14:45:19 +0000 (14:45 +0000)]
staging: rtl8723bs: remove if (true) statement
'if (true) { ... }' will always evaluate to true. Remove it and
save a few tabs for somewhere else.
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/20210518144335.1677320-1-hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wang Qing [Wed, 19 May 2021 03:00:17 +0000 (11:00 +0800)]
staging: rtl8192e: delete extra blank lines
fixing CHECK:Blank lines aren't necessary before a close brace '}'
Signed-off-by: Wang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1621393219-28665-1-git-send-email-wangqing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wang Qing [Wed, 19 May 2021 01:52:50 +0000 (09:52 +0800)]
staging: iio: fix some formatting issues
fixing:
CHECK: Alignment should match open parenthesis
#1351: FILE: drivers/staging/iio/addac/adt7316.c:1351:
CHECK: Alignment should match open parenthesis
#1378: FILE: drivers/staging/iio/addac/adt7316.c:1378:
Signed-off-by: Wang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1621389170-5850-1-git-send-email-wangqing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jiabing Wan [Tue, 18 May 2021 12:17:33 +0000 (20:17 +0800)]
staging: vc04_services: fix a whitespace coding style issue
Fixing the following checkpatch warning:
WARNING: please, no spaces at the start of a line
Signed-off-by: Jiabing Wan <kael_w@yeah.net>
Link: https://lore.kernel.org/r/20210518121735.88767-1-wanjiabing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 18:30:53 +0000 (18:30 +0000)]
staging: rtl8723bs: remove _rtw_sd_f0_read8()
Both the _rtw_sd_f0_read8() function and the rtw_sd_f0_read8()
redefinition are used anywhere in the driver and can be removed.
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/5f025724ea7149e6ff11f94352b3321833f9bcaf.1621361919.git-series.hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 18:29:47 +0000 (18:29 +0000)]
staging: rtl8723bs: remove duplicate name for _rtw_write_port()
_rtw_write_port() is being redefined as rtw_write_port(). Because
rtw_write_port() is the only name used in the driver, remove the
duplicate definition and rename the function from _rtw_write_port()
to rtw_write_port()
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/5b8543127a774ca65595588711c05cce28b17bf6.1621361919.git-series.hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 18:31:41 +0000 (18:31 +0000)]
staging: rtl8723bs: remove duplicate names for _rtw_write32()
_rtw_write32() is redefined as rtw_write32() and
PlatformEFIOWrite4Byte(). Because rtw_write32() is the only name used in
the driver, remove the duplicate definitions and rename the function
from _rtw_write32() to rtw_write32()
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/43917aee34e85139e613578cf6f14938211c8835.1621361919.git-series.hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 18:28:18 +0000 (18:28 +0000)]
staging: rtl8723bs: remove duplicate names for _rtw_write16()
_rtw_write16() is redefined as rtw_write16() and
PlatformEFIOWrite2Byte(). Because rtw_write16() is the only name used in
the driver, remove the duplicate definitions and rename the function
from _rtw_write16() to rtw_write16()
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/7d53fb295f67f01c72640045afb88150391bce35.1621361919.git-series.hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 18:27:54 +0000 (18:27 +0000)]
staging: rtl8723bs: remove duplicate names for _rtw_write8()
_rtw_write8() is redefined as rtw_write8() and PlatformEFIOWrite1Byte().
Because rtw_write8() is the only name used in the driver, remove the
duplicate definitions and rename the function from _rtw_write8() to
rtw_write8()
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/35ffc9cd5af7009b317361033a6ca5263307d61a.1621361919.git-series.hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 18:28:03 +0000 (18:28 +0000)]
staging: rtl8723bs: remove duplicate names for _rtw_read32()
_rtw_read32() is redefined as rtw_read32() and PlatformEFIORead4Byte().
Because rtw_read32() is the only name used in the driver, remove the
duplicate definitions and rename the function from _rtw_read32() to
rtw_read32()
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/15956707341f76de683245c392063b8121a805ea.1621361919.git-series.hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 18:28:56 +0000 (18:28 +0000)]
staging: rtl8723bs: remove duplicate names for _rtw_read16()
_rtw_read16() is redefined as rtw_read16() and PlatformEFIORead2Byte().
Because rtw_read16() is the only name used in the driver, remove the
duplicate definitions and rename the function from _rtw_read16() to
rtw_read16()
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/11458342572f21d9df58b3969ad1f16fdff157f4.1621361919.git-series.hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bryan Brattlof [Tue, 18 May 2021 18:27:43 +0000 (18:27 +0000)]
staging: rtl8723bs: remove duplicate names for _rtw_read8()
_rtw_read8() is redefined as rtw_read8() and PlatformEFIORead1Byte().
Because rtw_read8() is the only name used in the driver, remove the
duplicate definitions and rename the function from _rtw_read8() to
rtw_read8()
Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/9880c86c2aad7d95a714d8b03b28b83634f98c1e.1621361919.git-series.hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:13:50 +0000 (21:13 +0200)]
staging: vchiq_core: introduce defines for retry_poll
Use descriptive defines instead of a number with a comment.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621106030-30363-1-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:58 +0000 (21:10 +0200)]
staging: vchiq_core: introduce defines for close_recvd
Use descriptive defines instead of a number with a comment.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-20-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:57 +0000 (21:10 +0200)]
staging: vchiq_core: introduce parse_message
The function parse_rx_slots is very longer. So move at least the message
parsing into a separate function to improve readability. In good case
the function returns the message payload length which is necessary to
move to the next message.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-19-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:56 +0000 (21:10 +0200)]
staging: vchiq_arm: Avoid unnecessary line breaks
There are a few statements which are unnecessary broken into multiple lines.
Let's join them into a single line to improve readability.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-18-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:55 +0000 (21:10 +0200)]
staging: vchiq_arm: make vchiq_shutdown_internal return void
The function vchiq_shutdown_internal always returns VCHIQ_SUCCESS. So change
the return type to void and simplify the logic in vchiq_shutdown.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-17-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:54 +0000 (21:10 +0200)]
staging: vchiq_core: fix comment in vchiq_shutdown_internal
The comment seems to be copied from vchiq_connect_internal(). So change
it to match the actual behavior.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-16-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:53 +0000 (21:10 +0200)]
staging: vchiq_core: reduce indention in release_service_messages
It's possible to convert the if statement into a continue early and
save an indention level.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-15-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:52 +0000 (21:10 +0200)]
staging: vchiq_arm: re-arrange function header
This makes the function headers look more consistent.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-14-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:51 +0000 (21:10 +0200)]
staging: vchiq_arm: add blank line after declarations
Improve the readability by add a blank line after declarations. This
was found with checkpatch.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-13-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:50 +0000 (21:10 +0200)]
staging: vchiq_arm: drop non-beneficial comments
Those comments doesn't provide any benefit, so drop them.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-12-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:49 +0000 (21:10 +0200)]
staging: vchiq_arm: Prefer kzalloc(sizeof(*waiter)...)
It's shorter and easier to maintain. This has been found with checkpatch.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-11-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:48 +0000 (21:10 +0200)]
staging: vchiq_arm: drop ftrace-like logging
This addresses the warnings reported by checkpatch:
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-10-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:47 +0000 (21:10 +0200)]
staging: vchiq_arm: Use define for doorbell irq
The interrupt handler uses a magic number to check that the doorbell
was rung. Better replace this number with official Broadcom define.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-9-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:46 +0000 (21:10 +0200)]
staging: vchiq_core: avoid indention in poll_services_of_group
By converting the first and the third if statement into continue early
the function poll_services_of_group() can avoid 2 indention levels.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-8-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:45 +0000 (21:10 +0200)]
staging: vchiq_core: introduce poll_services_of_group
The function poll_services() has too many indention levels. So keep only
the group iteration loop and move the rest into a new function
poll_services_of_group().
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-7-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:44 +0000 (21:10 +0200)]
staging: vchiq_arm: balance braces for if-else statements
This fixes the following checkpatch notices in vchiq_arm:
CHECK: braces {} should be used on all arms of this statement
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-6-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:43 +0000 (21:10 +0200)]
staging: vc04_services: remove __VCCOREVER__
This define isn't used anymore. Let's remove it.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-5-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:42 +0000 (21:10 +0200)]
staging: vchiq_core: separate postfix increment
Postfix increment within a complexer statement doesn't improve readability.
So separate them.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-4-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:41 +0000 (21:10 +0200)]
staging: vchiq_core: drop unnecessary release_count
There is no benefit of the variable release_count, so drop it.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-3-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stefan Wahren [Sat, 15 May 2021 19:10:40 +0000 (21:10 +0200)]
staging: vchiq_core: fix return type of vchiq_init_state
Recent commit "staging: vchiq_core: drop vchiq_status from vchiq_init_state"
missed to change the return type in the definition. Let's fix this now.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/1621105859-30215-2-git-send-email-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 17 May 2021 20:18:26 +0000 (22:18 +0200)]
staging: rtl8188eu: use safe iterator in rtw_free_xmitframe_queue
Use list_for_each_entry_safe, we may delete list items while iterating
over the list.
Fixes:
23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 17 May 2021 20:18:25 +0000 (22:18 +0200)]
staging: rtl8188eu: use safe iterator in rtw_sta_flush
Use list_for_each_entry_safe, we may delete list items while iterating
over the list.
Fixes:
23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 17 May 2021 20:18:24 +0000 (22:18 +0200)]
staging: rtl8188eu: use safe iterator in rtw_acl_remove_sta
Use list_for_each_entry_safe, we may delete list items while iterating
over the list.
Fixes:
23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 17 May 2021 20:18:23 +0000 (22:18 +0200)]
staging: rtl8188eu: use safe iterator in expire_timeout_chk
In the first loop in expire_timeout_chk, we may call rtw_free_stainfo and
remove an entry from auth_list.
In the second loop, we may call list_del_init on our list.
Use list_for_each_entry_safe for both loops.
Fixes:
23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 17 May 2021 20:18:22 +0000 (22:18 +0200)]
staging: rtl8188eu: use safe iterator in rtw_free_all_stainfo
This is another case where we may remove list entries while we iterate over
the list. Use list_for_each_entry_safe to avoid an endless loop.
Fixes:
23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 17 May 2021 20:18:21 +0000 (22:18 +0200)]
staging: rtl8188eu: use safe iterator in rtw_free_network_queue
rtw_free_network_queue iterates over the scanned wireless networks and
calls _rtw_free_network for each of them. In some cases,
_rtw_free_network removes a network from the list.
We have to use list_for_each_entry_safe if we remove list entries while
we iterate over a list.
Fixes:
23017c8842d2 ("staging: rtl8188eu: Use list iterators and helpers")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210517201826.25150-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Desmond Cheong Zhi Xi [Tue, 18 May 2021 04:41:19 +0000 (00:41 -0400)]
Staging: rtl8723bs: remove dead code in HalBtc8723b1Ant.c
This commit removes dead code to resolve the following checkpatch.pl
warning:
WARNING: Block comments use * on subsequent lines
+ /*
+ CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x ", "Latest error condition(should be 0)", \
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Link: https://lore.kernel.org/r/20210518044119.2960494-8-desmondcheongzx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Desmond Cheong Zhi Xi [Tue, 18 May 2021 04:41:18 +0000 (00:41 -0400)]
Staging: rtl8723bs: fix line continuations in HalBtc8723b1Ant.c
In addition to removing line continuations, the indentation of some
lines were fixed. This was done to avoid the introduction of new
warnings because removing the line continuations caused checkpatch.pl
to emit "CHECK: Alignment should match open parenthesis".
This commit fixes the following checkpatch.pl warnings:
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d/ %d/ %d", "Ant PG Num/ Ant Mech/ Ant Pos:", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %s / %d", "BT stack/ hci ext ver", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d_%x/ 0x%x/ 0x%x(%d)", "CoexVer/ FwVer/ PatchVer", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsChnl(HsMode)", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d/ %d", "Wifi rssi/ HS rssi", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d/ %d/ %d/ %s", "Wifi bLink/ bRoam/ bScan/ bHi-Pri", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %s / %s/ %s/ AP =%d/ %s ", "Wifi status", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d/ %d/ %d/ %d/ %d", "sta/vwifi/hs/p2pGo/p2pGc", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = [%s/ %d/ %d/ %d] ", "BT [status/ rssi/ retryCnt/ popCnt]", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d / %d / %d / %d", "SCO/HID/PAN/A2DP", \
WARNING: Avoid unnecessary line continuations
+ CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s", "BT Role", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %s", "BT Info A2DP rate", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %02x %02x %02x %02x %02x %02x %02x(%d)", GLBtInfoSrc8723b1Ant[i], \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %s/%s, (0x%x/0x%x)", "PS state, IPS/LPS, (lps/rpwm)", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d", "SM[LowPenaltyRA]", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %s/ %s/ %d ", "DelBA/ BtCtrlAgg/ AggSize", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x ", "Rate Mask", \
WARNING: Avoid unnecessary line continuations
+ CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x %02x %02x case-%d (auto:%d)", "PS TDMA", \
WARNING: Avoid unnecessary line continuations
+ CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "Coex Table Type", \
WARNING: Avoid unnecessary line continuations
+ CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "IgnWlanAct", \
WARNING: Avoid unnecessary line continuations
+ CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", "backup ARFR1/ARFR2/RL/AMaxTime", \
WARNING: Avoid unnecessary line continuations
+ CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = 0x%x/0x%x/0x%x/0x%x", "0x430/0x434/0x42a/0x456", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x778/0x6cc/0x880[29:25]", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x948/ 0x67[5] / 0x764 / 0x76e", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x92c[1:0]/ 0x930[7:0]/0x944[1:0]", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x", "0x38[11]/0x40/0x4c[24:23]/0x64[0]", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x/ 0x%x", "0x550(bcn ctrl)/0x522", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x/ 0x%x", "0xc50(dig)/0x49c(null-drop)", \
WARNING: Avoid unnecessary line continuations
+ (u4Tmp[1] & 0xffff) + (u4Tmp[2] & 0xffff) + \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "OFDM-CCA/OFDM-FA/CCK-FA", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_OK CCK/11g/11n/11n-Agg", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d/ %d/ %d/ %d", "CRC_Err CCK/11g/11n/11n-Agg", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = 0x%x/ 0x%x/ 0x%x", "0x6c0/0x6c4/0x6c8(coexTable)", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d/ %d", "0x770(high-pri rx/tx)", \
WARNING: Avoid unnecessary line continuations
+ "\r\n %-35s = %d/ %d", "0x774(low-pri rx/tx)", \
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Link: https://lore.kernel.org/r/20210518044119.2960494-7-desmondcheongzx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Desmond Cheong Zhi Xi [Tue, 18 May 2021 04:41:17 +0000 (00:41 -0400)]
Staging: rtl8723bs: add missing blank line in HalBtc8723b1Ant.c
This commit fixes the following checkpatch.pl warning:
WARNING: Missing a blank line after declarations
+ struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
+ halbtc8723b1ant_BtRssiState(2, 28, 0);
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Link: https://lore.kernel.org/r/20210518044119.2960494-6-desmondcheongzx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Desmond Cheong Zhi Xi [Tue, 18 May 2021 04:41:16 +0000 (00:41 -0400)]
Staging: rtl8723bs: fix comparison formatting in HalBtc8723b1Ant.c
This commit fixes the following checkpatch.pl warnings:
WARNING: Comparisons should place the constant on the right side of the test
+ BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE != pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN == wifiStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN == wifiStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT == wifiStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ if (BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE == wifiStatus) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) {
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) {
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus &&
WARNING: Comparisons should place the constant on the right side of the test
+ if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) {
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) {
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ ((bWifiUnderBMode) ? "11b" : ((BTC_WIFI_BW_LEGACY == wifiBw) ? "11bg" : (((BTC_WIFI_BW_HT40 == wifiBw) ? "HT40" : "HT20")))),
WARNING: Comparisons should place the constant on the right side of the test
+ ((!bWifiBusy) ? "idle" : ((BTC_WIFI_TRAFFIC_TX == wifiTrafficDir) ? "uplink" : "downlink")),
WARNING: Comparisons should place the constant on the right side of the test
+ ((pBtCoexist->btInfo.bBtDisabled) ? ("disabled") : ((pCoexSta->bC2hBtInquiryPage) ? ("inquiry/page scan") : ((BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus) ? "non-connected idle" :
WARNING: Comparisons should place the constant on the right side of the test
+ ((BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ? "connected-idle" : "busy")))),
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_IPS_ENTER == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ } else if (BTC_IPS_LEAVE == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_LPS_ENABLE == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ } else if (BTC_LPS_DISABLE == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_SCAN_START == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_SCAN_START == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ } else if (BTC_SCAN_FINISH == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_ASSOCIATE_START == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_ASSOCIATE_START == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ } else if (BTC_ASSOCIATE_FINISH == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_MEDIA_CONNECT == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ if ((BTC_MEDIA_CONNECT == type) && (wifiCentralChnl <= 14)) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_WIFI_BW_HT40 == wifiBw)
WARNING: Comparisons should place the constant on the right side of the test
+ BTC_PACKET_DHCP == type ||
WARNING: Comparisons should place the constant on the right side of the test
+ BTC_PACKET_EAPOL == type ||
WARNING: Comparisons should place the constant on the right side of the test
+ BTC_PACKET_ARP == type
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_PACKET_ARP == type) {
WARNING: Comparisons should place the constant on the right side of the test
+ BTC_PACKET_DHCP == type ||
WARNING: Comparisons should place the constant on the right side of the test
+ BTC_PACKET_EAPOL == type ||
WARNING: Comparisons should place the constant on the right side of the test
+ ((BTC_PACKET_ARP == type) && (pCoexSta->bWiFiIsHighPriTask))
WARNING: Comparisons should place the constant on the right side of the test
+ if (BT_INFO_SRC_8723B_1ANT_WIFI_FW != rspSource) {
WARNING: Comparisons should place the constant on the right side of the test
+ if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY != pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) ||
WARNING: Comparisons should place the constant on the right side of the test
+ (BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus)
WARNING: Comparisons should place the constant on the right side of the test
+ if (BTC_WIFI_PNP_SLEEP == pnpState) {
WARNING: Comparisons should place the constant on the right side of the test
+ } else if (BTC_WIFI_PNP_WAKE_UP == pnpState) {
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Link: https://lore.kernel.org/r/20210518044119.2960494-5-desmondcheongzx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Desmond Cheong Zhi Xi [Tue, 18 May 2021 04:41:15 +0000 (00:41 -0400)]
Staging: rtl8723bs: fix indentation in HalBtc8723b1Ant.c
This commit fixes the following checkpatch.pl errors:
WARNING: suspect code indent for conditional statements (32, 33)
+ if (nCCKLockCounter < 5)
+ nCCKLockCounter++;
WARNING: suspect code indent for conditional statements (32, 33)
+ if (nCCKLockCounter > 0)
+ nCCKLockCounter--;
WARNING: suspect code indent for conditional statements (24, 26)
+ if (nCCKLockCounter > 0)
+ nCCKLockCounter--;
WARNING: suspect code indent for conditional statements (16, 17)
+ if (nCCKLockCounter >= 5)
+ pCoexSta->bCCKLock = true;
WARNING: suspect code indent for conditional statements (16, 17)
+ else
+ pCoexSta->bCCKLock = false;
WARNING: suspect code indent for conditional statements (16, 17)
+ if (nCCKLockCounter == 0)
+ pCoexSta->bCCKLock = false;
WARNING: suspect code indent for conditional statements (16, 17)
+ else
+ pCoexSta->bCCKLock = true;
WARNING: suspect code indent for conditional statements (16, 25)
+ if (bScan || bLink || bRoam) {
+ if (bScan)
WARNING: Statements should start on a tabstop
+ if (bScan)
WARNING: Statements should start on a tabstop
+ else
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Link: https://lore.kernel.org/r/20210518044119.2960494-4-desmondcheongzx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Desmond Cheong Zhi Xi [Tue, 18 May 2021 04:41:14 +0000 (00:41 -0400)]
Staging: rtl8723bs: fix spaces in HalBtc8723b1Ant.c
This commit fixes the following checkpatch.pl errors:
WARNING: please, no space before tabs
+^I/* ^IRx Aggregation related setting */$
WARNING: please, no space before tabs
+^Iu8 ^IH2C_Parameter[1] = {0};$
WARNING: please, no space before tabs
+^Iu8 ^IH2C_Parameter[6] = {0};$
WARNING: please, no space before tabs
+^I/* u32 ^I^IfwVer = 0; */$
WARNING: please, no space before tabs
+/* ^ISoftware Coex Mechanism start */$
WARNING: please, no space before tabs
+/* ^INon-Software Coex Mechanism start */$
WARNING: please, no space before tabs
+^I/* ^IBIT0: "0" for no antenna inverse; "1" for antenna inverse */$
WARNING: please, no space before tabs
+^I/* ^IBIT1: "0" for internal switch; "1" for external switch */$
WARNING: please, no space before tabs
+^I/* ^IBIT2: "0" for one antenna; "1" for two antenna */$
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Link: https://lore.kernel.org/r/20210518044119.2960494-3-desmondcheongzx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Desmond Cheong Zhi Xi [Tue, 18 May 2021 04:41:13 +0000 (00:41 -0400)]
Staging: rtl8723bs: remove unnecessary braces in HalBtc8723b1Ant.c
This commit fixes the following checkpatch.pl warnings:
WARNING: braces {} are not necessary for any arm of this statement
+ if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (btRssi < rssiThresh) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for single statement blocks
+ if (rssiThresh > rssiThresh1) {
+ return pCoexSta->preBtRssiState;
+ }
WARNING: braces {} are not necessary for any arm of this statement
+ if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) {
[...]
+ } else if (btRssi < rssiThresh) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (btRssi < rssiThresh1) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for single statement blocks
+ if (!pBtLinkInfo->bBtLinkExist) {
+ return algorithm;
+ }
WARNING: braces {} are not necessary for any arm of this statement
+ if (bBtHsOn) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (bBtHsOn) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (bBtHsOn) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (bBtHsOn) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (bBtHsOn) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (bBtHsOn) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (bBtHsOn) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (u1Tmp & BIT0) {
[...]
+ } else {
[...]
WARNING: braces {} are not necessary for single statement blocks
+ if (pBtCoexist->bManualControl) {
+ return;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (pBtCoexist->bStopCoexDm) {
+ return;
+ }
WARNING: braces {} are not necessary for single statement blocks
+ if (pCoexSta->bUnderIps) {
+ return;
+ }
WARNING: braces {} are not necessary for any arm of this statement
+ if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage)) {
[...]
+ } else
[...]
WARNING: braces {} are not necessary for any arm of this statement
+ if (BTC_LPS_ENABLE == type) {
[...]
+ } else if (BTC_LPS_DISABLE == type) {
[...]
WARNING: braces {} are not necessary for single statement blocks
+ if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) {
+ halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false);
+ }
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Desmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Link: https://lore.kernel.org/r/20210518044119.2960494-2-desmondcheongzx@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Sun, 16 May 2021 10:30:09 +0000 (12:30 +0200)]
staging: rtl8188eu: rename struct field bLedOn
Rename field bLedOn of struct LED_871x to avoid camel case.
bLedOn -> led_on
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210516103009.7184-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shreyansh Chouhan [Sat, 15 May 2021 08:14:46 +0000 (13:44 +0530)]
staging: rtl8723bs: fix coding style for if comparisions
Placed constants on the right side of the equality tests in rtw_xmit.c
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Link: https://lore.kernel.org/r/20210515081446.676500-1-chouhan.shreyansh630@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cláudio Maia [Fri, 14 May 2021 23:04:59 +0000 (00:04 +0100)]
staging: rtl8192u: Fix variable shadowing warning
Fixes the following sparse warnings:
drivers/staging/rtl8192u/r8192U_core.c:2306:21: warning: symbol 'i' shadows an earlier one
drivers/staging/rtl8192u/r8192U_core.c:2254:13: originally declared here
drivers/staging/rtl8192u/r8192U_core.c:2371:29: warning: symbol 'i' shadows an earlier one
drivers/staging/rtl8192u/r8192U_core.c:2254:13: originally declared here
Signed-off-by: Cláudio Maia <clrrm@isep.ipp.pt>
Link: https://lore.kernel.org/r/20210514230459.15752-1-clrrm@isep.ipp.pt
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Guenter Roeck [Fri, 14 May 2021 16:55:57 +0000 (09:55 -0700)]
staging: rtl8188eu: Drop unnecessary NULL check after container_of
The result of container_of() operations is never NULL unless the extracted
element is the first element of the embedded structure. This is not the
case here. The NULL check is therefore unnecessary and misleading.
Remove it.
This change was made automatically with the following Coccinelle script.
@@
type t;
identifier v;
statement s;
@@
<+...
(
t v = container_of(...);
|
v = container_of(...);
)
...
when != v
- if (\( !v \| v == NULL \) ) s
...+>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210514165557.1384106-1-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Fri, 14 May 2021 14:26:53 +0000 (17:26 +0300)]
staging: rtl8712: fix the bssid in mp_start_test()
We recently moved "bssid" off the stack, and allocated it with kmalloc()
instead. Unfortunately, this one line was overlooked so it will copy
random data into the &tgt_network->network instead of the data we want.
Fixes:
0b18e5fe6008 ("staging: rtl8712: rtl871x_mp_ioctl: Move a large data struct onto the heap")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YJ6IrfkbdaTHgpEv@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman [Mon, 17 May 2021 07:47:44 +0000 (09:47 +0200)]
Merge 5.13-rc2 into staging-next
We need the staging and iio fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linus Torvalds [Sun, 16 May 2021 22:27:44 +0000 (15:27 -0700)]
Linux 5.13-rc2
Linus Torvalds [Sun, 16 May 2021 17:13:14 +0000 (10:13 -0700)]
Merge tag 'driver-core-5.13-rc2' of git://git./linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH:
"Here are two driver fixes for driver core changes that happened in
5.13-rc1.
The clk driver fix resolves a many-reported issue with booting some
devices, and the USB typec fix resolves the reported problem of USB
systems on some embedded boards.
Both of these have been in linux-next this week with no reported
issues"
* tag 'driver-core-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
clk: Skip clk provider registration when np is NULL
usb: typec: tcpm: Don't block probing of consumers of "connector" nodes
Linus Torvalds [Sun, 16 May 2021 17:06:19 +0000 (10:06 -0700)]
Merge tag 'staging-5.13-rc2' of git://git./linux/kernel/git/gregkh/staging
Pull staging and IIO driver fixes from Greg KH:
"Here are some small IIO driver fixes and one Staging driver fix for
5.13-rc2.
Nothing major, just some resolutions for reported problems:
- gcc-11 bogus warning fix for rtl8723bs
- iio driver tiny fixes
All of these have been in linux-next for many days with no reported
issues"
* tag 'staging-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
iio: tsl2583: Fix division by a zero lux_val
iio: core: return ENODEV if ioctl is unknown
iio: core: fix ioctl handlers removal
iio: gyro: mpu3050: Fix reported temperature value
iio: hid-sensors: select IIO_TRIGGERED_BUFFER under HID_SENSOR_IIO_TRIGGER
iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
iio: light: gp2ap002: Fix rumtime PM imbalance on error
staging: rtl8723bs: avoid bogus gcc warning
Linus Torvalds [Sun, 16 May 2021 16:55:05 +0000 (09:55 -0700)]
Merge tag 'usb-5.13-rc2' of git://git./linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here are some small USB fixes for 5.13-rc2. They consist of a number
of resolutions for reported issues:
- typec fixes for found problems
- xhci fixes and quirk additions
- dwc3 driver fixes
- minor fixes found by Coverity
- cdc-wdm fixes for reported problems
All of these have been in linux-next for a few days with no reported
issues"
* tag 'usb-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (28 commits)
usb: core: hub: fix race condition about TRSMRCY of resume
usb: typec: tcpm: Fix SINK_DISCOVERY current limit for Rp-default
xhci: Add reset resume quirk for AMD xhci controller.
usb: xhci: Increase timeout for HC halt
xhci: Do not use GFP_KERNEL in (potentially) atomic context
xhci: Fix giving back cancelled URBs even if halted endpoint can't reset
xhci-pci: Allow host runtime PM as default for Intel Alder Lake xHCI
usb: musb: Fix an error message
usb: typec: tcpm: Fix wrong handling for Not_Supported in VDM AMS
usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work
usb: typec: ucsi: Retrieve all the PDOs instead of just the first 4
usb: fotg210-hcd: Fix an error message
docs: usb: function: Modify path name
usb: dwc3: omap: improve extcon initialization
usb: typec: ucsi: Put fwnode in any case during ->probe()
usb: typec: tcpm: Fix wrong handling in GET_SINK_CAP
usb: dwc2: Remove obsolete MODULE_ constants from platform.c
usb: dwc3: imx8mp: fix error return code in dwc3_imx8mp_probe()
usb: dwc3: imx8mp: detect dwc3 core node via compatible string
usb: dwc3: gadget: Return success always for kick transfer in ep queue
...
Linus Torvalds [Sun, 16 May 2021 16:42:13 +0000 (09:42 -0700)]
Merge tag 'timers-urgent-2021-05-16' of git://git./linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner:
"Two fixes for timers:
- Use the ALARM feature check in the alarmtimer core code insted of
the old method of checking for the set_alarm() callback.
Drivers can have that callback set but the feature bit cleared. If
such a RTC device is selected then alarms wont work.
- Use a proper define to let the preprocessor check whether Hyper-V
VDSO clocksource should be active.
The code used a constant in an enum with #ifdef, which evaluates to
always false and disabled the clocksource for VDSO"
* tag 'timers-urgent-2021-05-16' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
alarmtimer: Check RTC features instead of ops
Linus Torvalds [Sun, 16 May 2021 16:39:04 +0000 (09:39 -0700)]
Merge tag 'for-linus-5.13b-rc2-tag' of git://git./linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross:
- two patches for error path fixes
- a small series for fixing a regression with swiotlb with Xen on Arm
* tag 'for-linus-5.13b-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/swiotlb: check if the swiotlb has already been initialized
arm64: do not set SWIOTLB_NO_FORCE when swiotlb is required
xen/arm: move xen_swiotlb_detect to arm/swiotlb-xen.h
xen/unpopulated-alloc: fix error return code in fill_list()
xen/gntdev: fix gntdev_mmap() error exit path
Linus Torvalds [Sun, 16 May 2021 16:31:06 +0000 (09:31 -0700)]
Merge tag 'x86_urgent_for_v5.13_rc2' of git://git./linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov:
"The three SEV commits are not really urgent material. But we figured
since getting them in now will avoid a huge amount of conflicts
between future SEV changes touching tip, the kvm and probably other
trees, sending them to you now would be best.
The idea is that the tip, kvm etc branches for 5.14 will all base
ontop of -rc2 and thus everything will be peachy. What is more, those
changes are purely mechanical and defines movement so they should be
fine to go now (famous last words).
Summary:
- Enable -Wundef for the compressed kernel build stage
- Reorganize SEV code to streamline and simplify future development"
* tag 'x86_urgent_for_v5.13_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/boot/compressed: Enable -Wundef
x86/msr: Rename MSR_K8_SYSCFG to MSR_AMD64_SYSCFG
x86/sev: Move GHCB MSR protocol and NAE definitions in a common header
x86/sev-es: Rename sev-es.{ch} to sev.{ch}
Linus Torvalds [Sat, 15 May 2021 23:39:45 +0000 (16:39 -0700)]
Merge tag 'powerpc-5.13-3' of git://git./linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman:
- Fix a regression in the conversion of the 64-bit BookE interrupt
entry to C.
- Fix KVM hosts running with the hash MMU since the recent KVM gfn
changes.
- Fix a deadlock in our paravirt spinlocks when hcall tracing is
enabled.
- Several fixes for oopses in our runtime code patching for security
mitigations.
- A couple of minor fixes for the recent conversion of 32-bit interrupt
entry/exit to C.
- Fix __get_user() causing spurious crashes in sigreturn due to a bad
inline asm constraint, spotted with GCC 11.
- A fix for the way we track IRQ masking state vs NMI interrupts when
using the new scv system call entry path.
- A couple more minor fixes.
Thanks to Cédric Le Goater, Christian Zigotzky, Christophe Leroy,
Naveen N. Rao, Nicholas Piggin Paul Menzel, and Sean Christopherson.
* tag 'powerpc-5.13-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/64e/interrupt: Fix nvgprs being clobbered
powerpc/64s: Make NMI record implicitly soft-masked code as irqs disabled
powerpc/64s: Fix stf mitigation patching w/strict RWX & hash
powerpc/64s: Fix entry flush patching w/strict RWX & hash
powerpc/64s: Fix crashes when toggling entry flush barrier
powerpc/64s: Fix crashes when toggling stf barrier
KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU
powerpc/legacy_serial: Fix UBSAN: array-index-out-of-bounds
powerpc/signal: Fix possible build failure with unsafe_copy_fpr_{to/from}_user
powerpc/uaccess: Fix __get_user() with CONFIG_CC_HAS_ASM_GOTO_OUTPUT
powerpc/pseries: warn if recursing into the hcall tracing code
powerpc/pseries: use notrace hcall variant for H_CEDE idle
powerpc/pseries: Don't trace hcall tracing wrapper
powerpc/pseries: Fix hcall tracing recursion in pv queued spinlocks
powerpc/syscall: Calling kuap_save_and_lock() is wrong
powerpc/interrupts: Fix kuep_unlock() call
Linus Torvalds [Sat, 15 May 2021 17:24:48 +0000 (10:24 -0700)]
Merge tag 'sched-urgent-2021-05-15' of git://git./linux/kernel/git/tip/tip
Pull scheduler fixes from Ingo Molnar:
"Fix an idle CPU selection bug, and an AMD Ryzen maximum frequency
enumeration bug"
* tag 'sched-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86, sched: Fix the AMD CPPC maximum performance value on certain AMD Ryzen generations
sched/fair: Fix clearing of has_idle_cores flag in select_idle_cpu()
Linus Torvalds [Sat, 15 May 2021 17:18:23 +0000 (10:18 -0700)]
Merge tag 'objtool-urgent-2021-05-15' of git://git./linux/kernel/git/tip/tip
Pull objtool fixes from Ingo Molnar:
"Fix a couple of endianness bugs that crept in"
* tag 'objtool-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool/x86: Fix elf_add_alternative() endianness
objtool: Fix elf_create_undef_symbol() endianness
Linus Torvalds [Sat, 15 May 2021 17:13:42 +0000 (10:13 -0700)]
Merge tag 'irq-urgent-2021-05-15' of git://git./linux/kernel/git/tip/tip
Pull irq fix from Ingo Molnar:
"Fix build warning on SH"
* tag 'irq-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
sh: Remove unused variable
Linus Torvalds [Sat, 15 May 2021 17:00:35 +0000 (10:00 -0700)]
Merge tag 'core-urgent-2021-05-15' of git://git./linux/kernel/git/tip/tip
Pull x86 stack randomization fix from Ingo Molnar:
"Fix an assembly constraint that affected LLVM up to version 12"
* tag 'core-urgent-2021-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
stack: Replace "o" output with "r" input constraint
Linus Torvalds [Sat, 15 May 2021 16:42:27 +0000 (09:42 -0700)]
Merge branch 'akpm' (patches from Andrew)
Merge misc fixes from Andrew Morton:
"13 patches.
Subsystems affected by this patch series: resource, squashfs, hfsplus,
modprobe, and mm (hugetlb, slub, userfaultfd, ksm, pagealloc, kasan,
pagemap, and ioremap)"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm/ioremap: fix iomap_max_page_shift
docs: admin-guide: update description for kernel.modprobe sysctl
hfsplus: prevent corruption in shrinking truncate
mm/filemap: fix readahead return types
kasan: fix unit tests with CONFIG_UBSAN_LOCAL_BOUNDS enabled
mm: fix struct page layout on 32-bit systems
ksm: revert "use GET_KSM_PAGE_NOLOCK to get ksm page in remove_rmap_item_from_tree()"
userfaultfd: release page in error path to avoid BUG_ON
squashfs: fix divide error in calculate_skip()
kernel/resource: fix return code check in __request_free_mem_region
mm, slub: move slub_debug static key enabling outside slab_mutex
mm/hugetlb: fix cow where page writtable in child
mm/hugetlb: fix F_SEAL_FUTURE_WRITE
Linus Torvalds [Sat, 15 May 2021 16:01:45 +0000 (09:01 -0700)]
Merge tag 'arc-5.13-rc2' of git://git./linux/kernel/git/vgupta/arc
Pull ARC fixes from Vineet Gupta:
- PAE fixes
- syscall num check off-by-one bug
- misc fixes
* tag 'arc-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
ARC: mm: Use max_high_pfn as a HIGHMEM zone border
ARC: mm: PAE: use 40-bit physical page mask
ARC: entry: fix off-by-one error in syscall number validation
ARC: kgdb: add 'fallthrough' to prevent a warning
arc: Fix typos/spellos
Linus Torvalds [Sat, 15 May 2021 15:52:30 +0000 (08:52 -0700)]
Merge tag 'block-5.13-2021-05-14' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
- Fix for shared tag set exit (Bart)
- Correct ioctl range for zoned ioctls (Damien)
- Removed dead/unused function (Lin)
- Fix perf regression for shared tags (Ming)
- Fix out-of-bounds issue with kyber and preemption (Omar)
- BFQ merge fix (Paolo)
- Two error handling fixes for nbd (Sun)
- Fix weight update in blk-iocost (Tejun)
- NVMe pull request (Christoph):
- correct the check for using the inline bio in nvmet (Chaitanya
Kulkarni)
- demote unsupported command warnings (Chaitanya Kulkarni)
- fix corruption due to double initializing ANA state (me, Hou Pu)
- reset ns->file when open fails (Daniel Wagner)
- fix a NULL deref when SEND is completed with error in nvmet-rdma
(Michal Kalderon)
- Fix kernel-doc warning (Bart)
* tag 'block-5.13-2021-05-14' of git://git.kernel.dk/linux-block:
block/partitions/efi.c: Fix the efi_partition() kernel-doc header
blk-mq: Swap two calls in blk_mq_exit_queue()
blk-mq: plug request for shared sbitmap
nvmet: use new ana_log_size instead the old one
nvmet: seset ns->file when open fails
nbd: share nbd_put and return by goto put_nbd
nbd: Fix NULL pointer in flush_workqueue
blkdev.h: remove unused codes blk_account_rq
block, bfq: avoid circular stable merges
blk-iocost: fix weight updates of inner active iocgs
nvmet: demote fabrics cmd parse err msg to debug
nvmet: use helper to remove the duplicate code
nvmet: demote discovery cmd parse err msg to debug
nvmet-rdma: Fix NULL deref when SEND is completed with error
nvmet: fix inline bio check for passthru
nvmet: fix inline bio check for bdev-ns
nvme-multipath: fix double initialization of ANA state
kyber: fix out of bounds access when preempted
block: uapi: fix comment about block device ioctl
Linus Torvalds [Sat, 15 May 2021 15:43:44 +0000 (08:43 -0700)]
Merge tag 'io_uring-5.13-2021-05-14' of git://git.kernel.dk/linux-block
Pull io_uring fixes from Jens Axboe:
"Just a few minor fixes/changes:
- Fix issue with double free race for linked timeout completions
- Fix reference issue with timeouts
- Remove last few places that make SQPOLL special, since it's just an
io thread now.
- Bump maximum allowed registered buffers, as we don't allocate as
much anymore"
* tag 'io_uring-5.13-2021-05-14' of git://git.kernel.dk/linux-block:
io_uring: increase max number of reg buffers
io_uring: further remove sqpoll limits on opcodes
io_uring: fix ltout double free on completion race
io_uring: fix link timeout refs
Linus Torvalds [Sat, 15 May 2021 15:37:21 +0000 (08:37 -0700)]
Merge tag 'erofs-for-5.13-rc2-fixes' of git://git./linux/kernel/git/xiang/erofs
Pull erofs fixes from Gao Xiang:
"This mainly fixes 1 lcluster-sized pclusters for the big pcluster
feature, which can be forcely generated by mkfs as a specific on-disk
case for per-(sub)file compression strategies but missed to handle in
runtime properly.
Also, documentation updates are included to fix the broken
illustration due to the ReST conversion by accident and complete the
big pcluster introduction.
Summary:
- update documentation to fix the broken illustration due to ReST
conversion by accident at that time and complete the big pcluster
introduction
- fix 1 lcluster-sized pclusters for the big pcluster feature"
* tag 'erofs-for-5.13-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
erofs: fix 1 lcluster-sized pcluster for big pcluster
erofs: update documentation about data compression
erofs: fix broken illustration in documentation
Linus Torvalds [Sat, 15 May 2021 15:32:51 +0000 (08:32 -0700)]
Merge tag 'libnvdimm-fixes-5.13-rc2' of git://git./linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm fixes from Dan Williams:
"A regression fix for a bootup crash condition introduced in this merge
window and some other minor fixups:
- Fix regression in ACPI NFIT table handling leading to crashes and
driver load failures.
- Move the nvdimm mailing list
- Miscellaneous minor fixups"
* tag 'libnvdimm-fixes-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
ACPI: NFIT: Fix support for variable 'SPA' structure size
MAINTAINERS: Move nvdimm mailing list
tools/testing/nvdimm: Make symbol '__nfit_test_ioremap' static
libnvdimm: Remove duplicate struct declaration
Linus Torvalds [Sat, 15 May 2021 15:28:08 +0000 (08:28 -0700)]
Merge tag 'dax-fixes-5.13-rc2' of git://git./linux/kernel/git/nvdimm/nvdimm
Pull dax fixes from Dan Williams:
"A fix for a hang condition due to missed wakeups in the filesystem-dax
core when exercised by virtiofs.
This bug has been there from the beginning, but the condition has
not triggered on other filesystems since they hold a lock over
invalidation events"
* tag 'dax-fixes-5.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
dax: Wake up all waiters after invalidating dax entry
dax: Add a wakeup mode parameter to put_unlocked_entry()
dax: Add an enum for specifying dax wakup mode
Linus Torvalds [Sat, 15 May 2021 15:18:29 +0000 (08:18 -0700)]
Merge tag 'drm-fixes-2021-05-15' of git://anongit.freedesktop.org/drm/drm
Pull more drm fixes from Dave Airlie:
"Looks like I wasn't the only one not fully switched on this week. The
msm pull has a missing tag so I missed it, and i915 team were a bit
late. In my defence I did have a day with the roof of my home office
removed, so was sitting at my kids desk.
msm:
- dsi regression fix
- dma-buf pinning fix
- displayport fixes
- llc fix
i915:
- Fix active callback alignment annotations and subsequent crashes
- Retract link training strategy to slow and wide, again
- Avoid division by zero on gen2
- Use correct width reads for C0DRB3/C1DRB3 registers
- Fix double free in pdp allocation failure path
- Fix HDMI 2.1 PCON downstream caps check"
* tag 'drm-fixes-2021-05-15' of git://anongit.freedesktop.org/drm/drm:
drm/i915: Use correct downstream caps for check Src-Ctl mode for PCON
drm/i915/overlay: Fix active retire callback alignment
drm/i915: Fix crash in auto_retire
drm/i915/gt: Fix a double free in gen8_preallocate_top_level_pdp
drm/i915: Read C0DRB3/C1DRB3 as 16 bits again
drm/i915: Avoid div-by-zero on gen2
drm/i915/dp: Use slow and wide link training for everything
drm/msm/dp: initialize audio_comp when audio starts
drm/msm/dp: check sink_count before update is_connected status
drm/msm: fix minor version to indicate MSM_PARAM_SUSPENDS support
drm/msm/dsi: fix msm_dsi_phy_get_clk_provider return code
drm/msm/dsi: dsi_phy_28nm_8960: fix uninitialized variable access
drm/msm: fix LLC not being enabled for mmu500 targets
drm/msm: Do not unpin/evict exported dma-buf's
Tetsuo Handa [Sat, 15 May 2021 03:00:37 +0000 (03:00 +0000)]
tty: vt: always invoke vc->vc_sw->con_resize callback
syzbot is reporting OOB write at vga16fb_imageblit() [1], for
resize_screen() from ioctl(VT_RESIZE) returns 0 without checking whether
requested rows/columns fit the amount of memory reserved for the graphical
screen if current mode is KD_GRAPHICS.
----------
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/kd.h>
#include <linux/vt.h>
int main(int argc, char *argv[])
{
const int fd = open("/dev/char/4:1", O_RDWR);
struct vt_sizes vt = { 0x4100, 2 };
ioctl(fd, KDSETMODE, KD_GRAPHICS);
ioctl(fd, VT_RESIZE, &vt);
ioctl(fd, KDSETMODE, KD_TEXT);
return 0;
}
----------
Allow framebuffer drivers to return -EINVAL, by moving vc->vc_mode !=
KD_GRAPHICS check from resize_screen() to fbcon_resize().
Link: https://syzkaller.appspot.com/bug?extid=1f29e126cf461c4de3b3
Reported-by: syzbot <syzbot+1f29e126cf461c4de3b3@syzkaller.appspotmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: syzbot <syzbot+1f29e126cf461c4de3b3@syzkaller.appspotmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Christophe Leroy [Sat, 15 May 2021 00:27:39 +0000 (17:27 -0700)]
mm/ioremap: fix iomap_max_page_shift
iomap_max_page_shift is expected to contain a page shift, so it can't be a
'bool', has to be an 'unsigned int'
And fix the default values: P4D_SHIFT is when huge iomap is allowed.
However, on some architectures (eg: powerpc book3s/64), P4D_SHIFT is not a
constant so it can't be used to initialise a static variable. So,
initialise iomap_max_page_shift with a maximum shift supported by the
architecture, it is gated by P4D_SHIFT in vmap_try_huge_p4d() anyway.
Link: https://lkml.kernel.org/r/ad2d366015794a9f21320dcbdd0a8eb98979e9df.1620898113.git.christophe.leroy@csgroup.eu
Fixes:
bbc180a5adb0 ("mm: HUGE_VMAP arch support cleanup")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Rasmus Villemoes [Sat, 15 May 2021 00:27:36 +0000 (17:27 -0700)]
docs: admin-guide: update description for kernel.modprobe sysctl
When I added CONFIG_MODPROBE_PATH, I neglected to update Documentation/.
It's still true that this defaults to /sbin/modprobe, but now via a level
of indirection. So document that the kernel might have been built with
something other than /sbin/modprobe as the initial value.
Link: https://lkml.kernel.org/r/20210420125324.1246826-1-linux@rasmusvillemoes.dk
Fixes:
17652f4240f7a ("modules: add CONFIG_MODPROBE_PATH")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Jouni Roivas [Sat, 15 May 2021 00:27:33 +0000 (17:27 -0700)]
hfsplus: prevent corruption in shrinking truncate
I believe there are some issues introduced by commit
31651c607151
("hfsplus: avoid deadlock on file truncation")
HFS+ has extent records which always contains 8 extents. In case the
first extent record in catalog file gets full, new ones are allocated from
extents overflow file.
In case shrinking truncate happens to middle of an extent record which
locates in extents overflow file, the logic in hfsplus_file_truncate() was
changed so that call to hfs_brec_remove() is not guarded any more.
Right action would be just freeing the extents that exceed the new size
inside extent record by calling hfsplus_free_extents(), and then check if
the whole extent record should be removed. However since the guard
(blk_cnt > start) is now after the call to hfs_brec_remove(), this has
unfortunate effect that the last matching extent record is removed
unconditionally.
To reproduce this issue, create a file which has at least 10 extents, and
then perform shrinking truncate into middle of the last extent record, so
that the number of remaining extents is not under or divisible by 8. This
causes the last extent record (8 extents) to be removed totally instead of
truncating into middle of it. Thus this causes corruption, and lost data.
Fix for this is simply checking if the new truncated end is below the
start of this extent record, making it safe to remove the full extent
record. However call to hfs_brec_remove() can't be moved to it's previous
place since we're dropping ->tree_lock and it can cause a race condition
and the cached info being invalidated possibly corrupting the node data.
Another issue is related to this one. When entering into the block
(blk_cnt > start) we are not holding the ->tree_lock. We break out from
the loop not holding the lock, but hfs_find_exit() does unlock it. Not
sure if it's possible for someone else to take the lock under our feet,
but it can cause hard to debug errors and premature unlocking. Even if
there's no real risk of it, the locking should still always be kept in
balance. Thus taking the lock now just before the check.
Link: https://lkml.kernel.org/r/20210429165139.3082828-1-jouni.roivas@tuxera.com
Fixes:
31651c607151f ("hfsplus: avoid deadlock on file truncation")
Signed-off-by: Jouni Roivas <jouni.roivas@tuxera.com>
Reviewed-by: Anton Altaparmakov <anton@tuxera.com>
Cc: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Cc: Viacheslav Dubeyko <slava@dubeyko.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Matthew Wilcox (Oracle) [Sat, 15 May 2021 00:27:30 +0000 (17:27 -0700)]
mm/filemap: fix readahead return types
A readahead request will not allocate more memory than can be represented
by a size_t, even on systems that have HIGHMEM available. Change the
length functions from returning an loff_t to a size_t.
Link: https://lkml.kernel.org/r/20210510201201.1558972-1-willy@infradead.org
Fixes:
32c0a6bcaa1f57 ("btrfs: add and use readahead_batch_length")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Peter Collingbourne [Sat, 15 May 2021 00:27:27 +0000 (17:27 -0700)]
kasan: fix unit tests with CONFIG_UBSAN_LOCAL_BOUNDS enabled
These tests deliberately access these arrays out of bounds, which will
cause the dynamic local bounds checks inserted by
CONFIG_UBSAN_LOCAL_BOUNDS to fail and panic the kernel. To avoid this
problem, access the arrays via volatile pointers, which will prevent the
compiler from being able to determine the array bounds.
These accesses use volatile pointers to char (char *volatile) rather than
the more conventional pointers to volatile char (volatile char *) because
we want to prevent the compiler from making inferences about the pointer
itself (i.e. its array bounds), not the data that it refers to.
Link: https://lkml.kernel.org/r/20210507025915.1464056-1-pcc@google.com
Link: https://linux-review.googlesource.com/id/I90b1713fbfa1bf68ff895aef099ea77b98a7c3b9
Signed-off-by: Peter Collingbourne <pcc@google.com>
Tested-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: George Popescu <georgepope@android.com>
Cc: Elena Petrova <lenaptr@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Matthew Wilcox (Oracle) [Sat, 15 May 2021 00:27:24 +0000 (17:27 -0700)]
mm: fix struct page layout on 32-bit systems
32-bit architectures which expect 8-byte alignment for 8-byte integers and
need 64-bit DMA addresses (arm, mips, ppc) had their struct page
inadvertently expanded in 2019. When the dma_addr_t was added, it forced
the alignment of the union to 8 bytes, which inserted a 4 byte gap between
'flags' and the union.
Fix this by storing the dma_addr_t in one or two adjacent unsigned longs.
This restores the alignment to that of an unsigned long. We always
store the low bits in the first word to prevent the PageTail bit from
being inadvertently set on a big endian platform. If that happened,
get_user_pages_fast() racing against a page which was freed and
reallocated to the page_pool could dereference a bogus compound_head(),
which would be hard to trace back to this cause.
Link: https://lkml.kernel.org/r/20210510153211.1504886-1-willy@infradead.org
Fixes:
c25fff7171be ("mm: add dma_addr_t to struct page")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Tested-by: Matteo Croce <mcroce@linux.microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>