openwrt/staging/blogic.git
5 years agostaging: media: ipu3: Avoid unnecessary blank line.
Sanjana Sanikommu [Thu, 28 Mar 2019 18:06:32 +0000 (23:36 +0530)]
staging: media: ipu3: Avoid unnecessary blank line.

Remove unnecessary blank line.
Issue found using checkpatch.pl

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Initialize completions a single time during probe
George Hilliard [Wed, 27 Mar 2019 01:50:57 +0000 (19:50 -0600)]
staging: mt7621-mmc: Initialize completions a single time during probe

The module was initializing completions whenever it was going to wait on
them, and not when the completion was allocated.  This is incorrect
according to the completion docs:

    Calling init_completion() on the same completion object twice is
    most likely a bug [...]

Re-initialization is also unnecessary because the module never uses
complete_all().  Fix this by only ever initializing the completion a
single time, and log if the completions are not consumed as intended
(this is not a fatal problem, but should not go unnoticed).

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Remove obsolete Kconfig flags
George Hilliard [Wed, 27 Mar 2019 01:50:56 +0000 (19:50 -0600)]
staging: mt7621-mmc: Remove obsolete Kconfig flags

These values are not referred to anywhere else in the kernel. Card
detect is controlled by the device tree property "mediatek,cd-poll",
and there is no driver support for eMMC whatsoever.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: fix line over 80 characters warning
Anirudh Rayabharam [Tue, 26 Mar 2019 18:25:07 +0000 (23:55 +0530)]
staging: rtl8723bs: core: fix line over 80 characters warning

Shorten the expression by re-using the part that was already computed to
fix the line over 80 characters warning reported by checkpatch.pl.

Signed-off-by: Anirudh Rayabharam <anirudh.rayabharam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: emxx_udc: remove unneeded parenthesis
Emiliano Ingrassia [Mon, 25 Mar 2019 22:57:19 +0000 (23:57 +0100)]
staging: emxx_udc: remove unneeded parenthesis

Fix 5 warnings detected by checkpatch.pl about unneeded parenthesis
around conditions tests.

Signed-off-by: Emiliano Ingrassia <ingrassia.emiliano@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: use cfg80211 ssid list instead of repacking it
Adham Abozaeid [Mon, 25 Mar 2019 22:27:26 +0000 (22:27 +0000)]
staging: wilc1000: use cfg80211 ssid list instead of repacking it

Avoid repacking ssid values into struct wilc_probe_ssid, and use the
cfg80211 provided struct to pass the ssid list to wilc_scan.
With this change, struct wilc_probe_ssid, struct wilc_probe_ssid_info
and function wilc_wfi_cfg_alloc_fill_ssid will not be needed anymore.

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vc04_services: add missing __user annotations
Jasminko Dedic [Sun, 24 Mar 2019 17:17:05 +0000 (01:17 +0800)]
staging: vc04_services: add missing __user annotations

This patch fixes the following sparse warnings by adding missing __user
annotations. It also cleans up two related unnecessary casts by reuseing
casts already made a few lines up. Remaining sparse warnings are of a
different type.

vchiq_arm.c:1606:14: warning: incorrect type in assignment (different address spaces)
vchiq_arm.c:1606:14:    expected struct vchiq_queue_message *args
vchiq_arm.c:1606:14:    got void [noderef] <asn:1> *

vchiq_arm.c:1612:13: warning: incorrect type in argument 1 (different address spaces)
vchiq_arm.c:1612:13:    expected void const volatile [noderef] <asn:1> *
vchiq_arm.c:1612:13:    got unsigned int *

vchiq_arm.c:1613:13: warning: incorrect type in argument 1 (different address spaces)
vchiq_arm.c:1613:13:    expected void const volatile [noderef] <asn:1> *
vchiq_arm.c:1613:13:    got unsigned int *

vchiq_arm.c:1614:13: warning: incorrect type in argument 1 (different address spaces)
vchiq_arm.c:1614:13:    expected void const volatile [noderef] <asn:1> *
vchiq_arm.c:1614:13:    got struct vchiq_element const [noderef] <asn:1> **

vchiq_arm.c:1638:21: warning: incorrect type in argument 1 (different address spaces)
vchiq_arm.c:1638:21:    expected void const volatile [noderef] <asn:1> *
vchiq_arm.c:1638:21:    got struct vchiq_element const [noderef] <asn:1> **

Signed-off-by: Jasminko Dedic <betelge@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: Remove comparison to true
Branden Bonaby [Tue, 26 Mar 2019 17:29:30 +0000 (13:29 -0400)]
staging: rtl8712: Remove comparison to true

Remove the comparison to true in the if statement.
CHECK: Using comparison to true is error prone.

Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: remove unnecessary parentheses
Branden Bonaby [Tue, 26 Mar 2019 17:29:28 +0000 (13:29 -0400)]
staging: rtl8712: remove unnecessary parentheses

Remove unnecessary parentheses in rtl8712_xmit.c.
Reported by checkpatch.

Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8192u: Remove typedef for struct.
Sanjana Sanikommu [Tue, 26 Mar 2019 17:09:42 +0000 (22:39 +0530)]
staging: rtl8192u: Remove typedef for struct.

Challenge suggested by coccinelle.

Linux kernel coding style guidelines suggest not using typedefs for
structure.
The following Coccinelle semantic patch detects the cases for struct
type:

@tn@
identifier i;
type td;
@@

-typedef
 struct i { ... }
-td
 ;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8188eu: Get rid of custom macro, DBG_88E in kmalloc
Madhumitha Prabakaran [Tue, 26 Mar 2019 14:57:42 +0000 (09:57 -0500)]
Staging: rtl8188eu: Get rid of custom macro, DBG_88E in kmalloc

Get rid of custom macro, DBG_88E for printing message in kmalloc
in order to maintain Linux kernel coding style based on which kernel
does not print failure warning.

Issue suggested by Coccinelle.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: sm750fb: lower case to fix camelcase checkpatch warning
Jules Irenge [Mon, 25 Mar 2019 22:23:13 +0000 (22:23 +0000)]
staging: sm750fb: lower case to fix camelcase checkpatch warning

Lower case to fix CamelCase checkpatch.pl warning
"CHECK: Avoid CamelCase: <ulActualMxClk>".

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: support IO read error injection
Gao Xiang [Mon, 25 Mar 2019 03:40:09 +0000 (11:40 +0800)]
staging: erofs: support IO read error injection

Used to simulate disk IO read error for testing fatal
error tolerance.

Here are the details,
1) use bio->bi_private to indicate super_block
   for non-compressed bios since some (mainly meta)
   pages can be of the corresponding bdev inode;
2) get super_block dynamically for compressed bios,
   therefore it could not inject bios full of staging
   pages, yet it doesn't affect the normal usage.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: introduce erofs_page_is_managed()
Gao Xiang [Mon, 25 Mar 2019 03:40:08 +0000 (11:40 +0800)]
staging: erofs: introduce erofs_page_is_managed()

1) In order to clean up unnecessary
   page->mapping == MNGD_MAPPING(sbi) wrapped by #ifdefs;

2) Needed by "staging: erofs: support IO read error injection".

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: fix error handling when failed to read compresssed data
Gao Xiang [Mon, 25 Mar 2019 03:40:07 +0000 (11:40 +0800)]
staging: erofs: fix error handling when failed to read compresssed data

Complete read error handling paths for all three kinds of
compressed pages:

 1) For cache-managed pages, PG_uptodate will be checked since
    read_endio will unlock and SetPageUptodate for these pages;

 2) For inplaced pages, read_endio cannot SetPageUptodate directly
    since it should be used to mark the final decompressed data,
    PG_error will be set with page locked for IO error instead;

 3) For staging pages, PG_error is used, which is similar to
    what we do for inplaced pages.

Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Cc: <stable@vger.kernel.org> # 4.19+
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: sm750fb: Prefer using the BIT macro
Sanjana Sanikommu [Mon, 25 Mar 2019 07:44:01 +0000 (13:14 +0530)]
staging: sm750fb: Prefer using the BIT macro

Challenge suggested by coccinelle.

Replace bit shifting on 1 with the BIT(x) macro.
Coccinelle script:

@@
constant c;
@@

-(1 << c)
+BIT(c)

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: Fix indentation and spacing issues
Sammy Abed [Mon, 25 Mar 2019 03:15:03 +0000 (20:15 -0700)]
staging: rtl8723bs: include: Fix indentation and spacing issues

Replaced spaces with tabs at the beginning of lines.
Added spaces around a (+) operator.

Signed-off-by: Sammy Abed <abdlwahdsa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: ralink-gdma: ralink-gdma.c fixed line width
Dominik Adamski [Sun, 24 Mar 2019 19:20:20 +0000 (20:20 +0100)]
staging: ralink-gdma: ralink-gdma.c fixed line width

Fix checkpatch issue:
line over 80 characters

Signed-off-by: Dominik Adamski <adamski.dominik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: cleanup long line in odm.c
Michael Straube [Sun, 24 Mar 2019 17:21:51 +0000 (18:21 +0100)]
staging: rtl8188eu: cleanup long line in odm.c

Align a comment to clear a line over 80 characters
checkpatch warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: pi433: remove unnecessary calling rf69_set_mode()
Sidong Yang [Sun, 24 Mar 2019 14:54:41 +0000 (14:54 +0000)]
staging: pi433: remove unnecessary calling rf69_set_mode()

Remove unnecessary rf69_set_mode() function call when rx is waiting for
a telegram. There is waste to call rf69_set_mode() twice for becoming
standby mode.

Signed-off-by: Sidong Yang <realwakka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: ralink-gdma: Remove space after cast
Bharath Vedartham [Sun, 24 Mar 2019 10:02:35 +0000 (15:32 +0530)]
staging: ralink-gdma: Remove space after cast

This fixes the checkpatch.pl check: "No space is necessary after the
cast".

Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: ralink-gdma: Change unsigned to unsigned int
Bharath Vedartham [Sun, 24 Mar 2019 09:48:03 +0000 (15:18 +0530)]
staging: ralink-gdma: Change unsigned to unsigned int

This fixes the checkpatch.pl warning: "Prefer unsigned to unsigned int"

Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: tegra-vde: remove unnecessary boilerplate license identifier text
Jules Irenge [Mon, 25 Mar 2019 17:42:06 +0000 (17:42 +0000)]
staging: tegra-vde: remove unnecessary boilerplate license identifier text

Remove unnecessary boilerplate license identifier text.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: tegra-vde: Add SPDX GPL-2.0+ license identifier to fix checkpatch warning
Jules Irenge [Mon, 25 Mar 2019 17:42:05 +0000 (17:42 +0000)]
staging: tegra-vde: Add SPDX GPL-2.0+ license identifier to fix checkpatch warning

Add the SPDX GPL-2.0+ license identifier to fix checkpatch.pl warning
"WARNING: Missing or malformed SPDX-License-Identifier tag in line 1"

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: media: davinci_vpfe: Drop macros
Madhumitha Prabakaran [Mon, 25 Mar 2019 16:42:55 +0000 (11:42 -0500)]
Staging: media: davinci_vpfe: Drop macros

Drop macros instead use functions set_bit() and clear_bit directly.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: media: davinci_vpfe: Fix preferred form of passing a size
Madhumitha Prabakaran [Mon, 25 Mar 2019 16:53:37 +0000 (11:53 -0500)]
Staging: media: davinci_vpfe: Fix preferred form of passing a size

Fix preferred form of passing a size of a struct to improve readability
and eradicate an opportunity for a bug when the pointer variable type is
changed but the corresponding sizeof that is passed to a memory
allocator is not.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: media: zoran: Use unsigned int instead of unsigned
Vatsala Narang [Sat, 23 Mar 2019 23:20:07 +0000 (04:50 +0530)]
staging: media: zoran: Use unsigned int instead of unsigned

Replace 'unsigned' with 'unsigned int' to get rid of checkpatch warning

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: media: imx: mipi-csi2: Remove unnecessary error messages
Bhanusree Pola [Sat, 23 Mar 2019 07:51:29 +0000 (13:21 +0530)]
Staging: media: imx: mipi-csi2: Remove unnecessary error messages

The function devm_ioremap already prints error message  when there
is no enough memory.
Remove print statements that give error messages
Issue found using coccinelle
The following semantic patch is used to solve this:

<smpl>
@@
expression x;
constant char[] C;
identifier f;
@@

x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|
usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

if(x==NULL)
{
...
(
-f(C,...);
|
-f(...,C);
)
...
}
</smpl>

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6655: lines should not end with a parentheses
Vatsala Narang [Mon, 25 Mar 2019 11:27:24 +0000 (16:57 +0530)]
staging: vt6655: lines should not end with a parentheses

Adjust code to fix the style issue-lines should not end with a
parentheses

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6655: Modify comment style of SPDX License Identifier
Ganesh Biradar [Sun, 24 Mar 2019 13:06:09 +0000 (18:36 +0530)]
staging: vt6655: Modify comment style of SPDX License Identifier

Fix the comment style of SPDX license identifier based on header file
type

Signed-off-by: Ganesh Biradar <grbesd1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rts5208: correction in spelling
Payal Kshirsagar [Sun, 24 Mar 2019 03:43:42 +0000 (09:13 +0530)]
staging: rts5208: correction in spelling

Correct misspelled word.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: Fix identation issue
Vatsala Narang [Sat, 23 Mar 2019 22:09:15 +0000 (03:39 +0530)]
staging: rtl8723bs: include: Fix identation issue

Corrected the identation of switch case to get rid of checkpatch error

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: Fix a space issue
Vatsala Narang [Sat, 23 Mar 2019 22:05:14 +0000 (03:35 +0530)]
staging: rtl8723bs: include: Fix a space issue

Replace 'foo * bar' with 'foo *bar' to fix a checkpatch warning

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: Fix spelling mistake
Vatsala Narang [Sat, 23 Mar 2019 10:39:24 +0000 (16:09 +0530)]
staging: rtl8723bs: include: Fix spelling mistake

Replace negoitation with negotiation to get rid of checkpatch warning.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: Remove function rtw_alloc_network()
Nishka Dasgupta [Fri, 22 Mar 2019 14:38:26 +0000 (20:08 +0530)]
staging: rtl8723bs: Remove function rtw_alloc_network()

Remove function rtw_alloc_network() as all it does is call
_rtw_alloc_network().
Rename _rtw_alloc_network() to rtw_alloc_network().
Change references to _rtw_alloc_network() to refer to
rtw_alloc_network().
Issue first noticed while using Coccinelle and ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Remove parentheses
Nishka Dasgupta [Fri, 22 Mar 2019 14:38:25 +0000 (20:08 +0530)]
staging: rtl8723bs: core: Remove parentheses

Remove unnecessary parentheses around variables. Issue found with
Checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Change datatype from sint to int
Nishka Dasgupta [Fri, 22 Mar 2019 14:38:24 +0000 (20:08 +0530)]
staging: rtl8723bs: core: Change datatype from sint to int

Change datatype of local variable from sint to int.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging; rtl8723bs: Remove unnecessary function rtw_init_mlme_priv()
Nishka Dasgupta [Fri, 22 Mar 2019 14:38:23 +0000 (20:08 +0530)]
staging; rtl8723bs: Remove unnecessary function rtw_init_mlme_priv()

Remove function rtw_init_mlme_priv() as all it does is call
_rtw_init_mlme_priv().
Change the name of _rtw_init_mlme_priv() to rtw_init_mlme_priv() and its
return type to int.
Remove references to _rtw_init_mlme_priv() from the corresponding header
file.
Suggestion to delete return variable from rtw_init_mlme_priv() put forward
by Coccinelle using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Check for nonzero number of scatterlist entries
George Hilliard [Wed, 20 Mar 2019 22:42:05 +0000 (16:42 -0600)]
staging: mt7621-mmc: Check for nonzero number of scatterlist entries

The buffer descriptor setup loop is correct only if it is setting up at
least one bd struct.  Besides, there is an error if dma_map_sg() returns
0, which is possible and must be handled.

Additionally, remove the BUG_ON() checking sglen, which is unnecessary
because we configure DMA with that constraint during init.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Fix warning when reloading module with debug msgs enabled
George Hilliard [Wed, 20 Mar 2019 22:42:03 +0000 (16:42 -0600)]
staging: mt7621-mmc: Fix warning when reloading module with debug msgs enabled

The kernel complained:

    [  510.277151] WARNING: CPU: 0 PID: 395 at fs/proc/generic.c:360 proc_register+0xf0/0x108
    [  510.292891] proc_dir_entry '/proc/msdc_debug' already registered

when doing a modprobe/rmmod/modprobe of this module if debug messages
are compiled in.  Fix this by removing the proc entry when the module is
unloaded.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: Use !x or x in place of NULL comparision
Bhanusree Pola [Fri, 22 Mar 2019 02:38:16 +0000 (10:38 +0800)]
staging: erofs: Use !x or x in place of NULL comparision

Test for NULL as !x instead of NULL comparisions.
Issue found using coccinelle
Semantic patch used to solve the problem is as follows

// <smpl>
@@
expression x;
statement S;
@@

x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|
usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

-if(x==NULL)
+if(!x)
S

@@
expression e;
@@

-e == NULL
+!e
// </smpl>

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
[ Gao Xiang: fix x != NULL comparision to x as well. ]
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: remove unnecessary parentheses
Michael Straube [Fri, 22 Mar 2019 13:17:06 +0000 (14:17 +0100)]
staging: rtl8188eu: remove unnecessary parentheses

Remove unnecessary parentheses in rtl8188eu_xmit.c.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Remove return variables in rtw_mlme_ext.c
Nishka Dasgupta [Thu, 21 Mar 2019 20:13:56 +0000 (01:43 +0530)]
staging: rtl8723bs: core: Remove return variables in rtw_mlme_ext.c

Remove unnecessary local return variables in rtw_mlme_ext.c. Issue found
with Coccinelle using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Change NULL comparisons to Boolean negation
Nishka Dasgupta [Thu, 21 Mar 2019 20:13:54 +0000 (01:43 +0530)]
staging: rtl8723bs: core: Change NULL comparisons to Boolean negation

Change NULL comparisons to Boolean negations. Issue found with
Coccinelle using matchnull.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: Remove return variables from wilc_spi.c
Nishka Dasgupta [Thu, 21 Mar 2019 19:55:56 +0000 (01:25 +0530)]
staging: wilc1000: Remove return variables from wilc_spi.c

Remove return variables from wilc_spi.c. Issue found with Coccinelle
using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: Remove return variable from host_interface.c
Nishka Dasgupta [Thu, 21 Mar 2019 19:55:55 +0000 (01:25 +0530)]
staging: wilc1000: Remove return variable from host_interface.c

Remove return variable from host_interface.c. Issue found with
Coccinelle using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6655: Add spaces around operator
Vatsala Narang [Thu, 21 Mar 2019 21:40:05 +0000 (03:10 +0530)]
staging: vt6655: Add spaces around operator

Add spaces around '-' operator to get rid of checkpatch warning.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: pi433: remove empty space to fix line over 80 characters warning
Jules Irenge [Thu, 21 Mar 2019 19:54:08 +0000 (19:54 +0000)]
staging: pi433: remove empty space to fix line over 80 characters warning

Remove empty space to solve checkpatch.pl warning:
"WARNING: line over 80 characters".

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: gdm724x: Remove unnecessary print statements
Bhanusree Pola [Fri, 22 Mar 2019 12:40:10 +0000 (18:10 +0530)]
Staging: gdm724x: Remove unnecessary print statements

Remove print statements that provide information about error messages
when memory allocation is failed.
Issue found using coccinelle
The following semantic patch is used to solve this:

<smpl>
@@
expression x;
constant char[] C;
identifier f;
@@

x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|
usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

if(x==NULL)
{
...
(
-f(C,...);
|
-f(...,C);
)
...
}
</smpl>

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: comedi: ni_mio_common.c: Added blank line after declarations
Arash Fotouhi [Thu, 21 Mar 2019 19:18:12 +0000 (12:18 -0700)]
Staging: comedi: ni_mio_common.c: Added blank line after declarations

Added blank line after declarations.

Signed-off-by: Arash Fotouhi <arash@arashfotouhi.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: remove typedef for struct pno_scan_info
Himadri Pandya [Thu, 21 Mar 2019 18:14:05 +0000 (23:44 +0530)]
staging: rtl8723bs: include: remove typedef for struct pno_scan_info

Remove typedef for struct pno_scan_info as The Linux kernel coding style
guidelines discourage the use of typedefs for struct types.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: remove typedef for struct pno_scan_channel_info
Himadri Pandya [Thu, 21 Mar 2019 18:14:04 +0000 (23:44 +0530)]
staging: rtl8723bs: include: remove typedef for struct pno_scan_channel_info

Remove typedef for struct pno_scan_channel_info as The Linux kernel
coding style guidelines discourage the use of typedefs for struct
types.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: remove typedef for struct pno_ssid_list
Himadri Pandya [Thu, 21 Mar 2019 18:14:03 +0000 (23:44 +0530)]
staging: rtl8723bs: include: remove typedef for struct pno_ssid_list

Remove typedef from struct pno_ssid_list as The Linux kernel coding
style guidelines discourage the use of typedefs for struct types.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: remove typedef for struct pno_ssid
Himadri Pandya [Thu, 21 Mar 2019 18:14:02 +0000 (23:44 +0530)]
staging: rtl8723bs: include: remove typedef for struct pno_ssid

Remove typedef for struct pno_ssid as The Linux kernel coding style
guidelines discourage the use of typedefs for struct types.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: include: remove typedef for struct pno_nlo_info
Himadri Pandya [Thu, 21 Mar 2019 18:14:01 +0000 (23:44 +0530)]
staging: rtl8723bs: include: remove typedef for struct pno_nlo_info

Remove typedef for struct pno_nlo_info as the Linux kernel coding style
guidelines discourage the use of typedefs for struct types.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8723bs: core: Change NULL comparison to Boolean negation
Nishka Dasgupta [Thu, 21 Mar 2019 18:48:46 +0000 (00:18 +0530)]
staging: rtl8723bs: core: Change NULL comparison to Boolean negation

Change NULL comparison to Boolean negation. Issue found with Coccinelle
using matchnull.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: rtl8712_led.c: remove blank line
Payal Kshirsagar [Thu, 21 Mar 2019 15:59:06 +0000 (21:29 +0530)]
staging: rtl8712: rtl8712_led.c: remove blank line

To avoid style issues, remove multiple blank lines.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: rtl8712_led.c: alignment should match open parenthesis
Payal Kshirsagar [Thu, 21 Mar 2019 15:50:54 +0000 (21:20 +0530)]
staging: rtl8712: rtl8712_led.c: alignment should match open parenthesis

Align code to the open parenthesis to fix the alignment issue.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: rtl8712_led.c: remove unnecessary parentheses
Payal Kshirsagar [Thu, 21 Mar 2019 15:44:10 +0000 (21:14 +0530)]
staging: rtl8712: rtl8712_led.c: remove unnecessary parentheses

Fix unnecessary parentheses issue.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: rtl8712_efuse.h: alignment should match open parenthesis
Payal Kshirsagar [Thu, 21 Mar 2019 14:51:45 +0000 (20:21 +0530)]
staging: rtl8712: rtl8712_efuse.h: alignment should match open parenthesis

Align code to the open parenthesis to fix the alignment issue.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: rtl8712_efuse.h: remove blank line
Payal Kshirsagar [Thu, 21 Mar 2019 14:46:38 +0000 (20:16 +0530)]
staging: rtl8712: rtl8712_efuse.h: remove blank line

To avoid style issues, remove multiple blank lines.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: alignment should match open parenthesis
Payal Kshirsagar [Thu, 21 Mar 2019 14:39:08 +0000 (20:09 +0530)]
staging: rtl8712: alignment should match open parenthesis

Align code to the open parenthesis to fix the alignment issue.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8712: remove blank line
Payal Kshirsagar [Thu, 21 Mar 2019 14:26:43 +0000 (19:56 +0530)]
staging: rtl8712: remove blank line

To avoid style issues, remove multiple blank lines.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: media: Use !x in place of NULL comparision
Bhanusree Pola [Thu, 21 Mar 2019 09:35:27 +0000 (15:05 +0530)]
Staging: media: Use !x in place of NULL comparision

Test for NULL as !x instead of NULL comparisions for
functions that return NULL on failure.
Issue found using coccinelle
Semantic patch used to solve the problem is as follows

// <smpl>
@@
expression x;
statement S;
@@

x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|
usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));

-if(x==NULL)
+if(!x)
// </smpl>

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: netlogic: Remove unnecessary error print
Himadri Pandya [Thu, 21 Mar 2019 09:57:17 +0000 (15:27 +0530)]
staging: netlogic: Remove unnecessary error print

Kmalloc normally produces a backtrace when there is not enough memory.
So it is unnecessary to print an error message that provides only this
information. Hence, remove pr_error() from memory allocation check.
Issue found using Coccinelle.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6655: lines should not end with a parenthesis
Payal Kshirsagar [Thu, 21 Mar 2019 10:35:36 +0000 (16:05 +0530)]
staging: vt6655: lines should not end with a parenthesis

Adjust code to fix the style issue – lines should not end with a
parenthesis.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: vt6655: correction in spelling
Payal Kshirsagar [Thu, 21 Mar 2019 09:52:56 +0000 (15:22 +0530)]
staging: vt6655: correction in spelling

Correct misspelled word.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8192e: kconfig: use help over --help--
Anushka Shukla [Thu, 21 Mar 2019 18:26:17 +0000 (23:56 +0530)]
staging: rtl8192e: kconfig: use help over --help--

use help over --help-- for new help text

Signed-off-by: Anushka Shukla <anushkacharu9@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: core: Add spaces around operators
Vatsala Narang [Thu, 21 Mar 2019 15:14:47 +0000 (20:44 +0530)]
staging: rtl8188eu: core: Add spaces around operators

Add spaces around '+' operator to get rid of checkpatch warning.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: core: Remove unnecessary parentheses
Vatsala Narang [Thu, 21 Mar 2019 15:12:45 +0000 (20:42 +0530)]
staging: rtl8188eu: core: Remove unnecessary parentheses

Remove unnecessary parentheses after 'address-of' operator
Issue found with checkpatch.pl

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: core: rtw_mlme: Remove return variables.
Sanjana Sanikommu [Thu, 21 Mar 2019 07:54:04 +0000 (13:24 +0530)]
staging: rtl8188eu: core: rtw_mlme: Remove return variables.

The last two lines in the function could
be compressed into one. Avoid usage of local variable.
Issue found with Coccinelle using ret.cocci.

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: emxx_udc: lines should not end with parenthesis
Payal Kshirsagar [Thu, 21 Mar 2019 11:40:04 +0000 (17:10 +0530)]
staging: emxx_udc: lines should not end with parenthesis

Adjust code to meet the style of “lines should not end with
parenthesis”.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: greybus: sdio.c: Remove unncessary paranthesis.
Sanjana Sanikommu [Thu, 21 Mar 2019 16:31:08 +0000 (22:01 +0530)]
staging: greybus: sdio.c: Remove unncessary paranthesis.

Challenge suggested by coccinelle.
Remove unnecessary parathesis around the right hand of
assignment using the below script.

@@
binary operator op = {==,!=,&&,||,>=,<=,&,|};
expression l, r, t;
@@

(
l = (r op t)
|
l =
-(
r
-)
)

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: erofs: Replace NULL comparisons
Vatsala Narang [Thu, 21 Mar 2019 00:06:13 +0000 (05:36 +0530)]
staging: erofs: Replace NULL comparisons

Replace all NULL comparisons in the file to get rid of checkpatch
warnings

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: gdm724x: Rename dftEpsId to dft_eps_id
Branden Bonaby [Wed, 20 Mar 2019 18:37:04 +0000 (14:37 -0400)]
staging: gdm724x: Rename dftEpsId to dft_eps_id

Rename member element dftEpsId to dft_eps_id to avoid camelcase.
checkpatch warning: Avoid CamelCase.

Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: rtl8723bs: Change return type and type of local variable
Madhumitha Prabakaran [Wed, 20 Mar 2019 23:02:02 +0000 (18:02 -0500)]
Staging: rtl8723bs: Change return type and type of local variable

rtw_startbss_cmd can return the result of calling rtw_enqueue_cmd, which
can return the result of calling _rtw_enqueue_cmd, but they all have
different return types (u8, u32, and sint, respectively).

As all of these functions return error codes, change all the return types
to int, in preparation for converting these functions to use standard
kernel error codes.

Also, remove extern from the function declaration to maintain Linux kernel
coding style.

Issue suggested by Coccinelle.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: r8188eu: refactor recvframe_defrag()
Ivan Safonov [Wed, 20 Mar 2019 14:31:44 +0000 (17:31 +0300)]
staging: r8188eu: refactor recvframe_defrag()

Local variables pfhdr and prframe always have a same value,
so one of them is unnecessary.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wlan-ng: Correct typo in comment message
Branden Bonaby [Wed, 20 Mar 2019 17:22:07 +0000 (13:22 -0400)]
staging: wlan-ng: Correct typo in comment message

Add space between two words for better readability in the
comments.

Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wlan-ng: malformed SPDX-License-Identifier
Branden Bonaby [Wed, 20 Mar 2019 17:22:06 +0000 (13:22 -0400)]
staging: wlan-ng: malformed SPDX-License-Identifier

Correct malformed SPDX-License-Identifier so that it
matches Linux kernel comment coding style.

Signed-off-by: Branden Bonaby <brandonbonaby94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-spi: Remove references to nonexistent mt7621_spi_ops
George Hilliard [Wed, 20 Mar 2019 17:19:15 +0000 (11:19 -0600)]
staging: mt7621-spi: Remove references to nonexistent mt7621_spi_ops

This struct does not exist, and when it is looked up in the
compatibility tree, it returns null.  Remove these nonfunctional lines.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: core: rtw_recv.c: Modify return type suggested by Coccinelle.
Sanjana Sanikommu [Wed, 20 Mar 2019 15:37:18 +0000 (21:07 +0530)]
staging: rtl8188eu: core: rtw_recv.c: Modify return type suggested by Coccinelle.

The last two lines in the function could
be compressed into one. Avoid usage of local variable.

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8192u: r8192U_dm: Remove unnecessary comments.
Sanjana Sanikommu [Wed, 20 Mar 2019 13:18:18 +0000 (18:48 +0530)]
staging: rtl8192u: r8192U_dm: Remove unnecessary comments.

Remove comments which are not necessary.

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: netlogic: replace skb_put/pull pair with skb_reserve
Ivan Safonov [Wed, 20 Mar 2019 12:45:19 +0000 (15:45 +0300)]
staging: netlogic: replace skb_put/pull pair with skb_reserve

The sequence

    skb_put(skb);
    skb_pull(skb);

leads to the same result as

    skb_reserve(skb);

but second is a little shorter and clearer.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8192u: ieee80211: ieee80211_rx.c: Remove unnecessary braces.
Sanjana Sanikommu [Wed, 20 Mar 2019 11:16:18 +0000 (16:46 +0530)]
staging: rtl8192u: ieee80211: ieee80211_rx.c: Remove unnecessary braces.

Remove braces around single statement block.
Issue found by checkpatch.pl

WARNING: braces {} are not necessary for a single statement block

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: remove unused WFD defines
Michael Straube [Wed, 20 Mar 2019 08:50:29 +0000 (09:50 +0100)]
staging: rtl8188eu: remove unused WFD defines

All defined WFD* in wifi.h are unused in the driver code,
so remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: unisys: Correct malformed SPDX-License-Identifier
Wentao Cai [Wed, 20 Mar 2019 07:09:01 +0000 (00:09 -0700)]
Staging: unisys: Correct malformed SPDX-License-Identifier

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>
5 years agostaging: comedi: ni_mio_common: use insn->n in ni_m_series_eeprom_insn_read()
Ian Abbott [Tue, 19 Mar 2019 16:54:44 +0000 (16:54 +0000)]
staging: comedi: ni_mio_common: use insn->n in ni_m_series_eeprom_insn_read()

The `insn_read` handler for the EEPROM subdevice on M-series boards
(`ni_m_series_eeprom_insn_read()`) currently ignores `insn->n` (the
number of samples to read) and assumes a single sample is to be read
into `data[0]`.  Fortunately, the Comedi core ensures that `data[]` has
a length of at least 16 so there is no problem with array bounds.

The usual Comedi convention for `insn_read` handlers is to read the same
channel `insn->n` times into successive elements of `data[]` so let's do
that.  (Each channel corresponds to a single EEPROM address.)  In this
case, the data value comes from a local copy of the EEPROM contents.

Also, follow the usual Comedi convention and return `insn->n` from the
handler to indicate success (although any non-negative value will do).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: comedi: ni_mio_common: use insn->n in ni_eeprom_insn_read()
Ian Abbott [Tue, 19 Mar 2019 16:54:43 +0000 (16:54 +0000)]
staging: comedi: ni_mio_common: use insn->n in ni_eeprom_insn_read()

The `insn_read` handler for the EEPROM subdevice on E-series boards
(`ni_eeprom_insn_read()`) currently ignores `insn->n` (the number of
samples to read) and assumes a single sample is to be read into
`data[0]`.  Fortunately, the Comedi core ensures that `data[]` has a
length of at least 16 so there is no problem with array bounds.

The usual Comedi convention for `insn_read` handlers is to read the same
channel `insn->n` times into successive elements of `data[]` so let's do
that.  (Each channel number corresponds to a single EEPROM address.)
Since we do not expect the EEPROM data at a particular address to change
between readings, let's just read it once and copy the value `insn->n`
times.

Also, follow the usual Comedi convention and return `insn->n` from the
handler to indicate success (although any non-negative value will do).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: comedi: ni_mio_common: use insn->n in ni_calib_insn_read()
Ian Abbott [Tue, 19 Mar 2019 16:54:42 +0000 (16:54 +0000)]
staging: comedi: ni_mio_common: use insn->n in ni_calib_insn_read()

The `insn_read` handler for the calibration subdevice
(`ni_calib_insn_read()`) currently ignores `insn->n` (the number of
samples to read) and assumes a single sample is to be read into
`data[0]`.  Fortunately, the Comedi core ensures that `data[]` has a
length of at least 16, so there is no problem with array bounds.

The usual Comedi convention for `insn_read` handlers is to read the same
channel `insn->n` times into successive elements of `data[]`, so let's
do that.

Also, follow the usual Comedi convention and return `insn->n` from the
handler to indicate success (although any non-negative value will do).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: comedi: ni_mio_common: Use insn->n in ni_calib_insn_write()
Ian Abbott [Tue, 19 Mar 2019 16:54:41 +0000 (16:54 +0000)]
staging: comedi: ni_mio_common: Use insn->n in ni_calib_insn_write()

The `insn_write` handler for the calibration subdevice
(`ni_calib_insn_write()`) currently ignores `insn->n` (the number of
samples to write) and assumes a single sample is to be written, but
`insn->n` could be 0, meaning no samples should be written, in which
case `data[0]` is invalid.

Change `ni_calib_insn_write()` to only write to the calibration device
if `insn->n > 0`.  There isn't much point writing all the values when
`insn->n > 1`, so just write the last one (`data[insn->n - 1]`).

Also follow the usual Comedi convention and return `insn->n` from the
handler to indicate success (although any non-negative return value will
do as far as the Comedi core is concerned).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Only unmap_sg if mapped
George Hilliard [Tue, 19 Mar 2019 02:20:12 +0000 (20:20 -0600)]
staging: mt7621-mmc: Only unmap_sg if mapped

A failure while processing the start command could cause dma_unmap_sg()
to be called without first calling dma_map_sg().

Since calling dma_unmap_sg() is only needed when data != NULL, move the
unmap call into the corresponding if {} block.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Fix BRUST -> BURST typo
George Hilliard [Tue, 19 Mar 2019 02:20:11 +0000 (20:20 -0600)]
staging: mt7621-mmc: Fix BRUST -> BURST typo

Obvious typo.  It is specified as BURST in the datasheet.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Immediately notify mmc layer of card change detection
George Hilliard [Tue, 19 Mar 2019 02:20:10 +0000 (20:20 -0600)]
staging: mt7621-mmc: Immediately notify mmc layer of card change detection

There is no need to delay notifying the mmc layer.  Schedule the delayed
work to run immediately.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Remove redundant host->mmc->f_max write
George Hilliard [Tue, 19 Mar 2019 02:20:09 +0000 (20:20 -0600)]
staging: mt7621-mmc: Remove redundant host->mmc->f_max write

This is set once during initialization and never changed.  Don't bother
setting it again in the interrupt handler.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Bill the caller for I/O time
George Hilliard [Tue, 19 Mar 2019 02:20:06 +0000 (20:20 -0600)]
staging: mt7621-mmc: Bill the caller for I/O time

When waiting on completions, use the _io variant so the caller is
charged as using I/O.

This should have no effect on the module's functionality, only improve
CPU accounting.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Use pinctrl subsystem to select SDXC pin mode
George Hilliard [Tue, 19 Mar 2019 02:20:05 +0000 (20:20 -0600)]
staging: mt7621-mmc: Use pinctrl subsystem to select SDXC pin mode

The driver previously grabbed the SD pins for itself, ignoring the pin
controller.  Remove this, and allow the pinctrl subsystem to set up the
pins using the device tree mappings.  This allows this driver to work on
related devices that have a different pin controller mapping, such as
the MT7688.  The hardcoded bit index was incorrect on that device.

The driver now needs a pin controller reference in its device tree node:

sdhci: /* ... */ {
compatible = "ralink,mt7620-sdhci";

pinctrl-names = "default";
pinctrl-0 = <&sdhci_pins>;

// ...
};

This change could break SD controller functionality on existing devices
whose device trees do not specify a pin controller and state for the SD
node.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: Remove obsolete comments and variables
George Hilliard [Tue, 19 Mar 2019 02:20:03 +0000 (20:20 -0600)]
staging: mt7621-mmc: Remove obsolete comments and variables

These comments don't contain useful code or alternate implementation
ideas.  Remove them.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: mt7621-mmc: fix unused variable compiler warning
George Hilliard [Tue, 19 Mar 2019 02:20:02 +0000 (20:20 -0600)]
staging: mt7621-mmc: fix unused variable compiler warning

The compiler complains:

    drivers/staging/mt7621-mmc/dbg.c: In function ‘msdc_debug_proc_write’:
    drivers/staging/mt7621-mmc/dbg.c:237:12: warning: unused variable ‘size’ [-Wunused-variable]
      int mode, size;
                ^~~~
    drivers/staging/mt7621-mmc/dbg.c:237:6: warning: unused variable ‘mode’ [-Wunused-variable]
      int mode, size;
          ^~~~

Remove these declarations.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2: ethsw: Remove return variable
Nishka Dasgupta [Tue, 19 Mar 2019 19:22:31 +0000 (00:52 +0530)]
staging: fsl-dpaa2: ethsw: Remove return variable

Remove return variable and return return value directly. Issue found by
Coccinelle using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agoStaging: unisys: visorhba: Replace '--help--' with 'help' in Kconfig
Wentao Cai [Wed, 20 Mar 2019 04:44:59 +0000 (21:44 -0700)]
Staging: unisys: visorhba: Replace '--help--' with 'help' in Kconfig

Replace '--help--' in Kconfig and indent the subsequent text to silence
checkpatch.pl
warning:
WARNING: prefer 'help' over '---help---' for new help texts

Signed-off-by: Wentao Cai <etsai042@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>