Vihas Makwana [Tue, 17 May 2022 14:06:26 +0000 (19:36 +0530)]
staging: r8188eu: fix warnings in rtw_wlan_util
Refactor the code to fix following warnings:
WARNING: Comparisons should place the constant on the right side of the test
CHECK: Comparison to NULL could be written "p"
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220517140626.3716-4-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Tue, 17 May 2022 14:06:25 +0000 (19:36 +0530)]
staging: r8188eu: fix warnings in rtw_pwrctrl
Refactor the code to fix following warnings:
WARNING: Comparisons should place the constant on the right side of the test
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220517140626.3716-3-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Tue, 17 May 2022 14:06:24 +0000 (19:36 +0530)]
staging: r8188eu: fix warnings in rtw_p2p
Refactor the code to fix following warning:
WARNING: Comparisons should place the constant on the right side of the test
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220517140626.3716-2-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wang Cheng [Mon, 16 May 2022 09:22:41 +0000 (17:22 +0800)]
staging: rtl8712: fix uninit-value in r871xu_drv_init()
When 'tmpU1b' returns from r8712_read8(padapter, EE_9346CR) is 0,
'mac[6]' will not be initialized.
BUG: KMSAN: uninit-value in r871xu_drv_init+0x2d54/0x3070 drivers/staging/rtl8712/usb_intf.c:541
r871xu_drv_init+0x2d54/0x3070 drivers/staging/rtl8712/usb_intf.c:541
usb_probe_interface+0xf19/0x1600 drivers/usb/core/driver.c:396
really_probe+0x653/0x14b0 drivers/base/dd.c:596
__driver_probe_device+0x3e9/0x530 drivers/base/dd.c:752
driver_probe_device drivers/base/dd.c:782 [inline]
__device_attach_driver+0x79f/0x1120 drivers/base/dd.c:899
bus_for_each_drv+0x2d6/0x3f0 drivers/base/bus.c:427
__device_attach+0x593/0x8e0 drivers/base/dd.c:970
device_initial_probe+0x4a/0x60 drivers/base/dd.c:1017
bus_probe_device+0x17b/0x3e0 drivers/base/bus.c:487
device_add+0x1fff/0x26e0 drivers/base/core.c:3405
usb_set_configuration+0x37e9/0x3ed0 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0x13c/0x300 drivers/usb/core/generic.c:238
usb_probe_device+0x309/0x570 drivers/usb/core/driver.c:293
really_probe+0x653/0x14b0 drivers/base/dd.c:596
__driver_probe_device+0x3e9/0x530 drivers/base/dd.c:752
driver_probe_device drivers/base/dd.c:782 [inline]
__device_attach_driver+0x79f/0x1120 drivers/base/dd.c:899
bus_for_each_drv+0x2d6/0x3f0 drivers/base/bus.c:427
__device_attach+0x593/0x8e0 drivers/base/dd.c:970
device_initial_probe+0x4a/0x60 drivers/base/dd.c:1017
bus_probe_device+0x17b/0x3e0 drivers/base/bus.c:487
device_add+0x1fff/0x26e0 drivers/base/core.c:3405
usb_new_device+0x1b8e/0x2950 drivers/usb/core/hub.c:2566
hub_port_connect drivers/usb/core/hub.c:5358 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5502 [inline]
port_event drivers/usb/core/hub.c:5660 [inline]
hub_event+0x58e3/0x89e0 drivers/usb/core/hub.c:5742
process_one_work+0xdb6/0x1820 kernel/workqueue.c:2307
worker_thread+0x10b3/0x21e0 kernel/workqueue.c:2454
kthread+0x3c7/0x500 kernel/kthread.c:377
ret_from_fork+0x1f/0x30
Local variable mac created at:
r871xu_drv_init+0x1771/0x3070 drivers/staging/rtl8712/usb_intf.c:394
usb_probe_interface+0xf19/0x1600 drivers/usb/core/driver.c:396
KMSAN: uninit-value in r871xu_drv_init
https://syzkaller.appspot.com/bug?id=
3cd92b1d85428b128503bfa7a250294c9ae00bd8
Reported-by: <syzbot+6f5ecd144854c0d8580b@syzkaller.appspotmail.com>
Tested-by: <syzbot+6f5ecd144854c0d8580b@syzkaller.appspotmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Wang Cheng <wanngchenng@gmail.com>
Link: https://lore.kernel.org/r/14c3886173dfa4597f0704547c414cfdbcd11d16.1652618244.git.wanngchenng@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wang Cheng [Mon, 16 May 2022 09:22:23 +0000 (17:22 +0800)]
staging: rtl8712: fix uninit-value in usb_read8() and friends
When r8712_usbctrl_vendorreq() returns negative, 'data' in
usb_read{8,16,32} will not be initialized.
BUG: KMSAN: uninit-value in string_nocheck lib/vsprintf.c:643 [inline]
BUG: KMSAN: uninit-value in string+0x4ec/0x6f0 lib/vsprintf.c:725
string_nocheck lib/vsprintf.c:643 [inline]
string+0x4ec/0x6f0 lib/vsprintf.c:725
vsnprintf+0x2222/0x3650 lib/vsprintf.c:2806
va_format lib/vsprintf.c:1704 [inline]
pointer+0x18e6/0x1f70 lib/vsprintf.c:2443
vsnprintf+0x1a9b/0x3650 lib/vsprintf.c:2810
vprintk_store+0x537/0x2150 kernel/printk/printk.c:2158
vprintk_emit+0x28b/0xab0 kernel/printk/printk.c:2256
dev_vprintk_emit+0x5ef/0x6d0 drivers/base/core.c:4604
dev_printk_emit+0x1dd/0x21f drivers/base/core.c:4615
__dev_printk+0x3be/0x440 drivers/base/core.c:4627
_dev_info+0x1ea/0x22f drivers/base/core.c:4673
r871xu_drv_init+0x1929/0x3070 drivers/staging/rtl8712/usb_intf.c:401
usb_probe_interface+0xf19/0x1600 drivers/usb/core/driver.c:396
really_probe+0x6c7/0x1350 drivers/base/dd.c:621
__driver_probe_device+0x3e9/0x530 drivers/base/dd.c:752
driver_probe_device drivers/base/dd.c:782 [inline]
__device_attach_driver+0x79f/0x1120 drivers/base/dd.c:899
bus_for_each_drv+0x2d6/0x3f0 drivers/base/bus.c:427
__device_attach+0x593/0x8e0 drivers/base/dd.c:970
device_initial_probe+0x4a/0x60 drivers/base/dd.c:1017
bus_probe_device+0x17b/0x3e0 drivers/base/bus.c:487
device_add+0x1fff/0x26e0 drivers/base/core.c:3405
usb_set_configuration+0x37e9/0x3ed0 drivers/usb/core/message.c:2170
usb_generic_driver_probe+0x13c/0x300 drivers/usb/core/generic.c:238
usb_probe_device+0x309/0x570 drivers/usb/core/driver.c:293
really_probe+0x6c7/0x1350 drivers/base/dd.c:621
__driver_probe_device+0x3e9/0x530 drivers/base/dd.c:752
driver_probe_device drivers/base/dd.c:782 [inline]
__device_attach_driver+0x79f/0x1120 drivers/base/dd.c:899
bus_for_each_drv+0x2d6/0x3f0 drivers/base/bus.c:427
__device_attach+0x593/0x8e0 drivers/base/dd.c:970
device_initial_probe+0x4a/0x60 drivers/base/dd.c:1017
bus_probe_device+0x17b/0x3e0 drivers/base/bus.c:487
device_add+0x1fff/0x26e0 drivers/base/core.c:3405
usb_new_device+0x1b91/0x2950 drivers/usb/core/hub.c:2566
hub_port_connect drivers/usb/core/hub.c:5363 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5507 [inline]
port_event drivers/usb/core/hub.c:5665 [inline]
hub_event+0x58e3/0x89e0 drivers/usb/core/hub.c:5747
process_one_work+0xdb6/0x1820 kernel/workqueue.c:2289
worker_thread+0x10d0/0x2240 kernel/workqueue.c:2436
kthread+0x3c7/0x500 kernel/kthread.c:376
ret_from_fork+0x1f/0x30
Local variable data created at:
usb_read8+0x5d/0x130 drivers/staging/rtl8712/usb_ops.c:33
r8712_read8+0xa5/0xd0 drivers/staging/rtl8712/rtl8712_io.c:29
KMSAN: uninit-value in r871xu_drv_init
https://syzkaller.appspot.com/bug?id=
3cd92b1d85428b128503bfa7a250294c9ae00bd8
Reported-by: <syzbot+6f5ecd144854c0d8580b@syzkaller.appspotmail.com>
Tested-by: <syzbot+6f5ecd144854c0d8580b@syzkaller.appspotmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Wang Cheng <wanngchenng@gmail.com>
Link: https://lore.kernel.org/r/b9b7a6ee02c02aa28054f5cf16129977775f3cd9.1652618244.git.wanngchenng@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wang Cheng [Mon, 16 May 2022 09:23:05 +0000 (17:23 +0800)]
staging: rtl8712: add error handler in r8712_usbctrl_vendorreq()
When 'status' returned from usb_control_msg() is not equal to 'len',
that usb_control_msg() is on partial failure, r8712_usbctrl_vendorreq()
will treat partial reads as success.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Wang Cheng <wanngchenng@gmail.com>
Link: https://lore.kernel.org/r/e33ea53d36c422fbe7eabec5bd9eecb0ebce1bc5.1652618244.git.wanngchenng@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Phillip Potter [Mon, 16 May 2022 22:46:40 +0000 (23:46 +0100)]
staging: r8188eu: remove _drv_ defines from include/rtw_debug.h
Remove the following defines:
_drv_always_
_drv_emerg_
_drv_alert_
_drv_crit_
_drv_err_
_drv_warning_
_drv_notice_
_drv_info_
_drv_debug_
from include/rtw_debug.h, as they are no longer used anywhere in the
driver, and are unlikely to be ever again with the removal of the old
debugging/logging code.
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20220516224640.90973-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gaston Gonzalez [Mon, 16 May 2022 22:17:41 +0000 (19:17 -0300)]
staging: vc04_services: remove unused macro
BITSET_CLR is not used. Remove the define.
Signed-off-by: Gaston Gonzalez <gascoar@gmail.com>
Link: https://lore.kernel.org/r/20220516221741.1015814-1-gascoar@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haowen Bai [Mon, 16 May 2022 10:22:12 +0000 (18:22 +0800)]
staging: rtl8192u: remove null check after call container_of()
container_of() will never return NULL, so remove useless code.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1652696533-18011-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haowen Bai [Mon, 16 May 2022 10:20:03 +0000 (18:20 +0800)]
staging: rtl8192e: remove null check after call container_of()
container_of() will never return NULL, so remove useless code.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1652696403-17852-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haowen Bai [Mon, 16 May 2022 10:18:41 +0000 (18:18 +0800)]
staging: ks7010: remove null check after call container_of()
container_of() will never return NULL, so remove useless code.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1652696322-17685-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Straube [Mon, 16 May 2022 05:48:30 +0000 (07:48 +0200)]
staging: r8188eu: remove HW_VAR_AC_PARAM_BE from SetHwReg8188EU()
Remove the HW_VAR_AC_PARAM_BE case from SetHwReg8188EU() and move the
functionality to the place where SetHwReg8188EU() is called. This is
part of the ongoing effort to get rid of the unwanted hal layer.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220516054830.8702-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 15 May 2022 15:54:01 +0000 (17:54 +0200)]
staging: r8188eu: assoc_rsp and assoc_rsp_len are not used
The assoc_rsp buffer in struct mlme_priv is not used. There's no need to
store an incoming association response after receiving an processing it.
Remove the buffer pointer and its length from struct mlme_priv.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 15 May 2022 15:54:00 +0000 (17:54 +0200)]
staging: r8188eu: last_rx_mgnt_pkts is set but not used
last_rx_mgnt_pkts in struct stainfo_stats is set but not used.
Remove it.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 15 May 2022 15:53:59 +0000 (17:53 +0200)]
staging: r8188eu: simplify error handling in recv_func_prehandle
Simplify the error handling in recv_func_prehandle. There's no need to
goto exit, this would be the next statement anyway.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 15 May 2022 15:53:58 +0000 (17:53 +0200)]
staging: r8188eu: remove obsolete comments
Remove some comments in HalPwrSeqCmd.c that contain no useful information.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 15 May 2022 15:53:57 +0000 (17:53 +0200)]
staging: r8188eu: use ieee80211 helper to check for beacon
Use the ieee80211_is_beacon helper to check if the incoming frame is a
beacon frame.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515155401.352742-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 15 May 2022 15:27:59 +0000 (17:27 +0200)]
staging: r8188eu: use defines for addba response status
Replace the numeric values with defines from ieee80211.h.
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220515152759.335889-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 14 May 2022 16:47:40 +0000 (18:47 +0200)]
staging: r8188eu: use the tid in delba processing
Extract the tid from the delba frame regardless of the recipient/initiator
setting. Use the extracted tid when we process the delba frame.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 14 May 2022 16:47:39 +0000 (18:47 +0200)]
staging: r8188eu: check for initiator vs recipient
For an incoming delba message, the code checks if the delba was sent by
the data initiator or by the data recipient.
Rewrite this check using the ieee80211 helpers, making the code easier to
understand.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 14 May 2022 16:47:38 +0000 (18:47 +0200)]
staging: r8188eu: use BIT(tid) instead of manual shift
Use BIT(tid) instead of 1 << tid when we process an addba response.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 14 May 2022 16:47:37 +0000 (18:47 +0200)]
staging: r8188eu: replace if with ternary operator
Replace an if statement with a ternary operator, making the code a tiny
bit shorter.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 14 May 2022 16:47:36 +0000 (18:47 +0200)]
staging: r8188eu: merge process_addba_req into OnAction_back
The process_addba_req function is called only by OnAction_back. Merge the
two functions.
OnAction_back has already checked that psta != NULL, we can drop the check
in process_addba_req before merging the functions. We can also simplify
the parsing of the tid by using struct ieee80211.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 14 May 2022 16:47:35 +0000 (18:47 +0200)]
staging: r8188eu: read addba resp tid from ieee80211_mgmt
Use the same code as ieee80211_process_addba_resp to calculate the tid
from the capability field of an addba response message.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sat, 14 May 2022 16:47:34 +0000 (18:47 +0200)]
staging: r8188eu: get addba resp status from ieee80211_mgmt
Read the addba response status from struct ieee80211_mgmt instead of
parsing the incoming frame ourselves.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220514164740.282552-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Soumya Negi [Fri, 13 May 2022 07:51:07 +0000 (00:51 -0700)]
staging: r8188eu: Fix block comment format
Adhere to Linux coding style. Fix the below checkpatch warning:
WARNING: Block comments should align the * on each line
Signed-off-by: Soumya Negi <soumya.negi97@gmail.com>
Link: https://lore.kernel.org/r/20220513075107.23285-1-soumya.negi97@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Soumya Negi [Fri, 13 May 2022 02:55:53 +0000 (19:55 -0700)]
staging: rtl8723bs: Fix alignment to match open parenthesis
Adhere to Linux coding style. Fixes checkpatch warnings:
CHECK: Alignment should match open parenthesis
CHECK: line length of 101 exceeds 100 columns
Signed-off-by: Soumya Negi <soumya.negi97@gmail.com>
Link: https://lore.kernel.org/r/20220513025553.13634-1-soumya.negi97@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 8 May 2022 19:30:03 +0000 (21:30 +0200)]
staging: vt6655: Replace VNSvOutPortB with iowrite8
Replace macro VNSvOutPortB with iowrite8 because it replaces
just one line.
The name of macro and the arguments use CamelCase which
is not accepted by checkpatch.pl
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/38611512677a18f63d9266cde1d20758c0feeb6e.1651957741.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 8 May 2022 19:29:58 +0000 (21:29 +0200)]
staging: vt6655: Replace MACvTransmitBCN with VNSvOutPortB
Replace macro MACvTransmitBCN with VNSvOutPortB and as it
was the only user, it can now be removed.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/698ce973d92065846a9db4339f017cd9e094706e.1651957741.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 8 May 2022 19:29:53 +0000 (21:29 +0200)]
staging: vt6655: Replace MACvStart with VNSvOutPortB
Replace macro MACvStart with VNSvOutPortB and as it
was the only user, it can now be removed.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/d998305b4dec2827b0e13e49938e68a32517c487.1651957741.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Sun, 8 May 2022 18:24:01 +0000 (23:54 +0530)]
staging: r8188eu: drop redundant if check
The check for ETH_P_IP is already performed in the outer if block
and inner if check is redundant. So drop the check.
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220508182400.22433-1-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 8 May 2022 16:14:51 +0000 (18:14 +0200)]
staging: r8188eu: read back action code from ieee80211_mgmt
Read the back action code from struct ieee80211_mgmt.
struct ieee80211_mgmt contains an "action" union. Each of its members
starts with an 8-bit action code. Treat the union as addba_req when we
read the action code although we do not yet know if it is an addba_req.
This approach is similar to ieee80211_iface_process_skb.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 8 May 2022 16:14:50 +0000 (18:14 +0200)]
staging: r8188eu: use back action codes from ieee80211.h
Use the defines from ieee80211.h for the back action codes.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 8 May 2022 16:14:49 +0000 (18:14 +0200)]
staging: r8188eu: read destination address from ieee80211_mgmt
For management frames, addr1 is the destination address (da). Read this
address from struct ieee80211_mgmt instead of calling a driver-specific
macro.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 8 May 2022 16:14:48 +0000 (18:14 +0200)]
staging: r8188eu: don't check the category in OnAction_back
Do not check the category in OnAction_back. OnAction has already checked
the category before calling OnAction_back.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Sun, 8 May 2022 16:14:47 +0000 (18:14 +0200)]
staging: r8188eu: read addr2 from ieee80211_mgmt
Define a struct ieee80211_mgmt variable in the OnAction_back function. Use
it to read addr2. For management frames, addr2 is the source address (sa).
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220508161451.115847-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Colin Ian King [Sat, 7 May 2022 18:34:14 +0000 (19:34 +0100)]
staging: rtl8192u: make const array queuetopipe const, reduces object code size
Don't populate the const array queuetopipe on the stack, instead make it
static. Also makes the object code smaller.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220507183414.26633-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:52 +0000 (22:06 +0200)]
staging: r8188eu: remove unused IEEE_* defines
The IEEE_* defines in the driver's ieee80211.h header file are not used.
Remove them.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:51 +0000 (22:06 +0200)]
staging: r8188eu: use standard category defines
Replace some of the driver-specific defines for action categories with the
defines from ieee80211.h.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:50 +0000 (22:06 +0200)]
staging: r8188eu: use ieee80211_mgmt for action category
Use the struct ieee80211_mgmt from ieee80211.h to read the action
category. There's no need to parse the incoming frame ourselves.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:49 +0000 (22:06 +0200)]
staging: r8188eu: replace OnAction_tbl with switch-case
OnAction_tbl has only three entries. It's simpler to use a switch
statement instead of iterating over the table.
We can then remove the table itself and struct action_handler, which was
used only for the table entries.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:48 +0000 (22:06 +0200)]
staging: r8188eu: remove an unused category define
RTW_WLAN_CATEGORY_TDLS is not used. Remove the define.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:47 +0000 (22:06 +0200)]
staging: r8188eu: remove action_handler string
Remove the unused str component from struct action_handler and the
corresponding entries in OnAction_tbl.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:46 +0000 (22:06 +0200)]
staging: r8188eu: remove unused action handler prototypes
For some action categories, we removed the handler function, but we forgot
the prototypes. Remove them as well.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:45 +0000 (22:06 +0200)]
staging: r8188eu: action category wmm is not used
The r8188eu driver does not handle the wmm action category. Remove the
empty handler function, the entry in OnAction_tbl and the define for the
category.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Mon, 2 May 2022 20:06:44 +0000 (22:06 +0200)]
staging: r8188eu: action category ht is not used
The r8188eu driver does not handle the ht action category. Remove the
empty handler function, the entry in OnAction_tbl and the define for the
category.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220502200652.143665-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 1 May 2022 20:25:41 +0000 (22:25 +0200)]
staging: vt6655: Replace unused return value of vt6655_get_current_tsf
Replace unused return value with u64 to increase readability,
reduce address and dereference operators and omit pqwCurrTSF that
uses CamelCase which is not accepted by checkpatch.pl
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/62c83d78627196ec0ce2f5a562cb080a1c87a05a.1651435890.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 1 May 2022 20:25:35 +0000 (22:25 +0200)]
staging: vt6655: Rename function CARDbGetCurrentTSF
The name of the function uses CamelCase which
is not accepted by checkpatch.pl
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/2b92db8d67e8dd1fc85b45efe3b32d2199371190.1651435890.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 1 May 2022 19:12:29 +0000 (21:12 +0200)]
staging: vt6655: Added missing BE support in CARDbGetCurrentTSF
Added missing big-endian support in CARDbGetCurrentTSF.
Reported-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/25c80e3eb889ef2e530f26b4a97a9f5fe88e01ab.1651431640.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 1 May 2022 19:12:23 +0000 (21:12 +0200)]
staging: vt6655: Replace VNSvInPortD with ioread32
Replace macro VNSvInPortD with ioread32 and as it was
the only user, it can now be removed.
The name of macro and the arguments use CamelCase which
is not accepted by checkpatch.pl
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/3945d32053898e5f9771d6f742ae118ca56943ce.1651431640.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Charlie Sands [Sat, 30 Apr 2022 04:28:59 +0000 (00:28 -0400)]
staging: r8188eu: Remove broken rtw_p2p_get function.
Removes broken and unsafe rtw_p2p_get function and all of the code
associated with it from the r8188eu driver.
Signed-off-by: Charlie Sands <charlies256@protonmail.com>
Link: https://lore.kernel.org/r/Ymy7C/A2q+VzfBhO@sckzor-linux.localdomain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Wed, 27 Apr 2022 16:57:49 +0000 (22:27 +0530)]
staging: r8188eu: drop redundant check in _rtw_free_mlme_priv
There's a NULL check on pmlmepriv in rtw_mlme.c:112 which makes no sense
as rtw_free_mlme_priv_ie_data() dereferences it unconditionally and it
would have already crashed at this point.
Remove this redundant check.
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220427165748.10584-1-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jaehee Park [Wed, 27 Apr 2022 15:32:03 +0000 (11:32 -0400)]
staging: r8188eu: remove unused else condition
rtw_select_and_join_from_scanned_queue() cannot return '2' so this
else condition is unused. Remove this unnecessary else statement.
Suggested-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/20220427153203.GA503502@jaehee-ThinkPad-X1-Extreme
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Wed, 27 Apr 2022 19:00:54 +0000 (00:30 +0530)]
staging: r8188eu: remove unused semaphore "allrxreturnevt"
The semaphore allrxreturnevt of struct recv_priv is initialized but not
used anywhere in the code.
Remove the initialization and the structure member.
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220427190054.17841-1-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nickalas Cason [Sat, 30 Apr 2022 23:01:39 +0000 (19:01 -0400)]
staging: greybus: correct typo in comment
Correct misspelling in comment. Issue found with checkpatch.
Signed-off-by: Nickalas Cason <nickalas@cason.dev>
Link: https://lore.kernel.org/r/20220430230139.7i772mvejlhevamn@desktop
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Andy Shevchenko [Wed, 4 May 2022 09:29:15 +0000 (12:29 +0300)]
staging: vc04_services: Re-use generic struct s32_fract
Instead of custom data type re-use generic struct s32_fract.
No changes intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220504092915.72021-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Wed, 27 Apr 2022 05:42:18 +0000 (07:42 +0200)]
staging: vt6655: Replace MACvReadISR with VNSvInPortD
Replace macro MACvReadISR with VNSvInPortD and as it was the only
user, it can now be removed.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/ddd403a3f590cb81403197442b12c3986c98ba25.1651036713.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Wed, 27 Apr 2022 05:42:13 +0000 (07:42 +0200)]
staging: vt6655: Replace MACvReadMIBCounter with VNSvInPortD
Replace macro MACvReadMIBCounter with VNSvInPortD and as it
was the only user, it can now be removed.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e1b7156e2c689cf53c738642fd9b33816ec89f92.1651036713.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Philipp Hortmann [Sun, 24 Apr 2022 07:44:05 +0000 (09:44 +0200)]
staging: vt6655: Replace VNSvInPortW with ioread16
Replace macro VNSvInPortW with ioread16.
The name of macro and the arguments use CamelCase which
is not accepted by checkpatch.pl
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/2d55e245cc530ffafe53384df03691d1b29b495c.1650784817.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Sat, 23 Apr 2022 13:01:50 +0000 (21:01 +0800)]
staging: rtl8192e: Remove u16 cast for u16 return value
Remove explicit u16 cast of the function Mk16 return value.
The variable hi does not need to be casted explicitly to u16 as it will
already be casted implicitly.
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-8-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Sat, 23 Apr 2022 13:01:49 +0000 (21:01 +0800)]
staging: rtl8192e: Remove u16 cast for u32 parameter
The explicit u16 cast is not necessary because rtl92e_eeprom_read's
second parameter is defined to be u32.
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-7-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Sat, 23 Apr 2022 13:01:48 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u16 argument cast
Remove the explicit u16 casts for u16 argument in the function call. This
function has declared its parameter to be of type u16, so the argument
given to that parameter will be automatically coerced to u16. Therefore,
an explicit cast is unnecessary.
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-6-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Sat, 23 Apr 2022 13:01:47 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u16 assignment cast
Remove the explicit casts in assignment statements for u16 variables.
Because these variables are declared as u16, there is implicit
conversion to u16 during the assignment, so an explicit cast is
unnecessary.
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-5-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Sat, 23 Apr 2022 13:01:46 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u8 cast in comparison
Since the macro VERSION_8190_BD is defined to be 0x3, and the structure
members card_8192_version and IC_Cut are both u8, an explicit u8 cast is
unnecessary.
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-4-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Sat, 23 Apr 2022 13:01:45 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u8 argument cast
Remove the unnecessary explicit u8 casts for u8 arguments in function
calls. These functions have declared their parameters to be of type u8,
so the arguments given to those parameters will be automatically coerced
to u8. Therefore, an explicit cast is unnecessary.
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-3-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Sat, 23 Apr 2022 13:01:44 +0000 (21:01 +0800)]
staging: rtl8192e: Remove unnecessary u8 assignment cast
Remove the explicit casts in assignment statements for u8 variables.
Because these variables are declared as u8, there is implicit conversion
to u8 during the assignment, so an explicit cast is unnecessary.
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220423130150.161903-2-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Fri, 22 Apr 2022 19:32:23 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_dequeue_cmd
Drop unnecessary wrapper _rtw_dequeue_cmd and move its logic to
rtw_dequeue_cmd.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-8-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Fri, 22 Apr 2022 19:32:22 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_alloc_network
Drop unnecessary wrapper _rtw_alloc_network and move its logic to
rtw_alloc_network.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-7-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Fri, 22 Apr 2022 19:32:21 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_free_mlme_priv
Drop unnecessary wrapper _rtw_free_mlme_priv and move its logic to
rtw_free_mlme_priv.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-6-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Fri, 22 Apr 2022 19:32:20 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_init_mlme_priv
Drop unnecessary wrapper _rtw_init_mlme_priv and move its logic to
rtw_init_mlme_priv.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-5-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Fri, 22 Apr 2022 19:32:19 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_init_evt_priv
Drop unnecessary wrapper _rtw_init_evt_priv and move its logic to
rtw_init_evt_priv.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-4-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Fri, 22 Apr 2022 19:32:18 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_init_cmd_priv
Drop unnecessary wrapper _rtw_init_cmd_priv and move its logic to
rtw_init_cmd_priv.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-3-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vihas Makwana [Fri, 22 Apr 2022 19:32:17 +0000 (01:02 +0530)]
staging: r8188eu: drop unnecessary wrapper _rtw_free_cmd_priv
Drop unnecessary wrapper _rtw_free_cmd_priv and move its logic to
rtw_free_cmd_priv.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-2-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vaibhav Nagare [Mon, 25 Apr 2022 13:31:11 +0000 (19:01 +0530)]
staging: greybus: tools: fix spelling
Fixed the spelling mistake of appendation to appending.
Signed-off-by: Vaibhav Nagare <vnagare@redhat.com>
Link: https://lore.kernel.org/r/20220425133111.118257-1-vnagare@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Geert Uytterhoeven [Mon, 25 Apr 2022 12:18:25 +0000 (14:18 +0200)]
staging: vc04_services: Re-add dependency on HAS_DMA to BCM2835_VCHIQ
Thanks to stubs for the NO_DMA=y case, drivers that use the DMA API can
be compile-tested on systems that do not support DMA. Hence the
dependency of BCM2835_VCHIQ on HAS_DMA was dropped to increase compile
coverage.
Unfortunately compilers became smarter, leading to new failures.
E.g. for a CONFIG_SUN3=y allmodconfig kernel with gcc 9.4.0:
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c: In function ‘free_pagelist’:
arch/m68k/include/asm/string.h:72:25: warning: argument 2 null where non-null expected [-Wnonnull]
72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:614:4: note: in expansion of macro ‘memcpy’
614 | memcpy((char *)kmap(pages[0]) +
| ^~~~~~
arch/m68k/include/asm/string.h:72:25: note: in a call to built-in function ‘__builtin_memcpy’
72 | #define memcpy(d, s, n) __builtin_memcpy(d, s, n)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:614:4: note: in expansion of macro ‘memcpy’
614 | memcpy((char *)kmap(pages[0]) +
| ^~~~~~
This happens because the compiler can trace back the source pointer to a
allocation by dma_alloc_attrs(), which always returns NULL if NO_DMA=y.
Avoid this reinstating the dependency of the BCM2835_VCHIQ symbol on
HAS_DMA, and by restricting the selection of BCM2835_VCHIQ.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/da55bd87eebf1a969dc8ccd807843319833f6c40.1650888813.git.geert@linux-m68k.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Mon, 25 Apr 2022 05:28:03 +0000 (13:28 +0800)]
Revert "staging: r8188eu: use in-kernel ieee channel"
This reverts commit
0afaa121813ed602bd203759c339cb639493f8c2 as changing
rtw_ieee80211_channel to ieee80211_channel causes a memcpy bug as
reported in:
https://lore.kernel.org/linux-staging/
67e2d10b-7f0f-9c5a-ce31-
376b83ffba9e@gmail.com/
due to their size differences.
Fixes:
0afaa121813e ("staging: r8188eu: use in-kernel ieee channel")
Reported-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220425052802.2419-1-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Adrien Thierry [Wed, 20 Apr 2022 17:44:00 +0000 (13:44 -0400)]
staging: bcm2835-audio: delete TODO
Delete TODO since all tasks were completed:
1 - fixed here:
https://lore.kernel.org/all/
20220408150359.26661-1-athierry@redhat.com/
2 - there are no remaining checkpatch.pl errors or warnings
Signed-off-by: Adrien Thierry <athierry@redhat.com>
Link: https://lore.kernel.org/r/20220420174401.305964-1-athierry@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haowen Bai [Fri, 22 Apr 2022 02:10:35 +0000 (10:10 +0800)]
staging: rtl8192u: Fix signedness bug in ieee80211_check_auth_response()
The ieee80211_check_auth_response() function has a signedness bug because
it's a declared as a u16 but it return -ENOMEM. When you look at it more
closely it returns a mix of error codes including 0xcafe, -ENOMEM, and
a->status which is WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG. This is a mess.
Clean it up to just return standard kernel error codes. We can print
out the a->status before returning a regular error code. The printks
in the caller need to be adjusted as well.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650593435-9017-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Wan Jiabing [Fri, 22 Apr 2022 02:10:38 +0000 (10:10 +0800)]
staging: r8188eu: Remove unneeded variable ret in rtw_suspend()
Fix the following coccicheck error:
drivers/staging/r8188eu/os_dep/usb_intf.c:202:5-8: Unneeded variable: "ret". Return "0" on line 242
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20220422021046.121870-1-wanjiabing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christophe JAILLET [Fri, 22 Apr 2022 06:48:18 +0000 (08:48 +0200)]
staging: fieldbus: Fix the error handling path in anybuss_host_common_probe()
If device_register() fails, device_unregister() should not be called
because it will free some resources that are not allocated.
put_device() should be used instead.
Fixes:
308ee87a2f1e ("staging: fieldbus: anybus-s: support HMS Anybus-S bus")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/5401a519608d6e1a4e7435c20f4f20b0c5c36c23.1650610082.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ran jianping [Fri, 22 Apr 2022 09:33:40 +0000 (09:33 +0000)]
staging: vchiq:remove unneeded flush_workqueue
All work currently pending will be done first by calling destroy_workqueue,
so there is no need to flush it explicitly.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ran jianping <ran.jianping@zte.com.cn>
Link: https://lore.kernel.org/r/20220422093340.2781311-1-ran.jianping@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Fri, 22 Apr 2022 14:09:58 +0000 (16:09 +0200)]
staging: r8188eu: fix the index check in mgt_dispatcher
In mgt_dispatcher, we check that index is a valid index for the
mlme_sta_tbl array. The valid indices for this array are from 0 to
ARRAY_SIZE(mlme_sta_tbl) - 1.
An invalid index is >= ARRAY_SIZE(mlme_sta_tbl). Fix the off by one error
in the check.
Fixes:
db84803cd8de ("staging: r8188eu: use ARRAY_SIZE for mlme_sta_tbl")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220422140958.239767-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bruno Moreira-Guedes [Thu, 21 Apr 2022 14:59:34 +0000 (11:59 -0300)]
staging: vme: Move 'vme/devices/' to 'vme_user/'
In <
db3b9e990e75573402cda22faf933760f076c033> ("Staging: VME: move VME
drivers out of staging") the vme code, board and bridge drivers were
moved out of the staging tree, remaining only the VME user device
driver.
Since this driver is the only one remaining in staging, such multi-level
structure confuses more than helps. The current structure is as follows:
- drivers/staging/vme/
Makefile
devices/
Kconfig
Makefile
vme_user.c
vme_user.h
The top-level Makefile has the only function of calling another Makefile
into the devices/ subdirectory. This latter only compiles the vme_user
driver, since there is no other in the staging tree.
This patch removes the unnecessary Makefile from the 'vme/' dir, move
the contents of 'vme/devices' into the 'vme/' dir, and renames it to
'vme_user/' (the driver name), allowing a straightforward understanding
of this driver's contents. Furthermore, it updates the MAINTAINERS file
to properly reflect the new paths.
Signed-off-by: Bruno Moreira-Guedes <codeagain@codeagain.dev>
Link: https://lore.kernel.org/r/2cd7de9a426c443a5ea618682d605ecfd751d798.1650544175.git.codeagain@codeagain.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bruno Moreira-Guedes [Thu, 21 Apr 2022 14:59:02 +0000 (11:59 -0300)]
staging: vme: Add VME_BUS dependency to Kconfig
The KConfig file for VME_USER ('drivers/staging/vme/devices/Kconfig')
sourced at "drivers/vme/boards/KConfig" misses a `depends on` line for
VME_BUS, which is unnoticeable for menuconfig users who aren't be able
to select it through this interface without setting the CONFIG_VME_BUS
option because it's nested on VME_BUS menu entry.
A patch to move appropriately this driver to the "Staging" submenu
([PATCH 1/3], originally sent as a single patch submitted at
https://lore.kernel.org/linux-staging/
3fbc5325e94b9ae0666a1f5a56a4e5372bfcea1d.camel@codeagain.dev/T/#t),
however, unveiled this missing `depends on` line, since it moved the
`source` line for VME_USER's KConfig to somewhere else, allowing it to
be compiled without the support for VME_BUS. While it compiles fine and
seems to initialize the driver fine (tested both as module and as built-
in), it seems to make no sense having VME_USER without VME_BUS.
This patches addresses it by adding the VME_BUS to the `depends on` line
at "drivers/staging/vme/devices/Kconfig".
Signed-off-by: Bruno Moreira-Guedes <codeagain@codeagain.dev>
Link: https://lore.kernel.org/r/00de5644d7c2f8c8878eccf86b761e0602732089.1650544175.git.codeagain@codeagain.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bruno Moreira-Guedes [Thu, 21 Apr 2022 14:58:24 +0000 (11:58 -0300)]
staging: vme: Move vme_user to staging KConfig
Currently, the VME_USER driver is in the staging tree Kconfig, unlike
other VME drivers already moved to the main portions of the kernel tree.
Its configuration is, however, nested into the VME_BUS config option,
which might be misleading.
Since the staging tree "[...] is used to hold stand-alone drivers and
filesystem that are not ready to be merged into the main portion of the
Linux kernel tree [...]"(from
https://lore.kernel.org/all/
20090320172502.GA14647@kroah.com/T/),
staging drivers should appear nested into the Main Menu -> Device
Drivers -> Staging Drivers to make sure the user don't pick it without
being fully aware of its staging status as it could be the case in
Menu -> Device Drivers -> VME bridge support (the current location).
With this change menuconfig users will clearly know this is not a driver
in the main portion of the kernel tree and decide whether to build it or
not with that clearly in mind.
This change goes into the same direction of commit
<
4b4cdf3979c32fa3d042d150f49449c74d048553> ("STAGING: Move staging
drivers back to staging-specific menu")
Signed-off-by: Bruno Moreira-Guedes <codeagain@codeagain.dev>
Link: https://lore.kernel.org/r/f6e6d1d2b02385f11848022f154007ef191181c1.1650544175.git.codeagain@codeagain.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Solomon Tan [Thu, 21 Apr 2022 23:52:38 +0000 (07:52 +0800)]
staging: r8188eu: use in-kernel ieee channel
Use the in-kernel structure and flags instead of defining a separate
one. The rtw_ieee80211_channel structure and flags can be replaced by
the ieee80211_channel defined in include/net/cfg80211.h since the flags
serve the same purpose and the ieee80211_channel struct includes the
elements used in the rtw_ieee80211_channel struct.
Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220421235237.4218-1-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jaehee Park [Thu, 21 Apr 2022 19:20:31 +0000 (15:20 -0400)]
staging: r8188eu: correct typo in comments
Correct misspellings in the comments. Issue found with checkpatch.
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/56b25e4394396823d52f1fe1b312c5a307aea0fc.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jaehee Park [Thu, 21 Apr 2022 19:20:30 +0000 (15:20 -0400)]
staging: r8188eu: replace spaces with tabs
Use tabs instead of spaces. Issue found with checkpatch.
WARNING: suspect code indent for conditional statements
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/fd4a66013be081bc5adb491c6dc7774362d1ac82.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jaehee Park [Thu, 21 Apr 2022 19:20:28 +0000 (15:20 -0400)]
staging: r8188eu: remove 'added by' author comments
Author comments "Added by Albert" and "Added by Annie" are sprinkled
through the file. These comments are not useful and can be removed.
Suggested-by: Alison Schofield <alison.schofield@intel.com>
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/dd22bbe6b018aadec620d1ef8215e19852099f7c.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jaehee Park [Thu, 21 Apr 2022 19:20:27 +0000 (15:20 -0400)]
staging: r8188eu: remove spaces before tabs
Delete spaces before tabs in the comments. Issue found with checkpatch.
WARNING: please, no space before tabs
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/1b1e8cda03ca5d3fdf26c511da76258f7a2ab8d5.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jaehee Park [Thu, 21 Apr 2022 19:20:26 +0000 (15:20 -0400)]
staging: r8188eu: remove unnecessary braces in single statement block
Remove braces for single statement block to minimize the number of
empty lines, without loss of readability. Issue found with checkpatch.
WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: Jaehee Park <jhpark1013@gmail.com>
Link: https://lore.kernel.org/r/b96ae957e2ddc519e56813a1c56e770168f67a2d.1650568579.git.jhpark1013@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Thu, 21 Apr 2022 20:08:04 +0000 (22:08 +0200)]
staging: r8188eu: remove OnAction_dls
Remove the empty function OnAction_dls and its entry in OnAction_tbl.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200805.192083-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Thu, 21 Apr 2022 20:08:03 +0000 (22:08 +0200)]
staging: r8188eu: remove OnAction_qos
Remove the empty function OnAction_qos and its entry in OnAction_tbl.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200805.192083-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Thu, 21 Apr 2022 20:08:02 +0000 (22:08 +0200)]
staging: r8188eu: on_action_spct does nothing
One of the entries in OnAction_tbl refers to on_action_spct. This function
reads some information but it performs no action. Remove on_action_spct
and its entry in OnAction_tbl.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200805.192083-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Thu, 21 Apr 2022 20:08:01 +0000 (22:08 +0200)]
staging: r8188eu: remove dummy entries from OnAction_tbl
Unlike mlme_sta_tbl, OnAction_tbl is an array of structs.
OnAction iterates over the array to find the entry for a specific action
category. No action is performed if a category has no entry.
We can remove the entries that point to the dummy function DoReserved.
These were the last users of DoReserved, the function itself can be
removed as well.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200805.192083-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Martin Kaiser [Thu, 21 Apr 2022 20:04:49 +0000 (22:04 +0200)]
staging: r8188eu: remove OnAtim
Remove the empty OnAtim function. We can set the function pointer in
mlme_sta_tbl to NULL if no action is required for this management frame
subtype.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220421200449.191983-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haowen Bai [Thu, 21 Apr 2022 08:21:17 +0000 (16:21 +0800)]
staging: rtl8192e: Fix signedness bug in rtllib_rx_assoc_resp()
The rtllib_rx_assoc_resp() function has a signedness bug because it's
a declared as a u16 but it return -ENOMEM. When you look at it more
closely it returns a mix of error codes including 0xcafe, -ENOMEM, and
a->status which is WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG. This is a mess.
Clean it up to just return standard kernel error codes. We can print
out the a->status before returning a regular error code. The printks
in the caller need to be adjusted as well.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650529277-7893-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haowen Bai [Thu, 21 Apr 2022 09:20:43 +0000 (17:20 +0800)]
staging: r8188eu: Drop redundant memset
The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy. So we drop redundant memset.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650532843-28132-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Artur Bujdoso [Thu, 21 Apr 2022 06:52:19 +0000 (08:52 +0200)]
staging: rtl8723bs: remove leftover code for other chips
Clean up unreferenced definitions in hal headers and code.
Signed-off-by: Artur Bujdoso <artur.bujdoso@gmail.com>
Link: https://lore.kernel.org/r/YmD/I19v8sJLrOQo@crux
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rebecca Mckeever [Wed, 20 Apr 2022 12:23:28 +0000 (07:23 -0500)]
staging: rtl8192u: change get_key functions to return 0 instead of -1
Currently, these three get_key functions return -1 when the provided len
value is less a specific key length value, which can result in buffer
overflow depending on how the returned value is used. These functions are
used in three places in ieee80211/ieee80211_wx.c:
ieee80211_wx_get_encode() :
The behavior of this function will be unchanged.
ieee80211_wx_get_encode_ext() :
The result of the get_key function is written to ext->key_len,
resulting in a buffer overflow if the result is negative.
ieee80211_wx_set_encode() :
The behavior of this function will change. When len is less than the
key length value, it will set a default key of all 0.
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/Yl/7QPKXer7YtXOs@bertie
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>