]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
9 years agoStaging: vt6655: changed C99 // comments
Hatice ERTÜRK [Thu, 19 Mar 2015 21:09:43 +0000 (23:09 +0200)]
Staging: vt6655: changed C99 // comments

// erased and replace it with /**/ used.
Error found with checkpatch.pl

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6656: don't return zero on failure path in vt6656_probe()
Alexey Khoroshilov [Fri, 13 Mar 2015 22:34:41 +0000 (01:34 +0300)]
staging: vt6656: don't return zero on failure path in vt6656_probe()

If ieee80211_alloc_hw() fails in vt6656_probe(), it breaks off
initialization, but returns zero.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: remove deprecated use of pci api
Quentin Lambert [Thu, 19 Mar 2015 13:18:56 +0000 (14:18 +0100)]
staging: vt6655: remove deprecated use of pci api

Replace occurences of the pci api by appropriate call to the dma api.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@deprecated@
idexpression id;
position p;
@@

(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@bad1@
idexpression id;
position deprecated.p;
@@
...when != &id->dev
   when != pci_get_drvdata ( id )
   when != pci_enable_device ( id )
(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@depends on !bad1@
idexpression id;
expression direction;
position deprecated.p;
@@

(
- pci_dma_supported@p ( id,
+ dma_supported ( &id->dev,
...
+ , GFP_ATOMIC
  )
|
- pci_alloc_consistent@p ( id,
+ dma_alloc_coherent ( &id->dev,
...
+ , GFP_ATOMIC
  )
)

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: ste_rmi4: Use SIMPLE_DEV_PM_OPS() macro
Vaishali Thakkar [Fri, 20 Mar 2015 07:17:51 +0000 (12:47 +0530)]
Staging: ste_rmi4: Use SIMPLE_DEV_PM_OPS() macro

Macro SIMPLE_DEV_PM_OPS() can be used when same suspend
and resume callbacks are used for suspend to RAM and
hibernation. So, here use SIMPLE_DEV_PM_OPS to make code
shorter and cleaner.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Remove line over 80 characters
Cristina Opriceana [Thu, 19 Mar 2015 19:07:51 +0000 (21:07 +0200)]
Staging: iio: Remove line over 80 characters

Rename variable in order to fix the 80 characters per line warning.
Found by checkpatch.pl

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Remove multiple blank lines
Cristina Opriceana [Thu, 19 Mar 2015 19:07:18 +0000 (21:07 +0200)]
Staging: iio: Remove multiple blank lines

This patch removes blank uneeded lines in order to remove the folowing
checkpatch.pl warning:
"Please don't use multiple blank lines".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Align function parameters to match first row
Cristina Opriceana [Thu, 19 Mar 2015 19:06:42 +0000 (21:06 +0200)]
Staging: iio: Align function parameters to match first row

This patch improves coding style by aligning parameters in
iio/magnetometer function calls, to remove the following warning:
"CHECK: Alignment should match open parenthesis".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Simplify NULL pointer condition
Cristina Opriceana [Thu, 19 Mar 2015 19:04:42 +0000 (21:04 +0200)]
Staging: iio: Simplify NULL pointer condition

Replace NULL comparrison with its shorter form.
Done with coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Remove extern as it is defined but never used
Vatika Harlalka [Thu, 19 Mar 2015 07:55:20 +0000 (13:25 +0530)]
Staging: rtl8188eu: Remove extern as it is defined but never used

RTW_WPA_VERSION is removed as is declared and defined but
never used in the code.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Remove unused macros
Vatika Harlalka [Thu, 19 Mar 2015 07:55:12 +0000 (13:25 +0530)]
Staging: rtl8188eu: Remove unused macros

These macros are defined but never used in the code.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Remove unused extern declarations.
Vatika Harlalka [Thu, 19 Mar 2015 07:55:06 +0000 (13:25 +0530)]
Staging: rtl8188eu: Remove unused extern declarations.

These externs are defined but not used anywhere in the code.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rts5208: Add new variable idx to shorten line length and increase readability
Vatika Harlalka [Wed, 18 Mar 2015 21:44:15 +0000 (03:14 +0530)]
Staging: rts5208: Add new variable idx to shorten line length and increase readability

Add new variable idx to shorten line length of other statements
and increase readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rts5208: Introduce a new variable to shorten line length and increase readab...
Vatika Harlalka [Wed, 18 Mar 2015 20:56:58 +0000 (02:26 +0530)]
Staging: rts5208: Introduce a new variable to shorten line length and increase readability

The variable block_no is introduced so as to shorten line length
in the long assignment statement and increase readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: speakup: Use module_spk_synth
Vaishali Thakkar [Wed, 18 Mar 2015 17:43:10 +0000 (23:13 +0530)]
Staging: speakup: Use module_spk_synth

Macro module_spk_synth can be used for speakup drivers
whose init and exit paths does only module registrations.
So, here remove some boilerplate code by using
module_spk_synth.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: speakup: Add helper macro for spk_synth boilerplate
Vaishali Thakkar [Wed, 18 Mar 2015 17:43:04 +0000 (23:13 +0530)]
Staging: speakup: Add helper macro for spk_synth boilerplate

For simple modules that contain a single spk_synth without
any additional setup code then ends up being a block of
duplicated boilerplate. This patch adds a new macro,
module_spk_synth(), which replaces the
module_init()/module_exit() registrations with template
functions.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wlan-ng: hfa384x: wrap long line
Sven Dziadek [Thu, 19 Mar 2015 19:42:48 +0000 (20:42 +0100)]
Staging: wlan-ng: hfa384x: wrap long line

This fixes the coding style issue "line over 80 characters"
found by checkpatch.pl

Signed-off-by: Sven Dziadek <sven.dziadek@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: remove CURRENT_RATE macro
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:58 +0000 (00:00 +0100)]
staging: rtl8192e: remove CURRENT_RATE macro

CURRENT_RATE macro is used only once in driver. This patch removes it
and adds rtllib_current_rate() static function in file using that macro

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: remove eqMacAddr macro
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:57 +0000 (00:00 +0100)]
staging: rtl8192e: remove eqMacAddr macro

Remove eqMacAddr macro and replace it with ether_addr_equal_unaligned()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: rtllib.h: remove duplicated container_of
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:56 +0000 (00:00 +0100)]
staging: rtl8192e: rtllib.h: remove duplicated container_of

This macro is already defined in kernel.h - there is no need to redefine it.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: remove unused macros
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:55 +0000 (00:00 +0100)]
staging: rtl8192e: remove unused macros

Several (unused) macros were removed from driver.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: remove dead code
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:54 +0000 (00:00 +0100)]
staging: rtl8192e: remove dead code

Remove commented-out unions and enum.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: remove rtllib_endianfree.h
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:53 +0000 (00:00 +0100)]
staging: rtl8192e: remove rtllib_endianfree.h

rtllib_endianfree.h was not used (only included)

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: fix coding style warnings (printk -> netdev_*)
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:52 +0000 (00:00 +0100)]
staging: rtl8192e: fix coding style warnings (printk -> netdev_*)

Use netdev_*, dev_* or pr_* instead of printk where possible.
KERN_DEBUG messages are left intact as pr_dbg has different behaviour.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: rtllib_wx: remove duplicate messages
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:51 +0000 (00:00 +0100)]
staging: rtl8192e: rtllib_wx: remove duplicate messages

Some messages were reported with netdev_* macros and internal
driver-specific macro.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: fix coding style errors (macros in parentheses)
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:50 +0000 (00:00 +0100)]
staging: rtl8192e: fix coding style errors (macros in parentheses)

Fix checkpatch.pl errors 'Macros with complex values should be enclosed in parentheses'.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: fix coding style issues (spaces before semicolon)
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:49 +0000 (00:00 +0100)]
staging: rtl8192e: fix coding style issues (spaces before semicolon)

Fix checkpatch.pl warning 'space prohibited before semicolon'.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: fix coding style issues (merge broken strings)
Mateusz Kulikowski [Mon, 16 Mar 2015 23:00:48 +0000 (00:00 +0100)]
staging: rtl8192e: fix coding style issues (merge broken strings)

Fix checkpatch.pl warnings:
- 'WARNING: quoted string split across lines'
- 'WARNING: break quoted strings at a space character'

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Remove unnecessary spaces
Hatice ERTÜRK [Thu, 19 Mar 2015 20:32:30 +0000 (22:32 +0200)]
Staging: rtl8192u: Remove unnecessary spaces

Fix checkpatch.pl issues with "unnecessary whitespace before a quoted
newline" in r819xU_phy.c

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: prism2sta: Replace memcpy with ether_add_copy
Ioana Ciornei [Wed, 18 Mar 2015 13:26:05 +0000 (15:26 +0200)]
staging: prism2sta: Replace memcpy with ether_add_copy

Replace memcpy() with ether_addr_copy() since addresses are __aligned(2).
The 2 structures are aligned to u16 as showed below:

typedef struct hfa384x_authenticateStation_data {
u8 address[ETH_ALEN];                           /* 0    6 */
u16 status;                                     /* 6    2 */
u16 algorithm;                                  /* 8    2 */
} __packed hfa384x_authenticateStation_data_t;

Total size: 10

typedef struct hfa384x_AuthRequest {
u8 sta_addr[ETH_ALEN];                          /* 0    6 */
u16 algorithm;                                  /* 6    2 */
} __packed hfa384x_AuthReq_t;
Total size: 8

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: lnet: lnet: router.c: fix useless returns and elses
Redha Gouicem [Thu, 19 Mar 2015 09:16:08 +0000 (10:16 +0100)]
Staging: lustre: lnet: lnet: router.c: fix useless returns and elses

This patch removes useless returns and elses.

Signed-off-by: Redha Gouicem <redha.gouicem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: lnet: lnet: router.c: fix 80 char line limit
Redha Gouicem [Thu, 19 Mar 2015 09:16:07 +0000 (10:16 +0100)]
Staging: lustre: lnet: lnet: router.c: fix 80 char line limit

This patch fixes lines longer than the 80 char limit.

Signed-off-by: Redha Gouicem <redha.gouicem@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: fix some coding style
Gauthier Voron [Wed, 18 Mar 2015 22:46:41 +0000 (23:46 +0100)]
Staging: lustre: fix some coding style

This patch remove unnecessary bracket.

Signed-off-by: Gauthier Voron <gauthier.voron@lip6.fr>
Signed-off-by: Hakan Metin <hakan.metin@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: fix coding style
Gauthier Voron [Wed, 18 Mar 2015 22:45:53 +0000 (23:45 +0100)]
Staging: lustre: fix coding style

This patch fix too large line.

Signed-off-by: Gauthier Voron <gauthier.voron@lip6.fr>
Signed-off-by: Hakan Metin <hakan.metin@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: niobuf.c fic 80 char limit
Jonathan Sid-Otmane [Wed, 18 Mar 2015 21:12:47 +0000 (22:12 +0100)]
Staging: lustre: niobuf.c fic 80 char limit

This fixes the charatcer limit in niobuf.c

Signed-off-by: Jonathan Sid-Otmane <Jonathan.SidOtmane@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: vvp_dev.c: fix spaces issues
Jonathan Sid-Otmane [Wed, 18 Mar 2015 20:59:41 +0000 (21:59 +0100)]
Staging: lustre: vvp_dev.c: fix spaces issues

This fixes the space issues in the file vvp_dev.c

Signed-off-by: Jonathan Sid-Otmane <Jonathan.SidOtmane@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: linux: linux-prim: fixed coding style warnings and errors
Roberto Medina [Wed, 18 Mar 2015 18:22:49 +0000 (19:22 +0100)]
staging: lustre: linux: linux-prim: fixed coding style warnings and errors

Coding style fixes due to exported symbols and comment style.

Signed-off-by: Roberto Medina <robertoxmed@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: namei.c: coding style: fix 80 characters limit
Laure Millet [Wed, 18 Mar 2015 19:07:26 +0000 (20:07 +0100)]
staging: lustre: namei.c: coding style: fix 80 characters limit

This patch fixes lines over 80 characters

Signed-off-by: Laure Millet <laure.millet@lip6.fr>
Signed-off-by: Maxime Lorrillere <maxime.lorrillere@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: namei.c: coding style: fix quoted string split across lines
Laure Millet [Wed, 18 Mar 2015 19:01:35 +0000 (20:01 +0100)]
staging: lustre: namei.c: coding style: fix quoted string split across lines

This patch fixes a quoted string split across lines.

Signed-off-by: Laure Millet <laure.millet@lip6.fr>
Signed-off-by: Maxime Lorrillere <maxime.lorrillere@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: namei.c: Fix trailing whitespace
Laure Millet [Wed, 18 Mar 2015 18:49:47 +0000 (19:49 +0100)]
staging: lustre: namei.c: Fix trailing whitespace

This patch fixes a trailing whitespace in namei.c

Signed-off-by: Laure Millet <laure.millet@lip6.fr>
Signed-off-by: Maxime Lorrillere <maxime.lorrillere@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: namei.c: fix "foo * bar" should be "foo *bar"
Laure Millet [Wed, 18 Mar 2015 18:49:46 +0000 (19:49 +0100)]
Staging: lustre: namei.c: fix "foo * bar" should be "foo *bar"

This patch fixes a coding style error in a pointer declaration.

Signed-off-by: Laure Millet <laure.millet@lip6.fr>
Signed-off-by: Maxime Lorrillere <maxime.lorrillere@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: namei.c: fix missing a blank line after declarations
Laure Millet [Wed, 18 Mar 2015 18:49:45 +0000 (19:49 +0100)]
Staging: lustre: namei.c: fix missing a blank line after declarations

This fixes a missing blank line after declarations.

Signed-off-by: Laure Millet <laure.millet@lip6.fr>
Signed-off-by: Maxime Lorrillere <maxime.lorrillere@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: dgnc: release the lock before testing for nullity
Quentin Lambert [Wed, 18 Mar 2015 13:21:08 +0000 (14:21 +0100)]
Staging: dgnc: release the lock before testing for nullity

The refactoring intrduced in
c84a083b995b ("Staging: dgnc: Use goto for spinlock release before return")
inverts the order in which the lock is released and ld is tested for nullity.

This patch restores the execution flow.

Fixes: c84a083b995b ("Staging: dgnc: Use goto for spinlock release before return")
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: replace pr_* with dev_*
Haneen Mohammed [Wed, 18 Mar 2015 10:12:07 +0000 (13:12 +0300)]
Staging: iio: replace pr_* with dev_*

dev_* is prefered over pr_* when appropriate device stuct is present.
This patch replace pr_err and pr_warn with its dev_ counterpart.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: media: replace pr_* with dev_*
Haneen Mohammed [Wed, 18 Mar 2015 10:09:50 +0000 (13:09 +0300)]
Staging: media: replace pr_* with dev_*

This patch replace pr_err/pr_info with dev_err/dev_infi, when
appropriate device structure is found.

Issues found using the following Coccinelle script. pr_err/dev_err was
substituted with pr_info/dev_info in the later case.

@r exists@
identifier f, s, i;
position p;
@@
f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}
@rr@
identifier r.s, s2, fld;
@@

struct s {
...
struct s2 *fld;
...
};

@rrr@
identifier rr.s2, fld2;
@@

struct s2 {
...
struct device fld2;
...
};
@@
identifier r.i, r.s, rr.fld, rrr.fld2;
position r.p;
@@

-pr_err@p
+dev_err
   (
+ &i->fld->fld2,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: gdm724x: replace pr_* with dev_*
Haneen Mohammed [Wed, 18 Mar 2015 10:08:59 +0000 (13:08 +0300)]
Staging: gdm724x: replace pr_* with dev_*

This patch replace pr_err/pr_info with dev_err/dev_info, when
appropriate device structure is found.

Issue found  and resolved using the following Coccinelle script.
pr_err/dev_err was substituted with pr_info/dev_info in the later case.

@r exists@
identifier f, s, i;
position p;
@@
f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}
@rr@
identifier r.s, s2, fld;
@@

struct s {
...
struct s2 *fld;
...
};

@rrr@
identifier rr.s2, fld2;
@@

struct s2 {
...
struct device fld2;
...
};
@@
identifier r.i, r.s, rr.fld, rrr.fld2;
position r.p;
@@

-pr_err@p
+dev_err
   (
+ &i->fld->fld2,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Remove timer handler macros
Vaishali Thakkar [Wed, 18 Mar 2015 06:48:38 +0000 (12:18 +0530)]
Staging: rtl8188eu: Remove timer handler macros

After the commit 28af7ea81e16 ("Staging: rtl8188eu:
Eliminate use of _init_timer"), macros
(RTW_TIMER_HDL_ARGS, RTW_TIMER_HDL_NAME,
RTW_DECLARE_TIMER_HDL) are no longer needed. So,
remove them.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: ft1000: replace pr_err with dev_err
Haneen Mohammed [Tue, 17 Mar 2015 05:37:36 +0000 (08:37 +0300)]
Staging: ft1000: replace pr_err with dev_err

This patch replace pr_err with dev_err, when appropriate device
structure is found.

Issue found using the following Coccinelle script:

@r exists@
identifier f, s, i;
position p;
@@

f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}

@rr@
identifier r.s, fld;
@@

struct s {
...
struct device *fld;
...
};

@@
identifier r.i, rr.fld;
position r.p;
@@
-pr_err@p
+dev_err
   (
+ i->fld,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: replace pr_err with dev_err
Haneen Mohammed [Tue, 17 Mar 2015 05:35:41 +0000 (08:35 +0300)]
Staging: iio: replace pr_err with dev_err

This patch replace pr_err with dev_err, when appropriate device structre
is found.
Issue found using the following Coccinelle script:

@r exists@
identifier f, s, i;
position p;
@@

f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}

@rr@
identifier r.s, fld;
@@

struct s {
...
struct device *fld;
...
};

@@
identifier r.i, rr.fld;
position r.p;
@@
-pr_err@p
+dev_err
   (
+ i->fld,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: gdm724x: replace pr_err with dev_err
Haneen Mohammed [Tue, 17 Mar 2015 05:34:20 +0000 (08:34 +0300)]
Staging: gdm724x: replace pr_err with dev_err

This patch replace pr_err with dev_err, when appropriate device structre
is found.
Issue found using the following Coccinelle script:

@r exists@
identifier f, s, i;
position p;
@@

f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}

@rr@
identifier r.s, fld;
@@

struct s {
...
struct device *fld;
...
};

@@
identifier r.i, rr.fld;
position r.p;
@@
-pr_err@p
+dev_err
   (
+ i->fld,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: comedi: replace pr_err with dev_err
Haneen Mohammed [Tue, 17 Mar 2015 05:33:51 +0000 (08:33 +0300)]
Staging: comedi: replace pr_err with dev_err

This patch replace pr_err with dev_err, when appropriate device
structure is found.
Issue found using the following Coccinelle script:

@r exists@
identifier f, s, i;
position p;
@@

f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}

@rr@
identifier r.s, fld;
@@

struct s {
...
struct device *fld;
...
};

@@
identifier r.i, rr.fld;
position r.p;
@@
-pr_err@p
+dev_err
   (
+ i->fld,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: media: Use module_i2c_driver
Vaishali Thakkar [Wed, 18 Mar 2015 07:00:44 +0000 (12:30 +0530)]
Staging: media: Use module_i2c_driver

Macro module_i2c_driver is used for drivers whose init
and exit paths does only register and unregister to i2c
API. So, here remove some boilerplate code by using
module_i2c_driver.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: use __printf(...) instead of __attribute__(format(__printf, ...))
Mario J. Rugiero [Tue, 10 Mar 2015 15:02:03 +0000 (12:02 -0300)]
staging/lustre: use __printf(...) instead of __attribute__(format(__printf, ...))

Replace uses of __attribute__(format(__printf,...)) by __printf(...), as suggested by checkpatch.

Signed-off-by: Mario J. Rugiero <mrugiero@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: clean trailing semicolons in macros
Mario J. Rugiero [Tue, 10 Mar 2015 15:02:02 +0000 (12:02 -0300)]
staging/lustre: clean trailing semicolons in macros

Remove trailing semicolons from macros, as suggested by checkpatch.

Signed-off-by: Mario J. Rugiero <mrugiero@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: space required after that close brace '}'
Alberto Pires de Oliveira Neto [Tue, 17 Mar 2015 01:21:10 +0000 (22:21 -0300)]
staging: lustre: space required after that close brace '}'

This patch fixes checkpatch.pl warning.
WARNING: space required after that close brace '}'

Signed-off-by: Alberto Pires de Oliveira Neto <mrpenguin2005@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: void function return statements are not generally useful.
Alberto Pires de Oliveira Neto [Tue, 17 Mar 2015 01:21:09 +0000 (22:21 -0300)]
staging: lustre: void function return statements are not generally useful.

This patch fixes checkpatch.pl warning.
WARNING: void function return statements are not generally useful

Signed-off-by: Alberto Pires de Oliveira Neto <mrpenguin2005@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: space prohibited between function name and open parenthesis '('
Alberto Pires de Oliveira Neto [Tue, 17 Mar 2015 01:21:08 +0000 (22:21 -0300)]
staging: lustre: space prohibited between function name and open parenthesis '('

This patch fixes checkpatch.pl warning.
WARNING: space prohibited between function name and open parenthesis '('

Signed-off-by: Alberto Pires de Oliveira Neto <mrpenguin2005@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: echo_client: Use kernel style spacing
Yogeswaran Thulasidoss [Mon, 16 Mar 2015 02:51:50 +0000 (08:21 +0530)]
staging: lustre: echo_client: Use kernel style spacing

This patch fixes the code style space issues identified by checkpatch.pl in drivers/staging/lustre/lustre/obdecho/echo_client.c

Signed-off-by: Yogeswaran Thulasidoss <yogeeswaran@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: Use kmemdup rather than duplicating its implementation
Ravindran, Madhusudhanan (M.) [Thu, 12 Mar 2015 17:35:52 +0000 (17:35 +0000)]
staging: lustre: Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available
in scriptcoccinelle/api/memdup.cocci.

Signed-off-by: Madhusudhanan Ravindran <mravindr@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Don't call blocking funcitons when !RUNNABLE
Oleg Drokin [Sun, 8 Mar 2015 00:24:29 +0000 (19:24 -0500)]
staging/lustre: Don't call blocking funcitons when !RUNNABLE

Move setting of TASK_INTERRUPTIBLE just around schedule call in
libcfs_sock_accept.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: avoid nonatomic memory alloc under spinlock
Lai Siyao [Sun, 8 Mar 2015 00:24:28 +0000 (19:24 -0500)]
staging/lustre/llite: avoid nonatomic memory alloc under spinlock

ll_intent_drop_lock() may sleep in memory allocation, which
should not be called inside spinlock.

Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Signed-off-by: Jian Yu <jian.yu@intel.com>
Reviewed-on: http://review.whamcloud.com/10674
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2272
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/o2iblnd: Don't use cpus_weight
Oleg Drokin [Sun, 8 Mar 2015 00:24:27 +0000 (19:24 -0500)]
staging/lustre/o2iblnd: Don't use cpus_weight

cpus_weight and for_each_cpu_mask are deprecated, so replace them
with cpumask_weight and for_each_cpu respectively.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/libcfs: replace deprecated cpus_ calls with cpumask_
Oleg Drokin [Sun, 8 Mar 2015 00:24:26 +0000 (19:24 -0500)]
staging/lustre/libcfs: replace deprecated cpus_ calls with cpumask_

This patch continues to further remove deprecated functions, such as
any_online_cpu, for_each_cpu_mask and also cleaning up
usage of NR_CPUS in a few places

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: Fix spelling mistakes
Haneen Mohammed [Mon, 16 Mar 2015 17:14:56 +0000 (20:14 +0300)]
Staging: lustre: Fix spelling mistakes

This patch fix the following spelling mistakes:
interoprability, SEPERATOR, defult.

Issue found using checkpatch.pl.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Rename struct to avoid CamelCase
Cristina Opriceana [Mon, 16 Mar 2015 19:56:13 +0000 (21:56 +0200)]
Staging: rtl8192u: Rename struct to avoid CamelCase

This patch renames struct DRxPathSel to dynamic_rx_path_sel in order to
keep the notations consistent and to remove the warning:
"CHECK: Avoid CamelCase". Done with coccinelle:
@@ @@
struct
-DRxPathSel
+dynamic_rx_path_sel
{...}

@@ @@
struct
-DRxPathSel
+dynamic_rx_path_sel

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Do not add new typedefs
Cristina Opriceana [Mon, 16 Mar 2015 19:55:15 +0000 (21:55 +0200)]
Staging: rtl8192u: Do not add new typedefs

This patch removes the dig_t and DRxPathSel type definitions in order to
avoid the following warning: "WARNING: Do not add new typedefs".
Done with coccinelle and this script:

@r@ type t; identifier id; @@
typedef struct id
{...}
t;

@script:python get_name@
t << r.t;
tdres;
@@
coccinelle.tdres = t.replace("_t", "");

@r_match@ type r.t; identifier r.id;
identifier get_name.tdres; @@
-typedef
struct
-id
+tdres
{...}
-t
;
@r_replace@ type r.t; identifier get_name.tdres; @@
-t
+struct tdres

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8712: replace memcpy with ether_addr_copy
Haneen Mohammed [Mon, 16 Mar 2015 15:41:31 +0000 (18:41 +0300)]
Staging: rtl8712: replace memcpy with ether_addr_copy

This patch replace memcpy with ethe_addr_copy to address the following
warning generated by checkpatch.pl: ""Prefer ether_addr_copy over memcpy
if the Ethernet addresses are __aligned(2)"

Follwoing is the output of pahole for the relevant datastructures:
1- for  "iwe.u.ap_addr.sa_data" and "wrqu->ap_addr.sa_data"

struct sockaddr {
        sa_family_t                sa_family;            /*     0     2 */
        char                       sa_data[14];          /*     2    14 */

        /* size: 16, cachelines: 1, members: 2 */
        /* last cacheline: 16 bytes */
};

struct iw_event {
        __u16                      len;                  /*     0     2 */
        __u16                      cmd;                  /*     2     2 */

        /* XXX 4 bytes hole, try to pack */

        union iwreq_data           u;                    /*     8    16 */

        /* size: 24, cachelines: 1, members: 3 */
        /* sum members: 20, holes: 1, sum holes: 4 */
        /* last cacheline: 24 bytes */
};

2- for  "pnetwork->network.MacAddress" and "pcur_bss->MacAddress"

struct wlan_network {
        struct list_head           list;                 /*     0    16 */
        int                        network_type;         /*    16     4 */
        int                        fixed;                /*    20     4 */
        unsigned int               last_scanned;         /*    24     4 */
        int                        aid;                  /*    28     4 */
        int                        join_res;             /*    32     4 */
        struct ndis_wlan_bssid_ex  network;              /*    36   884 */
        /* --- cacheline 14 boundary (896 bytes) was 24 bytes ago ---   */

        /* size: 920, cachelines: 15, members: 7 */
        /* last cacheline: 24 bytes */
};

struct ndis_wlan_bssid_ex {
        u32                        Length;               /*     0     4 */
        unsigned char              MacAddress[6];        /*     4     6 */
        u8                         Reserved[2];          /*    10     2 */
        struct ndis_802_11_ssid    Ssid;                 /*    12    36 */
        u32                        Privacy;              /*    48     4 */
        s32                        Rssi;                 /*    52     4 */
        enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;  /*    56     4 */
        struct NDIS_802_11_CONFIGURATION Configuration;  /*    60    32 */
        /* --- cacheline 1 boundary (64 bytes) was 28 bytes ago --- */
        enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; /* 92     4 */
        NDIS_802_11_RATES_EX       SupportedRates;       /*    96    16 */
        u32                        IELength;             /*   112     4 */
        u8                         IEs[768];             /*   116   768 */
        /* --- cacheline 13 boundary (832 bytes) was 52 bytes ago --- */

        /* size: 884, cachelines: 14, members: 12 */
        /* last cacheline: 52 bytes */
};

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: print MAC address via %pM
Andy Shevchenko [Sun, 15 Mar 2015 15:38:47 +0000 (17:38 +0200)]
staging: unisys: print MAC address via %pM

This patch converts code to use %pM specifier instead of placing each
byte on stack.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: fix some debugfs output
Dan Carpenter [Thu, 12 Mar 2015 12:46:29 +0000 (15:46 +0300)]
staging: unisys: fix some debugfs output

When we removed the ERRDEV() macro we made a small mistake so now it
doesn't print the "Virtual PCI devices" section header.

Fixes: 0aca78449b58 ('staging: unisys: remove ERRDEV macros')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: fix checkpatch warnings
Michel von Czettritz [Mon, 9 Mar 2015 22:06:55 +0000 (23:06 +0100)]
staging: unisys: fix checkpatch warnings

This fixes "braces {} are not necessary for single statement blocks" in uislib.

Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: nvec: use !x instead of x == NULL
Somya Anand [Mon, 16 Mar 2015 14:04:11 +0000 (19:34 +0530)]
Staging: nvec: use !x instead of x == NULL

Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.

This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@

(
 x = devm_kzalloc(...);
|
 x = usb_alloc_urb(...);
|
 x = kmalloc_array(...);
|
 x = devm_ioremap(...);
|
 x = alloc_netdev(...);
)
 ...
- if(NULL == x)
+ if(!x)
        S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.

Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: goldfish: use !x instead of x == NULL
Somya Anand [Mon, 16 Mar 2015 14:04:09 +0000 (19:34 +0530)]
Staging: goldfish: use !x instead of x == NULL

Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.

This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@

(
 x = devm_kzalloc(...);
|
 x = usb_alloc_urb(...);
|
 x = kmalloc_array(...);
|
 x = devm_ioremap(...);
|
 x = alloc_netdev(...);
)
 ...
- if(NULL == x)
+ if(!x)
        S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.

Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: gdm72xx: use !x instead of x == NULL
Somya Anand [Mon, 16 Mar 2015 14:04:08 +0000 (19:34 +0530)]
Staging: gdm72xx: use !x instead of x == NULL

Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.

This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@

(
 x = devm_kzalloc(...);
|
 x = usb_alloc_urb(...);
|
 x = kmalloc_array(...);
|
 x = devm_ioremap(...);
|
 x = alloc_netdev(...);
)
 ...
- if(NULL == x)
+ if(!x)
        S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.

Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: gdm724x: use !x instead of x == NULL
Somya Anand [Mon, 16 Mar 2015 14:04:07 +0000 (19:34 +0530)]
staging: gdm724x: use !x instead of x == NULL

Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.

This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@

(
 x = devm_kzalloc(...);
|
 x = usb_alloc_urb(...);
|
 x = kmalloc_array(...);
|
 x = devm_ioremap(...);
|
 x = alloc_netdev(...);
)
 ...
- if(NULL == x)
+ if(!x)
S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.

Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: emuxx_udc: replace pr_* with dev_*
Haneen Mohammed [Sun, 15 Mar 2015 22:26:37 +0000 (01:26 +0300)]
Staging: emuxx_udc: replace pr_* with dev_*

dev_* is prefered over pr_* when appropriate dev structure is present.
This patch replace pr_info and pr_warn with its dev_ counterpart.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: ft1000: Remove parentheses around right side an assignment
Haneen Mohammed [Fri, 13 Mar 2015 17:51:17 +0000 (20:51 +0300)]
Staging: ft1000: Remove parentheses around right side an assignment

Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: media: Remove parentheses around right side an assignment
Haneen Mohammed [Fri, 13 Mar 2015 17:46:57 +0000 (20:46 +0300)]
Staging: media: Remove parentheses around right side an assignment

Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8723au: Remove parentheses around right side an assignment
Haneen Mohammed [Fri, 13 Mar 2015 17:45:25 +0000 (20:45 +0300)]
Staging: rtl8723au: Remove parentheses around right side an assignment

Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: gdm72xx: Iterate list using list_for_each_entry
Somya Anand [Fri, 13 Mar 2015 19:33:09 +0000 (01:03 +0530)]
Staging: gdm72xx: Iterate list using list_for_each_entry

Code using doubly linked list is iterated generally  using list_empty and
list_entry functions, but it can be better written using list_for_each_entry
macro.

This patch replaces the while loop containing list_empty and list_entry with
list_for_each_entry and list_for_each_entry_safe. list_for_each_entry is a
macro which is used to iterate over a list of given type. So while loop used to
iterate over a list can be replaced with list_for_each_entry macro. However, if
list_del is used in the loop, then list_for_each_entry_safe is a better choice.
This transformation is done by using the following coccinelle script.

@ rule1 @
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry;
@@

- while (list_empty(&E1) == 0)
+ list_for_each_entry (I1, &E1, I2)
 {
...when != T *I1;
-  I1 = list_entry(E1.next, T, I2);
    ...when != list_del(...);
       when != list_del_init(...);
 }

@ rule2  @
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@
   T *I1;
+  T *tmp;
  ...
- while (list_empty(&E1) == 0)
+ list_for_each_entry_safe (I1, tmp, &E1, I2)
 {
...when != T *I1;
-  I1 = list_entry(E1.next, T, I2);
    ...
 }

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: emxx_udc: Iterate list using list_for_each_entry
Somya Anand [Fri, 13 Mar 2015 19:33:08 +0000 (01:03 +0530)]
Staging: emxx_udc: Iterate list using list_for_each_entry

Code using doubly linked list is iterated generally  using list_empty and
list_entry functions, but it can be better written using list_for_each_entry
macro.

This patch replaces the while loop containing list_empty and list_entry with
list_for_each_entry and list_for_each_entry_safe. list_for_each_entry is a
macro which is used to iterate over a list of given type. So while loop used to
iterate over a list can be replaced with list_for_each_entry macro. However, if
list_del is used in the loop, then list_for_each_entry_safe is a better choice.
This transformation is done by using the following coccinelle script.

@ rule1 @
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry;
@@

- while (list_empty(&E1) == 0)
+ list_for_each_entry (I1, &E1, I2)
 {
...when != T *I1;
-  I1 = list_entry(E1.next, T, I2);
    ...when != list_del(...);
       when != list_del_init(...);
 }

@ rule2  @
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@
   T *I1;
+  T *tmp;
  ...
- while (list_empty(&E1) == 0)
+ list_for_each_entry_safe (I1, tmp, &E1, I2)
 {
...when != T *I1;
-  I1 = list_entry(E1.next, T, I2);
    ...
 }

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: ft1000: Iterate list using list_for_each_entry
Somya Anand [Fri, 13 Mar 2015 19:33:07 +0000 (01:03 +0530)]
Staging: ft1000: Iterate list using list_for_each_entry

Code using doubly linked list is iterated generally  using list_empty and
list_entry functions, but it can be better written using list_for_each_entry
macro.

This patch replaces the while loop containing list_empty and list_entry with
list_for_each_entry and list_for_each_entry_safe. list_for_each_entry is a
macro which is used to iterate over a list of given type. So while loop used to
iterate over a list can be replaced with list_for_each_entry macro. However, if
list_del is used in the loop, then list_for_each_entry_safe is a better choice.
This transformation is done by using the following coccinelle script.

@ rule1 @
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry;
@@

- while (list_empty(&E1) == 0)
+ list_for_each_entry (I1, &E1, I2)
 {
...when != T *I1;
-  I1 = list_entry(E1.next, T, I2);
    ...when != list_del(...);
       when != list_del_init(...);
 }

@ rule2  @
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@
   T *I1;
+  T *tmp;
  ...
- while (list_empty(&E1) == 0)
+ list_for_each_entry_safe (I1, tmp, &E1, I2)
 {
...when != T *I1;
-  I1 = list_entry(E1.next, T, I2);
    ...
 }

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: i2o: Move assignment out of if statement
Somya Anand [Fri, 13 Mar 2015 17:23:11 +0000 (22:53 +0530)]
Staging: i2o: Move assignment out of if statement

Checkpatch.pl suggest to avoid assignment in if statement.

This patch moves assignments out of the if statement and place
it before the if statement. This is done using following coccinelle
script.

@@
expression E1;
identifier p;
statement S;
@@
- if ((p = E1))
+ p = E1;
+ if (p)
S

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: Remove unnecessary print messages
Vatika Harlalka [Fri, 13 Mar 2015 04:36:24 +0000 (10:06 +0530)]
Staging: fbtft: Remove unnecessary print messages

These print functions are called at the beginning
of the function and do not indicate any abnormal condition.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Simplify if condition
Ksenija Stanojevic [Thu, 12 Mar 2015 16:29:35 +0000 (17:29 +0100)]
Staging: rtl8192u: Simplify if condition

This patch removes macro true from if condition since variable
priv->ieee80211->LinkDetectInfo.bBusyTraffic is already of type bool.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rts5208: Use module_pci_driver
Vaishali Thakkar [Thu, 12 Mar 2015 12:06:15 +0000 (17:36 +0530)]
Staging: rts5208: Use module_pci_driver

Macro module_pci_driver is used for drivers whose init
and exit paths does only register and unregister to pci
API. So, here remove some boilerplate code by using
module_pci_driver. Also, change driver to rtsx_driver,
to avoid implicitly redefining driver_init.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: ft1000: Use module_pcmcia_driver
Vaishali Thakkar [Thu, 12 Mar 2015 11:58:54 +0000 (17:28 +0530)]
Staging: ft1000: Use module_pcmcia_driver

Macro module_pcmcia_driver is used for drivers whose init
and exit paths does only register and unregister to pcmcia
API. So, here remove some boilerplate code by using
module_pcmcia_driver.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: remove intialization of static ints
Supriya Karanth [Thu, 12 Mar 2015 04:26:20 +0000 (13:26 +0900)]
staging: rtl8723au: remove intialization of static ints

static ints are initialized to 0 by the compiler.
Explicit initialization is not necessary.

Found by checkpatch.pl - ERROR: do not initialise statics to 0 or NULL

changes made using coccinelle script:
@@
type T;
identifier var;
@@
static T var
- =0
;

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: i2o: remove intialization of static ints
Supriya Karanth [Thu, 12 Mar 2015 04:26:18 +0000 (13:26 +0900)]
staging: i2o: remove intialization of static ints

static ints are initialized to 0 by the compiler.
Explicit initialization is not necessary.

Found by checkpatch.pl - ERROR: do not initialise statics to 0 or NULL

changes made using coccinelle script:
@@
type T;
identifier var;
@@
static T var
- =0
;

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: dgap: Use setup_timer to combine initialization
Somya Anand [Wed, 11 Mar 2015 11:32:14 +0000 (17:02 +0530)]
Staging: dgap: Use setup_timer to combine initialization

The function setup_timer combines the initialization of a timer with the
initialization of the timer's function and data fields.

So, this patch combines the multiline code for timer initialization using the function
setup_timer. This issue is identified via coccinelle script.

@@
expression E1, E2, E3;
type T;
@@
- init_timer(&E1);
...
(
- E1.function = E2;
...
- E1.data = (T)E3;
+ setup_timer(&E1, E2, (T)E3);
|
- E1.data = (T)E3;
...
- E1.function = E2;
+ setup_timer(&E1, E2, (T)E3);
|
- E1.function = E2;
+ setup_timer(&E1, E2, 0);
)

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: use !x instead of x == NULL
Somya Anand [Mon, 16 Mar 2015 14:04:10 +0000 (19:34 +0530)]
Staging: iio: use !x instead of x == NULL

Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.

This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@

(
 x = devm_kzalloc(...);
|
 x = usb_alloc_urb(...);
|
 x = kmalloc_array(...);
|
 x = devm_ioremap(...);
|
 x = alloc_netdev(...);
)
 ...
- if(NULL == x)
+ if(!x)
        S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.

Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Use braces on all arms of if statement
Cristina Opriceana [Sat, 14 Mar 2015 18:54:04 +0000 (20:54 +0200)]
Staging: iio: Use braces on all arms of if statement

Add braces to improve consistency when using if statements.
Found by checkpatch.pl:
"CHECK: braces {} should be used on all arms of this statement".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Alignment should match open parenthesis
Cristina Opriceana [Sat, 14 Mar 2015 18:53:37 +0000 (20:53 +0200)]
Staging: iio: Alignment should match open parenthesis

This patch arranges multiple-line parameters in accordance with
the parameter above them to improve coding style.
Found by checkpatch.pl

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Do not use multiple blank lines
Cristina Opriceana [Sat, 14 Mar 2015 18:51:29 +0000 (20:51 +0200)]
Staging: iio: Do not use multiple blank lines

This patch removes unnecessary blank lines between functions.
Found by checkpatch.pl:
"CHECK: Please don't use multiple blank lines".

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Prefer using the BIT macro
Cristina Opriceana [Sat, 14 Mar 2015 18:51:12 +0000 (20:51 +0200)]
Staging: iio: Prefer using the BIT macro

This patch replaces bit shifting on 1 with the BIT(x) macro
as it's extensively used by other function in this driver.

This was done with coccinelle:
@@ int g; @@

-(1 << g)
+BIT(g)

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Remove explicit comparison to NULL
Cristina Opriceana [Sat, 14 Mar 2015 18:50:48 +0000 (20:50 +0200)]
Staging: iio: Remove explicit comparison to NULL

This patch simplifies pointer comparison to NULL and makes code
easier to read. Warning found by checkpatch.pl.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Remove space after type cast
Cristina Opriceana [Sat, 14 Mar 2015 18:50:23 +0000 (20:50 +0200)]
Staging: iio: Remove space after type cast

This patch removes unnecessary space after type casts.
Warning found by checkpatch.pl.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Simplify return logic
Cristina Opriceana [Thu, 12 Mar 2015 17:10:31 +0000 (19:10 +0200)]
Staging: iio: Simplify return logic

This patch removes the conditional return of the ade77*_probe functions
based on the return values of iio_device_register as the latter
returns 0 or ret, the same as the checked values.

Warning found by coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Remove parentheses around right side an assignment
Haneen Mohammed [Fri, 13 Mar 2015 17:47:22 +0000 (20:47 +0300)]
Staging: iio: Remove parentheses around right side an assignment

Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: ade7758: Remove braces on a single statement if
Taiane Coelho Ramos [Fri, 13 Mar 2015 19:22:44 +0000 (16:22 -0300)]
Staging: iio: ade7758: Remove braces on a single statement if

This patch fixes the checkpatch.pl warning:

WARNING: braces {} are not necessary for single
statement blocks

Signed-off-by: Taiane Coelho Ramos <exhora.tat@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu: Remove parentheses around right side an assignment
Haneen Mohammed [Fri, 13 Mar 2015 16:55:55 +0000 (19:55 +0300)]
Staging: rtl8188eu: Remove parentheses around right side an assignment

Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: remove break after return
Supriya Karanth [Fri, 13 Mar 2015 07:58:40 +0000 (16:58 +0900)]
staging: rtl8188eu: remove break after return

Remove "break" statement after a "return" statement as
it does not get executed.

Found by checkpatch.pl - break is not useful after a goto
or return

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>