Use memdup_user_nul() helper instead of open-coding to
simplify the code.
Reported-by: Hulk Robot <hulkci@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210401103645.1558813-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix the following checkpatch warning:
ERROR: Macros with multiple statements should be enclosed
in a do - while loop
2014: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:2014:
+#define ROUND(i, d, s) \
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/0f176b08b7a49d6649ff9d5468bd912e58c1db06.1616854134.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix the following checkpatch warnings:
ERROR: Macros with complex values should be enclosed in parentheses
114: FILE: drivers/staging/rtl8723bs/include/wifi.h:114:
+#define SetToDs(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
122: FILE: drivers/staging/rtl8723bs/include/wifi.h:122:
+#define SetFrDs(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
132: FILE: drivers/staging/rtl8723bs/include/wifi.h:132:
+#define SetMFrag(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
137: FILE: drivers/staging/rtl8723bs/include/wifi.h:137:
+#define ClearMFrag(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
145: FILE: drivers/staging/rtl8723bs/include/wifi.h:145:
+#define ClearRetry(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
148: FILE: drivers/staging/rtl8723bs/include/wifi.h:148:
+#define SetPwrMgt(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
153: FILE: drivers/staging/rtl8723bs/include/wifi.h:153:
+#define ClearPwrMgt(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
156: FILE: drivers/staging/rtl8723bs/include/wifi.h:156:
+#define SetMData(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
161: FILE: drivers/staging/rtl8723bs/include/wifi.h:161:
+#define ClearMData(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
164: FILE: drivers/staging/rtl8723bs/include/wifi.h:164:
+#define SetPrivacy(pbuf) \
--
ERROR: Macros with complex values should be enclosed in parentheses
220: FILE: drivers/staging/rtl8723bs/include/wifi.h:220:
+#define SetDuration(pbuf, dur) \
--
ERROR: Macros with complex values should be enclosed in parentheses
224: FILE: drivers/staging/rtl8723bs/include/wifi.h:224:
+#define SetPriority(pbuf, tid) \
--
ERROR: Macros with complex values should be enclosed in parentheses
229: FILE: drivers/staging/rtl8723bs/include/wifi.h:229:
+#define SetEOSP(pbuf, eosp) \
--
ERROR: Macros with complex values should be enclosed in parentheses
232: FILE: drivers/staging/rtl8723bs/include/wifi.h:232:
+#define SetAckpolicy(pbuf, ack) \
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/99d3e605501c1792035e7403d6da86243e6b48cb.1616854134.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix the following checkpatch warning:
ERROR: Macros with complex values should be enclosed in parentheses
49: FILE: drivers/staging/rtl8723bs/include/hal_data.h:49:
+#define CHANNEL_MAX_NUMBER
14+24+21 /* 14 is the max channel number */
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/22c4bc695d3600fcaec18949c7521fa38aa4f4a0.1616854134.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove two 'no-op' macros, as well as two related unreferenced macros,
in the staging/rtl8723bs driver.
Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210326174145.19427-2-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Variable btRssiState in halbtc8723b1ant_ActionWifiConnectedBtAclBusy()
is set but never read. Removing it.
Removing this warning:
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c:2093:5: warning: variable ‘btRssiState’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Edmundo Carmona Antoranz <eantoranz@gmail.com>
Link: https://lore.kernel.org/r/20210327001736.180881-3-eantoranz@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Inside sd_int_dpc(), variable report is set but it's never read.
Getting rid of it.
Removing this warning:
drivers/staging/rtl8723bs/hal/sdio_ops.c:946:30: warning: variable ‘report’ set but not used [-Wunused-but-set-variable]
Signed-off-by: Edmundo Carmona Antoranz <eantoranz@gmail.com>
Link: https://lore.kernel.org/r/20210327001736.180881-4-eantoranz@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
When NETLOGIC_XLR_NET is enabled, and NETDEVICES is
disabled, Kbuild gives the following warning:
WARNING: unmet direct dependencies detected for PHYLIB
Depends on [n]: NETDEVICES [=n]
Selected by [y]:
- NETLOGIC_XLR_NET [=y] && STAGING [=y] && CPU_XLR [=y]
This is because NETLOGIC_XLR_NET selects PHYLIB
without selecting or depending on NETDEVICES,
despite PHYLIB depending on NETDEVICES.
Signed-off-by: Julian Braha <julianbraha@gmail.com>
Link: https://lore.kernel.org/r/20210326054533.48751-1-julianbraha@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix the following checkpatch warning:
ERROR: do not use assignment in if condition
2607: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2607:
+ if (0 != (ret = rtw_change_ifname(padapter, new_ifname)))
--
ERROR: do not use assignment in if condition
4239: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:4239:
+ if (!(ext = vmalloc(len)))
--
ERROR: do not use assignment in if condition
4253: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:4253:
+ if (!(ext_dbg = vmalloc(len))) {
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/98b58790ae7c791d091b301bccf67a70c41ec599.1616600897.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix the following checkpatch warning:
ERROR: do not use assignment in if condition
1440: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:1440:
+ if ((wps_ie = rtw_get_wps_ie(buf, len, NULL, &wps_ielen)))
--
ERROR: do not use assignment in if condition
2465: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2465:
+ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
--
ERROR: do not use assignment in if condition
2937: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2937:
+ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) {
--
ERROR: do not use assignment in if condition
3335: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:3335:
+ if (!(ndev = wdev_to_ndev(wdev)))
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/cc687c2ff614da3e110addd1c5cd610e3356cbd7.1616600897.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix the following checkpatch warning:
ERROR: do not use assignment in if condition
1118: FILE: drivers/staging/rtl8723bs/core/rtw_ieee80211.c:1118:
+ if ((addr = of_get_property(np, "local-mac-address", &len)) &&
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/8e784a7e1407924724c97398af8e5aeb23460612.1616600897.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the following unnecessary enum name in
include/HalPwrSeqCmd.h:
enum pwrseq_cmd_delay_unit
Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-23-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the following unnecessary enum definition in
include/rtw_wifi_regd.h:
enum country_code_type_t
Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210324124456.25221-16-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>