Staging: rtl8723bs: Change values to standard error codes in functions
Change values for standard error codes in functions rtw_init_cmd_priv and
rtw_init_evt_priv, as _SUCCESS should be 0 and _FAIL should be -ENOMEM.
Also, change the values in corresponding call sites of the functions.
Colin Ian King [Mon, 18 Mar 2019 10:57:49 +0000 (10:57 +0000)]
staging: ks7010: remove redundant auth_type check
The range check on auth_type is redundant as there is a prior
check on the auth_type values and the only way the block is entered
is if auth_type is one of TYPE_PMK1, TYPE_GMK1 and TYPE_GMK2. Hence
the auth_type check can be removed.
Detected by static analysis with cppcheck.
Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Jeremy Sowden <jeremy@azazel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bhanusree Pola [Mon, 18 Mar 2019 07:05:53 +0000 (12:35 +0530)]
Staging: rtl8192e: Remove parentheses around the right hand side of assignments
Avoid useless parentheses to the right hand side of an assignment.
Issue found using coccinelle.
The semantic patch that fixes the problem is as follows
@r2 depends on r1@
expression value,e;
constant c;
@@
(
- value = (e == c)
+ value = (e == c)
|
- value = (e <= c)
+ value = (e <= c)
|
- value = (e >= c)
+ value = (e >= c)
|
- value = (e != c)
+ value = (e != c)
)
// </smpl>
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Emanuel Bennici [Sun, 17 Mar 2019 18:31:13 +0000 (19:31 +0100)]
staging: rtl8723bs: Remove Dead Code in core/rtw_mlme.c
The Functions `void rtw_surveydone_event_callback`, `void rtw_indicate_connect`,
`void rtw_stadel_event_callback` and `void _rtw_join_timeout_handler`
are using the Macro CONFIG_INTEL_WIDI which doesn't exists anymore.
Emanuel Bennici [Sun, 17 Mar 2019 18:31:12 +0000 (19:31 +0100)]
staging: rtl8723bs: Remove Dead Functions in os_dep/ioctl_linux.c
The Functions `static int rtw_widi_set()` and
`static int rtw_widi_set_probe_request()` part of dead code due to
CONFIG_INTEL_WIDI.
The fix removes the deadcode.
Emanuel Bennici [Sun, 17 Mar 2019 18:31:11 +0000 (19:31 +0100)]
staging: rtl8723bs: Remove Dead Code in os_dep/ioctl_linux.c
Remove Dead Code in `static int rtw_wps_start`,
`struct iw_handler rtw_private_handler[]` and
`struct iw_priv_args rtw_private_args[]` since they use the Macro
CONFIG_INTEL_WIDI witch doesn't exists any more.
Emanuel Bennici [Sun, 17 Mar 2019 18:31:10 +0000 (19:31 +0100)]
staging: rtl8723bs: Remove Dead Code in os_dep/os_intfs.c
The Functions `u8 rtw_init_drv_sw` and `u8 rtw_free_drv_sw` uses the
Macro CONFIG_INTEL_WIDI witch doesn't exists anymore.
This Patch removes those redundant Code Lines.
Emanuel Bennici [Sun, 17 Mar 2019 18:31:06 +0000 (19:31 +0100)]
staging: rtl8723bs: Remove Dead Code in collect_bss_info Function
In `u8 collect_bss_info` is a ifdef-Preprocessor who checks
CONFIG_INTEL_WIDI, since this Macro doesn't exists anymore this Patch
removes the Dead Code in core/rtw_mlme_ext.c
Bhanusree Pola [Sun, 17 Mar 2019 11:01:33 +0000 (16:31 +0530)]
staging: mt7621-mmc: Fix ret.cooci warnings
Return the value directly instead of storing it in local variable err.
Remove the unused local variable err.
The semantic patch that fixes the first part of the problem is as follows
// <smpl>
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
// </smpl>
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: rtl8723bs: Change type of variables and return type
Change type of local variables 'res' and return type of functions
'rtw_init_cmd_pri' and 'rtw_init_evt_priv', as function's
return types are defined for standard error codes _SUCCESS and _FAIL.
Also, change return type of functions declarations corresponding to
change made in function definitions.
staging: rtl8723bs: Remove wrapper functions and change function names
Drop wrappers rtw_init_cmd_priv and rtw_init_evt_priv and remove their
function declarations, as their only purpose is to call other functions.
Change function names from _rtw_init_cmd_priv to
rtw_init_cmd_priv, and _rtw_init_evt_priv to rtw_init_evt_priv in
function definitions and function declarations. Also, remove externs in
function declarations rtw_init_cmd_priv and rtw_init_evt_priv, to
maintain Linux kernel coding style.
Colin Ian King [Sat, 16 Mar 2019 22:26:57 +0000 (22:26 +0000)]
staging: rtl8723bs: remove unused code
There are two final hunks of code that are only built
if SDIO_DYNAMIC_ALLOC_MEM is defined however this is never
defined and if it was the code would lead to dereferencing
an uninitialized pointer oldmem. It appears that a previous
commit 1babeb0c3e59 ("Staging: rtl8723bs: Remove dead code")
removed some of the dead code but not all of it. Clean this
up by removing the final hunks.
Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC [M] drivers/staging/rtl8712/rtl871x_ioctl_linux.o
drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1106: warning: Cannot understand *
on line 1106 - I thought it was a doc line
CC [M] drivers/staging/rtl8712/os_intfs.o
drivers/staging/rtl8712/os_intfs.c:366: warning: Cannot understand *
on line 366 - I thought it was a doc line
drivers/staging/rtl8712/os_intfs.c:434: warning: Cannot understand *
on line 434 - I thought it was a doc line
Jann Horn [Fri, 1 Mar 2019 20:11:24 +0000 (21:11 +0100)]
staging: rtl8723bs: use kernel_read() instead of open-coded version
Replace the manual call to f_op->read() under KERNEL_DS with kernel_read().
This also reduces the number of users of the legacy alias get_ds() for
KERNEL_DS.
staging: sm750fb: Remove an unnecessary local variable in a function
Remove an unnecessary local variable in sm750_format_pll_reg function
and replace its initialization directly in return type.
Issue suggested by Coccinelle using ret.cocci.
Add the SPDX GPL-2.0 license identifier to fix checkpatch.pl warning
Issue found by checkpatch.pl warning:
"WARNING: Missing or malformed SPDX-License-Identifier tag in line 1"
Wentao Cai [Wed, 13 Mar 2019 08:14:53 +0000 (01:14 -0700)]
staging: gasket: Replace macro __ATTR with __ATTR_NULL
Replace macro __ATTR with __ATTR_NULL since the former one is
unnecessary for gasket_sysfs_attr array terminator. Also silence the
checkpatch.pl warning:
WARNING:Symbolic permissions 'S_IRUGO' are not preferred. Consider using
octal
permissions '0444'.
Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown [Mon, 11 Mar 2019 23:09:37 +0000 (10:09 +1100)]
staging: mt7621-dts: update ethernet settings.
The ethernet in mt7621 is now supported by
drivers/net/ethernet/mediatek/
which provides support for the integrated switch through DSA.
This requires some devicetree changes, and particularly allows
a board dts to identify which switch ports are present.
The second CPU interface - gmac1 - doesn't work yet, so the device
tree information may not be correct. The phy (which is present on the
gnubee-pc2) can negotiate and report connection speed etc, but no
traffic flows.
The gnubee-pc1 has two network ports which are 'black' and 'blue'.
There are connected to switch ports 0 and 4 respectively.
Bhanusree Pola [Mon, 11 Mar 2019 15:41:41 +0000 (21:11 +0530)]
staging: rtl8192u: Adjust 'if' to follow Kernel coding Style
-Adjust spaces around if and the condition expression to
maintain Linux Kernel Coding style.
-Remove unnecessary braces around if-else as only single statement is executed.
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bhanusree Pola [Mon, 11 Mar 2019 15:41:40 +0000 (21:11 +0530)]
staging: rtl8192u: Remove casts on the return values of list_entry
Remove casts return values of on all occurances of list_entry.
Casts on the return values of list_entry are useless.
list_entry is a macro and already casts its return value to the type
mentioned in its second argument.
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bhanusree Pola [Mon, 11 Mar 2019 15:41:39 +0000 (21:11 +0530)]
staging: rtl8192u: Remove typedef for struct _RX_REORDER_ENTRY
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RX_REORDER_ENTRY and *PRX_REORDER_ENTRY of struct _RX_REORDER_ENTRY .
-Change Structure name _RX_REORDER_ENTRY to rx_reorder_entry to maintain Linux kernel Coding Style.
-Replace occurences of RX_REORDER_ENTRY to struct rx_reorder_entry.
-Replace occurences of PRX_REORDER_ENTRY to struct rx_reorder_entry *.
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bhanusree Pola [Mon, 11 Mar 2019 15:41:38 +0000 (21:11 +0530)]
staging: rtl8192u: Remove typedef for struct _RT_LINK_DETECT_T
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RT_LINK_DETECT_T and *PRT_LINK_DETECT_T of struct _RT_LINK_DETECT_T.
-Change Structure name _RT_LINK_DETECT_T to rt_link_detect to maintain Linux kernel Coding Style.
-Replace occurence of RT_LINK_DETECT_T to struct rt_link_detect.
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bhanusree Pola [Mon, 11 Mar 2019 15:41:37 +0000 (21:11 +0530)]
staging: rtl8192u: Remove typedef for struct _RT_POWER_SAVE_CONTROL
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs RT_POWER_SAVE_CONTROL and *PRT_POWER_SAVE_CONTROL of struct _RT_POWER_SAVE_CONTROL.
-Change Structure name _RT_POWER_SAVE_CONTROL to rt_power_save_control to maintain Linux kernel Coding Style.
-Replace occurence of _RT_POWER_SAVE_CONTROL to struct rt_power_save_control.
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bhanusree Pola [Mon, 11 Mar 2019 15:41:36 +0000 (21:11 +0530)]
staging: rtl8192u: Remove typedef for struct _IbssParms
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs IbssParms and *PIbssParms of struct _IbssParms.
-Change Structure name _IbssParms to ibss_parms to maintain Linux kernel Coding Style.
-Replace occurence of IbssParms to struct ibss_parms.
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bhanusree Pola [Mon, 11 Mar 2019 15:41:35 +0000 (21:11 +0530)]
staging: rtl8192u: Remove typedef for struct _bandwidth_autoswitch
-Avoid typedefs for structure types to maintain kernel coding style.
-Remove typedefs bandwidth_autoswitch and *pbandwidth_autoswitch of
struct _bandwidth_autoswitch.
-Change Structure name _bandwidth_autoswitch to bandwidth_autoswitch to
maintain Linux kernel Coding Style.
-Replace occurence of bandwidth_autoswitch to struct bandwidth_autoswitch.
Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Debleena Sen [Sat, 9 Mar 2019 18:53:37 +0000 (10:53 -0800)]
staging: vboxvideo: Do not return -ENOSYS
New instances of ENOSYS are errors. ENOSYS should be used for nonexistent
syscalls only. Use ENODEV instead as there should not be any other
driver for a virtual device that might share buffers with vboxvideo.
In vbox_prime.c, replace all occurrences of -ENOSYS with -ENODEV to fix
checkpatch.pl warning:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else
Signed-off-by: Debleena Sen <idebleenasen@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Nishka Dasgupta [Sun, 10 Mar 2019 18:38:36 +0000 (00:08 +0530)]
staging: sm750fb: Edit CamelCase in local variables
Edit CamelCase in local variables across 4 files:
- sm750fb/ddk750_chip.c
- sm750fb/ddk750_chip.h
- sm750fb/ddk750_dvi.c
- sm750fb/ddk750_sii164.c
to comply with the coding style. Also edit associated comments
accordingly.
Issue found with Checkpatch.
Correct SPDX-License-Identifier comment characters to silence
checkpatch.pl warning:
WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Correct SPDX-License-Identifier comment characters to silence
checkpatch.pl warning:
WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Correct SPDX-License-Identifier comment characters to silence
checkpatch.pl warning:
WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Correct SPDX-License-Identifier comment characters to silence
checkpatch.pl warning:
WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
Signed-off-by: Wentao Cai <etsai042@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add the SPDX GPL-2.0 license identifier to fix checkpatch.pl warning.
Issue found by checkpatch.pl warning:
"WARNING: Missing or malformed SPDX-License-Identifier tag in line 1"
Yifeng Li [Sun, 3 Mar 2019 16:55:31 +0000 (00:55 +0800)]
staging: sm750fb: trivial comment indention fix.
In function sm750_hw_copyarea() of sm750_accel.c, there are
some comments in ASCII graphs, describing 4 possible scenarios
of overlapping areas when copying an area. However, the graphs
have broken indention.
The entire SiliconMotion series video controllers, including
SM501, SM712 and SM750 have similar 2D engines, yet, I have
not seen a single version of it with ASCII graphs properly
formatted...
Fix the the misleading ASCII graphs. It would eliminate the
confusions and improve code readability.
Signed-off-by: Yifeng Li <tomli@tomli.me> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>