Commit graph

575167 commits

Author SHA1 Message Date
Hemmo Nieminen
b900d57937 staging: rtl8712: Improve suspend/resume functionality.
Fix a driver hang caused by earlier suspend/resume cycles. By handling a
ENODEV error during suspend as a real error we eventually end up stopping
the whole driver.

Fix this by handling the ENODEV error (during suspend) essentially by
retrying.

Signed-off-by: Hemmo Nieminen <hemmo.nieminen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:18:33 -08:00
Amitoj Kaur Chawla
f99ca86646 staging: rtl8712: Declare function as static
Declare rtl871x_intf_resume() function static since it is defined and called
in this file only.

This fixes the following sparse warning:
warning: symbol 'rtl871x_intf_resume' was not declared. Should it be static?

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:18:33 -08:00
Janani Ravichandran
9397ce2104 staging: fsl-mc: Remove unneeded else following a return
Remove unnecessary else when there is a return statement in the
corresponding if block. Coccinelle patch used:

@rule1@
expression e1;
@@

	if (e1) { ... return ...; }
-       else{
	        ...
-       }

@rule2@
expression e2;
statement s1;
@@

	if(e2) { ... return ...; }
-       else
               s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:59 -08:00
Bhumika Goyal
453dd922c4 Staging: fsl-mc: bus: Drop owner assignment from platform_driver
For platform_driver, we don't need to set .owner field as is set by
platform driver core. The semantic patch used here first checks whether
platform_driver struct was actually used in a call to set the .owner
field.
The coccinelle script that generated the patch can be found here:
http://www.spinics.net/lists/kernel/msg2029903.html

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:59 -08:00
Dilek Uzulmez
e26bf889dd Staging: octeon: Remove blank lines after open braces
This patch fixes "blank lines aren't necessary after an open brace '{'"
checkpatch.pl warning in ethernet.c

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:14 -08:00
Aaro Koskinen
dcf24f77e4 staging: octeon: drop atomic usage from rx counters
We have only one NAPI poll running at a time, so virtual port rx counters
can be updated normally.

Update of rx_dropped can still race with the gathering of statistics,
but full accuracy is not required there.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:01 -08:00
Aaro Koskinen
a89e28e3e2 staging: octeon-usb: make driver name to match the file name
Make driver name to match the file name.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:01 -08:00
Aaro Koskinen
3c98ef90f0 staging: octeon-usb: add spaces around operator
Add spaces around operator to improve readability.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:01 -08:00
Aaro Koskinen
cce66005b4 staging: octeon-usb: switch to use kernel types
Switch to use kernel types:

	uint64_t -> u64
	uint32_t -> u32
	uint16_t -> u16
	uint8_t  -> u8
	int8_t   -> s8

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:01 -08:00
Aaro Koskinen
466657314b staging: octeon-usb: clean up includes
Clean up includes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:01 -08:00
Aaro Koskinen
ec7c4d7d52 staging: octeon-usb: delete space after cast
Delete space after cast.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:01 -08:00
Aaro Koskinen
6de14f12c3 staging: octeon-usb: add missing braces
Some if branches are missing braces as required by coding style.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:01 -08:00
Aaro Koskinen
c9d19612e8 staging: octeon-usb: delete redundant blank lines
Delete redundant blank lines.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:14:01 -08:00
Bhaktipriya Shridhar
7949be663f staging: rtl8192e: Drop useless initialisation
Removed initialisation of a varible if it is immediately reassigned.

Changes were made using Coccinelle.

@@
type T;
constant C;
expression e;
identifier i;
@@
T i
- = C
;
i = e;

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:12:06 -08:00
Janani Ravichandran
a4eed41f96 staging: rtl8192e: Remove explicit pointer cast in assignments
In this file, the values returned by rtllib_priv() are unnecessarily cast
into a pointer type in some assignment statements. Remove the cast as it
is unneeded.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:12:06 -08:00
Bhaktipriya Shridhar
1761a85c3b staging: rtl8192u: Remove create_workqueue()
With cmwq, use of dedicated workqueues can be replaced by system_wq.
Removed the dedicated workqueue and used system_wq instead.

Since the work items in the workqueues do not need to
be ordered, increase of concurrency by switching to system_wq should
not break anything.

All work items are sync canceled so it is guaranteed that no work is
running when driver is detached.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:09:57 -08:00
Bhumika Goyal
f59140964b Staging: rtl8192u: Convert long if-else block to switch-case
Replace long if-else block with switch-case to make it more readable and
compact.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:09:57 -08:00
Anchal Jain
e4d1bff1e4 staging: fbtft: Fix block comment coding style
Add the required leading * on subsequent lines as well as
move the */ on a separate line. Checkpatch found this issue.

Signed-off-by: Anchal Jain <anchalj109@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:09:57 -08:00
Bhaktipriya Shridhar
b383f2acbd staging: rtl8188eu: core: Remove unnecessary braces
This patch removes braces for single statement blocks. The warning
was detected using checkpatch.pl.
Coccinelle was used to make the change.

@@
expression e,e1;
@@

- if (e) {
+ if (e)
  e1;
- }

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Andrew Bradford
816c2db010 staging: rtl8188eu: Remove RF_PATH_C & RF_PATH_D
RTL8188EE has a maximum of 2 RF paths (chains) so paths C and D are not
needed to support this part.

Signed-off-by: Andrew Bradford <andrew@bradfordembedded.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Colin Vidal
a3c0c480e8 Staging: rtl8188eu/core: Coding style fix, avoid line over 80 characters
Jump a new line after and operator of the test. It avoids to exceed 80
chars line, and remove a checkpatch warning.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Colin Vidal
18dbf8eacc Staging: rtl8188eu/core: Coding style fix, set constant operand on right in tests
Remove a checkpatch warning, putting constant operant on right of two tests.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Colin Vidal
c3588214cb Staging: rtl8188eu/core: Coding style fix, set conform spaces between identifiers
And a space after include keyword, making the preprocessor more
readable, and remove an unexpected space between a type and variable
name.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Colin Vidal
7ca6a96340 Staging: rtl8188eu/core: remove paragraph which mention FSF address in comment header
As FSF address changed in the past, and can change in the future,
remove the address paragraph in the comment header, and avoid a warning
of checkpatch.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Amitoj Kaur Chawla
684d2f1005 staging: rtl8188eu: core: Use put_unaligned_le16
Introduce the use of function put_unaligned_le16.
This is done using the following Coccinelle semantic patch:

//<smpl>
@@ identifier tmp; expression ptr; expression y,e; type T; @@

- tmp = cpu_to_le16(y);

  <+... when != tmp
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le16(y,ptr);
  ...+>
? tmp = e

@@ type T; identifier tmp; @@

- T tmp;
...when != tmp
//</smpl>

Corresponding header file has been added too.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Bhumika Goyal
da04bf74b4 Staging: rtl8188eu: core: rtw_xmit.c: Remove NULL test before vfree
The function vfree tests whether the argument is NULL and returns
immediately. So NULL test is not needed before vfree. Also remove blank
line between function calls.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Bhumika Goyal
64e6619fd3 Staging: rtl8188eu: core: rtw_mlme.c: Remove NULL test before vfree
The function vfree tests whether the argument is NULL and returns
immediately. So NULL test before vfree is not needed. Also remove braces
around if branch as they are no longer needed.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Bhaktipriya Shridhar
bfb7ff2c0b staging: rtl8723au: hal: Use macro ARRAY_SIZE
The macro ARRAY_SIZE is more concise to use instead of dividing
size of the array by the size of its type.

Changes were made using Coccinelle.

@@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Janani Ravichandran
382f00561c staging: rtl8723au: Remove unnecessary else following return
Remove unnecessary else when there is a return statement in the
corresponding if block.
Coccinelle patch used:

@rule1@
expression e1;
@@

	if (e1) { ... return ...; }
-       else{
	        ...
-            }

@rule2@
expression e2;
statement s1;
@@

	if(e2) { ... return ...; }
-       else
		s1

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Geliang Tang
f0eba5167b staging: rtl8723au: whitespace and blank line cleaning
This patch cleans whitespaces and blank lines involved with
previous two patchs in this patch set.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Geliang Tang
703a7604db staging: rtl8723au: core: rtw_recv: remove useless codes
There are some useless codes in rtw_free_recvframe23a_queue() and
recvframe_defrag(), so remove them.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Geliang Tang
e280d71bea staging: rtl8723au: use list_for_each_entry*()
Use list_for_each_entry*() instead of list_for_each*() to simplify
the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:04:11 -08:00
Bhumika Goyal
338e471619 Staging: rtl8723au: hal: Remove unused macros
The macros PlatformProcessHCICommands and PlatformTxBTQueuedPackets
are not used anywhere in the kernel so remove them.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:03:59 -08:00
Amitoj Kaur Chawla
e3479f774e staging: most: hdm-usb: Remove create_workqueue()
With concurrency managed workqueues, use of dedicated workqueues can
be replaced by using system_wq. Drop schedule_usb_work by using
system_wq.

Since there is only one work item per buf_anchor and most_dev and they
do not need to be ordered, increase of concurrency by switching to
system_wq should not break anything.

Both work items are sync canceled before the driver can be
unregistered, to ensure no work item is pending or executing on any
CPU by the time exit path is in flight.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:02:06 -08:00
Amitoj Kaur Chawla
a642bbbb41 staging: most: hdm-dim2: Replace pr_err with dev_err
Replace pr_err with dev_err when a appropriate device structure is
present.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:02:06 -08:00
Amitoj Kaur Chawla
3eced21a5a staging: most: hdm-dim2: Replace request_irq with devm_request_irq
Devm_ functions allocate memory that is released when a driver
detaches. Replace request_irq with devm_request_irq to get the
interrupt for device which is automatically freed on exit. Remove
corresponding free_irq from probe and remove functions of a platform
device.

Also, remove an unnecessary label.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:02:06 -08:00
Amitoj Kaur Chawla
bab469cdb6 staging: most: hdm-dim2: Switch to devm_ioremap_resource()
Devm_ functions allocate memory that is released when a driver
detaches. Replace request_mem_region and ioremap with
devm_ioremap_resource and remove corresponding freeing functions
release_mem_region and iounmap from probe and remove functions of a
platform device.

Also, an unnecessary platform_set_drvdata() has been removed since the
driver core clears the driver data to NULL after device release or on
probe failure. There is no need to manually clear the device driver
data to NULL.

Lastly, unnecessary labels have been removed.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:02:06 -08:00
Amitoj Kaur Chawla
8661fca6f6 staging: most: hdm-dim2: Replace kzalloc with devm_kzalloc
Devm_ functions allocate memory that is released when a driver detaches.
Replace kzalloc with devm_kzalloc and remove corresponding
kfrees from probe and remove functions of a platform
device.

Also, an unnecessary label has been removed.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:02:06 -08:00
Laura Garcia Liebana
11b49d9bb6 staging: netlogic: Return zero pointer after failed kmalloc
Return a ZERO_SIZE_PTR in the xlr_config_spill function if the
kmalloc returns an invalid value. This change prevents a possible
segmentation fault as the invalid pointer is fed into PTR_ALIGN macro.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
bf8b2bb6d8 staging: netlogic: Fix indent for conditional statement
Insert code indent for conditional statements. Checkpatch detected this
issue.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
800325fcb9 staging: netlogic: Insert spaces around operator
Spaces preferred around that '/' (ctx:VxV). Checkpatch detected these
issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
4b032eb7bd staging: netlogic: Fix comparison to NULL
Avoid the use of comparison to NULL, use !<variable> instead. Checkpatch
detected these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
a5cecac645 staging: netlogic: Fix CamelCase for constants
Avoid the use of CamelCase for constants. Checkpatch detected these
issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
06409808e3 staging: netlogic: Fix multiple assignments
Avoid the use of multiple assignments in a single line. Checkpatch found
this issue.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
c8550db532 staging: netlogic: Remove blank spaces after a cast
Remove uneeded blank spaces after a cast. Checkpatch found these issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Laura Garcia Liebana
3a694d0c29 staging: netlogic: Fix several parentheses alignments
Align arguments with the open parenthesis. Checkpatch found these
issues.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:59:37 -08:00
Thaissa Falbo
c3397c1b06 staging: media: davinci_vpfe: remove ret variable in switch statements
Remove ret variable in functions that used it to determine the return.
Simplified the return logic for these functions.

Found with Coccinelle script:

@@
local idexpression ret;
expression c,d;
identifier label;
@@

switch ( ... ) {
case label :
...
- ret = c;
- break;
+ return c;
...
default:
...
- ret = d;
+ return d;
...
}
... when != ret
- return ret;

@@
type T; identifier i;
@@
- T i;
... when != i

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:47 -08:00
Thaissa Falbo
afa5d19a2b staging: media: davinci_vpfe: remove unnecessary ret variable
Simplified return of funcions by removing assignment of ret variable.

Coccinelle script used:

@@
local idexpression ret;
expression e;
@@

- ret = e;
- if(ret)
-       return ret;
+ if(e)
+       return e;

@@
local idexpression ret;
expression e;
@@

- ret = e;
- return ret;
+ return e;

@@
local idexpression ret;
expression e;
@@

- ret = e;
- if(ret){
+ if(e){
        ... when != ret
-       return ret;
+       return e;
}

@@
type T; identifier i;
@@
- T i;
... when != i

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:47 -08:00
Thaissa Falbo
8e8919feb6 staging:media:davinci_vpfe: Fix lines over 80 characters
Fix "line over 80 characters" checkpatch warnings

WARNING: line over 80 characters

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:47 -08:00
Thaissa Falbo
735a8b4561 staging:media:davinci_vpfe: Fixed code identation warning as detected by checkpatch
Fixed code indentation warning as detected by checkpatch.

WARNING: suspect code indent for conditional statements (24, 40)
#1672: FILE: drivers/staging/media/davinci_vpfe/dm365_resizer.c:1672:

Signed-off-by: Thaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:56:32 -08:00