Commit graph

575158 commits

Author SHA1 Message Date
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
Thaissa Falbo b369a87c3c staging:media:davinci_vpfe: Fixed comparisons with constants warnings
WARNING: Comparisons should place the constant on the right side of the
test

Fixed warnings by moving the constants to the right side of the comparisons.

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
Thaissa Falbo 9c5d89338e staging:media:davinci_vpfe: Fixed block comments according to kernel coding style
Fixed block comments by following the checkpatch warnings

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on separate line

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
Amitoj Kaur Chawla 72a5f6a8df staging: rdma: hfi1: Use offset_in_page macro
Use offset_in_page macro instead of (var & ~PAGE_MASK)

The Coccinelle semantic patch used to make this change is as follows:
// <smpl>
@@
unsigned long p;
@@
- p & ~PAGE_MASK
+ offset_in_page(p)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:54:05 -08:00
Amitoj Kaur Chawla 809487c703 staging: rdma: hfi1: Use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) /(d)) but is perhaps more readable.

The Coccinelle script used is as follows:

// <smpl>
@@
expression n,d;
@@
(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)
@@
expression n,d;
@@
- DIV_ROUND_UP((n),d)
+ DIV_ROUND_UP(n,d)
@@
expression n,d;
@@
- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:54:05 -08:00
Amitoj Kaur Chawla 94b397cd25 staging: rdma: hfi1: Replace kmalloc and memcpy with kmemdup
Replace kmalloc and memcpy with kmemdup. Found using Coccinelle.

The semantic patch used to make this change can be found here:
scripts/coccinelle/api/memdup.cocci

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:54:05 -08:00
Fu Yong Quah 1e613801ce staging: wlan-ng: fix NULL comparison
Fix NULL equality comparision by changing it with exclamation mark,
as suggested by Documentation/CodingStyle

Signed-off-by: Fu Yong Quah <fuyong@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Amitoj Kaur Chawla 5be2f42b50 staging: wlan-ng: Remove flush_scheduled_work
flush_scheduled_work() is scheduled for deprecation. Use
cancel_work_sync() instead to ensure that there is no pending or
running work item.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Bhumika Goyal 896774f631 Staging: wlan-ng: Remove unused functions and prototypes
hfa384x_drvr_getconfig_async is not used anywhere in the kernel
so remove it. Also remove its prototype from the header file. Also
the function hfa384x_cb_rrid was only used by hfa384x_drvr_getconfig_async
so remove its definition and prototype as well.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00
Bhumika Goyal 49e845a087 Staging: wlan-ng: Remove function hfa384x_drvr_commtallies
The function hfa384x_drvr_commtallies is not used anywhere in the kernel
so remove it. Also remove its prototype from the header file.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:53:27 -08:00