OSDN Git Service

uclinux-h8/linux.git
9 years agostaging: rts5208: remove extra parentheses around left bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 06:19:24 +0000 (08:19 +0200)]
staging: rts5208: remove extra parentheses around left bit shift operation

Removes extra parentheses around bitwise left shift operations.
The case handled is when resultant value is assigned to a variable.
The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
<<
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
<<
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
<<
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: ozwpan: remove extra parentheses around left bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 06:18:47 +0000 (08:18 +0200)]
staging: ozwpan: remove extra parentheses around left bit shift operations

Removes extra parentheses around bitwise left shift operations.
The case handled is when resultant value is assigned to a variable.
The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
<<
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
<<
-c);
+c;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: remove extra parentheses around left bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 06:18:19 +0000 (08:18 +0200)]
staging: lustre: remove extra parentheses around left bit shift operations

Removes extra parentheses around bitwise left shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
<<
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
<<
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
<<
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: xgifb: remove extra parentheses around right bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 05:35:48 +0000 (07:35 +0200)]
staging: xgifb: remove extra parentheses around right bit shift operations

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: speakup: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:35:28 +0000 (07:35 +0200)]
staging: speakup: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The case handled is  when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: slicoss: remove extra parentheses around right bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 05:34:52 +0000 (07:34 +0200)]
staging: slicoss: remove extra parentheses around right bit shift operations

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: remove extra parentheses around right bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 05:34:07 +0000 (07:34 +0200)]
staging: rtl8723au: remove extra parentheses around right bit shift operations

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8712: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:33:39 +0000 (07:33 +0200)]
staging: rtl8712: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The cases handled are  when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:33:06 +0000 (07:33 +0200)]
staging: rtl8192u: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The cases handled are when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:32:30 +0000 (07:32 +0200)]
staging: rtl8192e: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The cases handled are  when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8188eu: remove extra parentheses around right bit shift operations
Aya Mahfouz [Wed, 4 Mar 2015 05:31:56 +0000 (07:31 +0200)]
staging: rtl8188eu: remove extra parentheses around right bit shift operations

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: media: lirc: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:31:19 +0000 (07:31 +0200)]
staging: media: lirc: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The case handled here is when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: media: bcm2048: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:30:49 +0000 (07:30 +0200)]
staging: media: bcm2048: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The case handled here is when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: llite: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:30:18 +0000 (07:30 +0200)]
staging: lustre: llite: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The case handled here is when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lclient: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:29:28 +0000 (07:29 +0200)]
staging: lustre: lclient: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when the resultant value is assigned
to a variable. The issue was detected and resolved using the
following coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: drivers: remove extra parentheses around right bit shift operation
Aya Mahfouz [Wed, 4 Mar 2015 05:28:48 +0000 (07:28 +0200)]
staging: comedi: drivers: remove extra parentheses around right bit shift operation

Removes extra parentheses around bitwise right shift operation.
The issue was detected and resolved using the following coccinelle
script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

t i =
-(e
+e
>>
-c);
+c;

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8712: Eliminate use of _init_timer
Vaishali Thakkar [Tue, 3 Mar 2015 17:04:22 +0000 (22:34 +0530)]
Staging: rtl8712: Eliminate use of _init_timer

This patch introduces the use of API function setup_timer
instead of driver specific function _init_timer as it is
the preferred and standard way to setup and set the timer.
To be compatible with the change, argument types of
referenced functions are changed. Also, definition of
function _init_timer is removed as it is no longer needed
after this change.

This is done using Coccinelle and semantic patch used for
this is as follows:

@@ expression x, y; identifier a, b;@@

- _init_timer (&x, y, a, b);
+ setup_timer (&x, a, (unsigned long)b);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: ieee80211: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)
Aya Mahfouz [Tue, 3 Mar 2015 14:08:38 +0000 (16:08 +0200)]
staging: rtl8192u: ieee80211: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The replacement was done by the
following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)
Aya Mahfouz [Tue, 3 Mar 2015 14:06:19 +0000 (16:06 +0200)]
staging: rtl8192u: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The replacement was done by the
following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)
Aya Mahfouz [Tue, 3 Mar 2015 14:04:20 +0000 (16:04 +0200)]
staging: rtl8192e: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The replacement was done by the
following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)
Aya Mahfouz [Tue, 3 Mar 2015 14:03:35 +0000 (16:03 +0200)]
staging: rtl8192e: replace memset(x,0,ETH_ALEN) by eth_zero_addr(x)

eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The replacement was done by the
following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Fix duplicate conditional branch
Vaishali Thakkar [Tue, 3 Mar 2015 07:39:23 +0000 (13:09 +0530)]
Staging: rtl8192u: Fix duplicate conditional branch

Replace duplicate branch with correct value. This branch
is supposed to work for low thresh value.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192e: Eliminate use of macro IS_NIC_DOWN
Vaishali Thakkar [Tue, 3 Mar 2015 07:38:24 +0000 (13:08 +0530)]
Staging: rtl8192e: Eliminate use of macro IS_NIC_DOWN

This patch eliminates use of unnecessory macro IS_NIC_DOWN
and replaces it with standard code.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192u: Fix quoted string split across lines
Dilek Uzulmez [Mon, 2 Mar 2015 21:56:54 +0000 (23:56 +0200)]
Staging: rtl8192u: Fix quoted string split across lines

This patch fixes checkpatch.pl warning in file ieee80211_crypt.c
WARNING: "quoted string split across lines warning"

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: remove initialization of static ints
Supriya Karanth [Tue, 3 Mar 2015 14:48:21 +0000 (23:48 +0900)]
staging: lustre: remove initialization 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;
+static T var;

Signed-off-by: Supriya Karanth <iskaranth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: Added define guards where needed
Cristina Opriceana [Wed, 4 Mar 2015 00:37:15 +0000 (02:37 +0200)]
Staging: iio: Added define guards where needed

The following files were added define guards to prevent multiple
inclusion.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: iio: meter: add check on return variables
Aya Mahfouz [Tue, 3 Mar 2015 14:27:37 +0000 (16:27 +0200)]
staging: iio: meter: add check on return variables

adds checks on variables that are used to return values. If
the value is less than zero, this indicates that an error
occurred and hence a message is printed through dev_err.
Checks are made on negative values only since spi_* functions
return negative error codes.

The functions were found using the following script but the
aforementioned modification was what was carried out in the end:
@@
identifier len,f;
@@

-int len;
 ... when != len
     when strict
-len =
+return
        f(...);
-return len;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: Remove if condition.
Navya Sri Nizamkari [Tue, 3 Mar 2015 11:38:06 +0000 (17:08 +0530)]
staging: comedi: Remove if condition.

This patch removes a if condition which has a semicolon
after it. As the conditional check is redundant, the comment
before it is also changed. The following
coccinelle script was used to detect the pattern of a
semicolon after if.

@r1@
position p;
@@
if (...);@p
@script:python@
p0 << r1.p;
@@
// Emacs org-mode output
cocci.print_main("", p0)
cocci.print_secs("", p0)

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lustre: libcfs: Replaced printk() with pr_err() and pr_cont()
Tina Johnson [Mon, 2 Mar 2015 18:10:26 +0000 (23:40 +0530)]
staging: lustre: lustre: libcfs: Replaced printk() with pr_err() and pr_cont()

The following checkpatch warning was fixed:

Prefer [subsystem eg: netdev]_err([subsystem]dev

with the help of Coccinelle. pr_cont() was used to replace those printk
statements which followed a printk that did not end with a '\n'. The following
semantic patch was used to replace printk() with pr_err():

@a@
expression e;
@@

printk(e,...);

@script:python b@
e << a.e;
y;
@@

import re
match = re.match('KERN_ERR ', e);
if (match == None):
    cocci.include_match(False)

else:
    m = re.sub('KERN_ERR ', '', e)
    coccinelle.y = m;

@c@
expression a.e;
identifier b.y;
@@

- printk(e,
+ pr_err(y,
  ...);

Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lustre: libcfs: Replaced printk() with pr_err()
Tina Johnson [Mon, 2 Mar 2015 18:10:25 +0000 (23:40 +0530)]
staging: lustre: lustre: libcfs: Replaced printk() with pr_err()

The following checkpatch warning was fixed:

Prefer [subsystem eg: netdev]_err([subsystem]dev

with the help of Coccinelle. The following semantic patch was used:

@a@
expression e;
@@

printk(e,...);

@script:python b@
e << a.e;
y;
@@

import re
match = re.match('KERN_ERR ', e);
if (match == None):
    cocci.include_match(False)

else:
    m = re.sub('KERN_ERR ', '', e)
    coccinelle.y = m;

@c@
expression a.e;
identifier b.y;
@@

- printk(e,
+ pr_err(y,
  ...);

Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: odm.c: Break some lines down to 80 characters
Jes Sorensen [Mon, 2 Mar 2015 20:25:03 +0000 (15:25 -0500)]
staging: rtl8723au: odm.c: Break some lines down to 80 characters

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_Write_DIG23A(): Cosmetic cleanups
Jes Sorensen [Mon, 2 Mar 2015 20:25:02 +0000 (15:25 -0500)]
staging: rtl8723au: ODM_Write_DIG23A(): Cosmetic cleanups

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Clean up odm_RefreshRateAdaptiveMask()
Jes Sorensen [Mon, 2 Mar 2015 20:25:01 +0000 (15:25 -0500)]
staging: rtl8723au: Clean up odm_RefreshRateAdaptiveMask()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Clean up FindMinimumRSSI()
Jes Sorensen [Mon, 2 Mar 2015 20:25:00 +0000 (15:25 -0500)]
staging: rtl8723au: Clean up FindMinimumRSSI()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Clean up odm_RSSIMonitorCheck()
Jes Sorensen [Mon, 2 Mar 2015 20:24:59 +0000 (15:24 -0500)]
staging: rtl8723au: Clean up odm_RSSIMonitorCheck()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_TXPowerTrackingCheck23a(): Remove no-op function
Jes Sorensen [Mon, 2 Mar 2015 20:24:58 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_TXPowerTrackingCheck23a(): Remove no-op function

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove write only bIsCurRDLState
Jes Sorensen [Mon, 2 Mar 2015 20:24:57 +0000 (15:24 -0500)]
staging: rtl8723au: Remove write only bIsCurRDLState

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove unused struct pri_cca
Jes Sorensen [Mon, 2 Mar 2015 20:24:56 +0000 (15:24 -0500)]
staging: rtl8723au: Remove unused struct pri_cca

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove unused struct odm_fat_t
Jes Sorensen [Mon, 2 Mar 2015 20:24:55 +0000 (15:24 -0500)]
staging: rtl8723au: Remove unused struct odm_fat_t

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove unused Funai TV hack
Jes Sorensen [Mon, 2 Mar 2015 20:24:54 +0000 (15:24 -0500)]
staging: rtl8723au: Remove unused Funai TV hack

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove write-only variable ControlChannel
Jes Sorensen [Mon, 2 Mar 2015 20:24:53 +0000 (15:24 -0500)]
staging: rtl8723au: Remove write-only variable ControlChannel

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: SupportInterface is always set to USB
Jes Sorensen [Mon, 2 Mar 2015 20:24:52 +0000 (15:24 -0500)]
staging: rtl8723au: SupportInterface is always set to USB

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove no-op ODM_CMNINFO_PLATFORM
Jes Sorensen [Mon, 2 Mar 2015 20:24:51 +0000 (15:24 -0500)]
staging: rtl8723au: Remove no-op ODM_CMNINFO_PLATFORM

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: odm_dtc(): Remove no-op function
Jes Sorensen [Mon, 2 Mar 2015 20:24:50 +0000 (15:24 -0500)]
staging: rtl8723au: odm_dtc(): Remove no-op function

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Make odm_PHY_SaveAFERegisters() readable
Jes Sorensen [Mon, 2 Mar 2015 20:24:49 +0000 (15:24 -0500)]
staging: rtl8723au: Make odm_PHY_SaveAFERegisters() readable

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove unused ODM ability flags
Jes Sorensen [Mon, 2 Mar 2015 20:24:48 +0000 (15:24 -0500)]
staging: rtl8723au: Remove unused ODM ability flags

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_RF_CALIBRATION is never set
Jes Sorensen [Mon, 2 Mar 2015 20:24:47 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_RF_CALIBRATION is never set

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_RF_TX_PWR_TRACK is always set
Jes Sorensen [Mon, 2 Mar 2015 20:24:46 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_RF_TX_PWR_TRACK is always set

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_BB_PWR_SAVE is unused
Jes Sorensen [Mon, 2 Mar 2015 20:24:45 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_BB_PWR_SAVE is unused

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_BB_CCK_PD is always set
Jes Sorensen [Mon, 2 Mar 2015 20:24:44 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_BB_CCK_PD is always set

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_BB_RSSI_MONITOR is always set
Jes Sorensen [Mon, 2 Mar 2015 20:24:43 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_BB_RSSI_MONITOR is always set

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_BB_FA_CNT is always set
Jes Sorensen [Mon, 2 Mar 2015 20:24:42 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_BB_FA_CNT is always set

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_BB_DYNAMIC_TXPWR isn't used for anything
Jes Sorensen [Mon, 2 Mar 2015 20:24:41 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_BB_DYNAMIC_TXPWR isn't used for anything

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_BB_DIG is always set
Jes Sorensen [Mon, 2 Mar 2015 20:24:40 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_BB_DIG is always set

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_BB_RA_MASK is always set
Jes Sorensen [Mon, 2 Mar 2015 20:24:39 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_BB_RA_MASK is always set

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: ODM_MAC_EDCA_TURBO is always set
Jes Sorensen [Mon, 2 Mar 2015 20:24:38 +0000 (15:24 -0500)]
staging: rtl8723au: ODM_MAC_EDCA_TURBO is always set

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Avoid zero initializing variables unnecessarily
Jes Sorensen [Mon, 2 Mar 2015 20:24:37 +0000 (15:24 -0500)]
staging: rtl8723au: Avoid zero initializing variables unnecessarily

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Variable bbtchange is always false
Jes Sorensen [Mon, 2 Mar 2015 20:24:36 +0000 (15:24 -0500)]
staging: rtl8723au: Variable bbtchange is always false

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: emxx_udc: Remove custom printk macro ERR
Haneen Mohammed [Mon, 2 Mar 2015 18:38:22 +0000 (21:38 +0300)]
Staging: emxx_udc: Remove custom printk macro ERR

This patch removes custom printk macro ERR.
All the calls to this macro were replaced by de_err and pr_err.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: emxx_udc: Replace custom printk macro ERR with dev_err or pr_err
Haneen Mohammed [Mon, 2 Mar 2015 18:37:38 +0000 (21:37 +0300)]
Staging: emxx_udc: Replace custom printk macro ERR with dev_err or pr_err

This patch removes the use of custom printk macros ERR and replace it
with dev_err, or pr_err in the following cases:
- if no appropriate struct device *dev field where found for dev_err.
- or dev could be null eg. "dev_err(udc->dev" not possible inside "if
  (udc == null)"
Issue addressed by checkpatch.pl.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: emxx_udc: Remove argument test from function
Haneen Mohammed [Mon, 2 Mar 2015 18:33:18 +0000 (21:33 +0300)]
Staging: emxx_udc: Remove argument test from function

This patch removes the test statement for an argument to  _nbu2ss_pullup
function, for it can't be null due to previous derefrences.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: emxx_udc: Fix do not add new typedefs and remove volatile
Haneen Mohammed [Mon, 2 Mar 2015 17:01:42 +0000 (20:01 +0300)]
Staging: emxx_udc: Fix do not add new typedefs and remove volatile

This patch fixes the following checkpatch.pl warnings:"do not add new
typedefs" and "Use of volatile is usually wrong".
Remove typedefs keyword and rename identifiers appropriately.
Remove volatile from union usb_regs_access
Update related  files.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: Remove unnecessary 'out of memory' message.
Dilek Uzulmez [Mon, 2 Mar 2015 21:28:14 +0000 (23:28 +0200)]
Staging: fbtft: Remove unnecessary 'out of memory' message.

This patch fixes checkpatch.pl warning in file fb_ssd1351.c
WARNING: Possible unnecessary 'out of memory' message

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft: Remove unnecessary 'out of memory' message.
Dilek Uzulmez [Mon, 2 Mar 2015 20:56:53 +0000 (22:56 +0200)]
Staging: fbtft: Remove unnecessary 'out of memory' message.

This patch fixes checkpatch.pl warning in file fbtft-core.c
WARNING: Possible unnecessary 'out of memory' message

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: fbtft-core: remove unnecessary line continuations
Yeliz Taneroglu [Mon, 2 Mar 2015 15:49:59 +0000 (17:49 +0200)]
Staging: fbtft-core: remove unnecessary line continuations

This fixes the checkpatch.pl warning:
WARNING: Avoid unnecessary line continuations

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: rtl8723a_hal_init.c: remove unnecessary braces
Daniele Alessandrelli [Sun, 22 Feb 2015 19:28:44 +0000 (20:28 +0100)]
staging: rtl8723au: rtl8723a_hal_init.c: remove unnecessary braces

Fix all checkpatch "braces {} are not necessary" warnings for
rtl8723au/hal/rtl8723a_hal_init.c

Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: MAX_AGGR_NUM is not used
Jes Sorensen [Fri, 27 Feb 2015 20:45:34 +0000 (15:45 -0500)]
staging: rtl8723au: MAX_AGGR_NUM is not used

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: The RF on an 8723au is always a 6052
Jes Sorensen [Fri, 27 Feb 2015 20:45:33 +0000 (15:45 -0500)]
staging: rtl8723au: The RF on an 8723au is always a 6052

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove rf type from struct hal_version
Jes Sorensen [Fri, 27 Feb 2015 20:45:32 +0000 (15:45 -0500)]
staging: rtl8723au: Remove rf type from struct hal_version

This gets rid of yet another duplicated copy of the RF type

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Be more consistent in checking for 2 TX paths
Jes Sorensen [Fri, 27 Feb 2015 20:45:31 +0000 (15:45 -0500)]
staging: rtl8723au: Be more consistent in checking for 2 TX paths

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: No need for two copies of rf_type
Jes Sorensen [Fri, 27 Feb 2015 20:45:30 +0000 (15:45 -0500)]
staging: rtl8723au: No need for two copies of rf_type

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Firmware always handles adaptive rates
Jes Sorensen [Mon, 9 Feb 2015 22:52:21 +0000 (17:52 -0500)]
staging: rtl8723au: Firmware always handles adaptive rates

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: hal_com.h: Remove some unused #defines
Jes Sorensen [Mon, 9 Feb 2015 22:52:20 +0000 (17:52 -0500)]
staging: rtl8723au: hal_com.h: Remove some unused #defines

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Remove more unused #defines
Jes Sorensen [Mon, 9 Feb 2015 22:52:19 +0000 (17:52 -0500)]
staging: rtl8723au: Remove more unused #defines

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: rtl8723a_add_rateatid() simplyfy code
Jes Sorensen [Mon, 9 Feb 2015 22:52:18 +0000 (17:52 -0500)]
staging: rtl8723au: rtl8723a_add_rateatid() simplyfy code

No point shifting raid right, just to shift it left again before
re-adding it.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: rates are always set via the firmware interface
Jes Sorensen [Mon, 9 Feb 2015 22:52:17 +0000 (17:52 -0500)]
staging: rtl8723au: rates are always set via the firmware interface

The only case where fw_ractrl = false was when the firmware failed to
load, and in that case we are dead in the water anyway.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: Use RF_AC instead of hardcoded value for RF register write
Jes Sorensen [Mon, 9 Feb 2015 22:52:16 +0000 (17:52 -0500)]
staging: rtl8723au: Use RF_AC instead of hardcoded value for RF register write

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/llite: Fix obd name after c&p error
Oleg Drokin [Tue, 3 Mar 2015 07:39:36 +0000 (02:39 -0500)]
staging/lustre/llite: Fix obd name after c&p error

commit 95745e9b1de2 ("staging: lustre: Use kasprintf.") introduced
a copy and paste error causing two different obd types to be assigned
same content causing lustre to fail on mount with a warning from procfs
followed by a bizzare error about OST not having enough MDS
capabilities.

This patch unbreaks Lustre client again.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
CC: Navya Sri Nizamkari <navyasri.tech@gmail.com>
CC: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: Convert uses of "int rc = seq_printf(...)"
Joe Perches [Mon, 2 Mar 2015 03:58:57 +0000 (19:58 -0800)]
staging: lustre: Convert uses of "int rc = seq_printf(...)"

The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Convert these uses to:

seq_printf(seq, ...);

return 0;

Done via cocci script:

@@
struct seq_file *seq;
int i;
@@
- i = seq_printf(seq,
+ seq_printf(seq,
   ...);
...
- return i;
+ return 0;

@@
struct seq_file *seq;
int i;
@@
- i = 0;
- i += seq_printf(seq,
+ seq_printf(seq,
           ...);
...
- return i;
+ return 0;

With some additional reformatting and typing post conversion
to remove the now unnecessary "int i;" declaration.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: meter: ade7854-i2c: code style improvements
Tolga Ceylan [Sun, 15 Feb 2015 04:32:45 +0000 (20:32 -0800)]
Staging: iio: meter: ade7854-i2c: code style improvements

Code reformatting based on checkpatch.pl with --strict:
Comparison to NULL rewritten as !indio_dev

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: meter: ade7854-i2c: code style improvements
Tolga Ceylan [Sun, 15 Feb 2015 04:32:44 +0000 (20:32 -0800)]
Staging: iio: meter: ade7854-i2c: code style improvements

Code reformatting based on checkpatch.pl with --strict:
Lines over 80 characters were fixed

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: iio: meter: ade7854-i2c: code style improvements
Tolga Ceylan [Sun, 15 Feb 2015 04:32:43 +0000 (20:32 -0800)]
Staging: iio: meter: ade7854-i2c: code style improvements

Code reformatting based on checkpatch.pl with --strict:
Alignment should match open paranthesis cases corrected

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: adl_pci6208: support old PLX device ID
Ian Abbott [Fri, 27 Feb 2015 15:07:37 +0000 (15:07 +0000)]
staging: comedi: adl_pci6208: support old PLX device ID

ADLINK's MS Windows drivers for the PCI-6208/6216 boards include the
following line in the DDInstall secion of the INF file:

%String6208%=DriverInstall6208.NT,PCI\VEN_10B5&DEV_9050&SUBSYS_62089999

That's for a PLX PCI 9050/9052 PCI interface chip with custom subvendor
and subdevice ID.  The "%String6208%" macro expands to "ADLINK PCI-6208"
in the INF file.

Add a corresponding entry to this driver module's PCI device table.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: adl_pci6208: remove multiple board type support
Ian Abbott [Fri, 27 Feb 2015 15:07:36 +0000 (15:07 +0000)]
staging: comedi: adl_pci6208: remove multiple board type support

This driver module now only supports a single board type, so remove the
infrastructure for describing multiple board types.  The comedi
"auto_attach" handler, `pci6208_auto_attach()` doesn't need to set the
comedi device's `board_name` or `board_ptr` members.  The former is
automatically pointed to the comedi driver's `driver_name` by the core
comedi module, and the latter is not used anywhere else.  The AO
subdevice's `n_chans` member can be set to 16 without looking it up in
the single element of `pci6208_boards[]`.  There is no need to pass a
board index from the PCI device table to the "auto_attach" handler.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: adl_pci6208: combine PCI-6208 and PCI-6216 support
Ian Abbott [Fri, 27 Feb 2015 15:07:35 +0000 (15:07 +0000)]
staging: comedi: adl_pci6208: combine PCI-6208 and PCI-6216 support

This module's PCI device table has separate PCI device IDs for PCI-6208
and PCI-6216, but in reality, both boards and their cPCI and PCIe
variants seem to have the same PCI device ID: 0x6208.  The PCI subdevice
ID doesn't seem to help either.

It shouldn't do any harm to claim 16 AO channels for all devices
supported by this driver.  The original PCI-6216 is just a PCI-6208 with
a daughter board providing the extra DACs.  The data is clocked out to
the DACs serially with no acknowledgment.  I assume this would still
happen when the DACs for the upper 8 channels are missing.  Therefore,
change the driver to support a single board type with 16 AO channels,
and remove the suspicious PCI device ID for the PCI-6216.

Evidence about lack of a separate PCI device ID for PCI-6216 follows....

1. Jesus Vasquez reports the following lspci output for a PCIe-6216 on
his Ubuntu 12.04 system:

lspci -n -vvv
07:00.0 1180: 144a:6208 (rev 02)
        Subsystem: 144a:6208
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
        Region 0: Memory at f6000000 (32-bit, non-prefetchable)
[size=128]
        Region 1: I/O ports at c100 [size=128]
        Region 2: I/O ports at c000 [size=256]
        Kernel driver in use: adl_pci6208
        Kernel modules: adl_pci6208

That system's "adl_pci6208" module only has the single PCI device ID for
the PCI-6208, but works for his PCIe-6216 except that it only supports 8
analog output channels instead of 16.

2. ADLINK's binary Linux module "pci6208.ko" (there is no separate
module for the PCI-6216) has a single alias:

  alias: pci:v0000144Ad00006208sv*sd*bc*sc*i*

3. The MS Windows drivers include this set of hardware IDs for the
PCI-6208 series, with nothing more specific for the PCI-6216 (they are
all tied to the same name "ADLINK PCI-6208" and there is no mention of
PCI-6216):

  PCI\VEN_10B5&DEV_9050&SUBSYS_62089999
  PCI\VEN_144A&DEV_6208&SUBSYS_6208144A
  PCI\VEN_144A&DEV_6208&SUBSYS_62089999
  PCI\VEN_144A&DEV_6208&SUBSYS_C208144A
  PCI\VEN_144A&DEV_6208&SUBSYS_C20855AA
  PCI\VEN_144A&DEV_6208

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcimdas: add 8254 timer (pacer) support
H Hartley Sweeten [Thu, 26 Feb 2015 22:43:55 +0000 (15:43 -0700)]
staging: comedi: cb_pcimdas: add 8254 timer (pacer) support

The hardware has an 8254 timer/counter. Channe; 0 is available as a
generic counter/timer with the clock, gate, and output signals all
availabe on the main 37 pin connector. Channels 1 and 2 are used for
the pacer.

Add support for the 8254 timer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcimdas: add main connector digital input/output
H Hartley Sweeten [Wed, 25 Feb 2015 23:28:43 +0000 (16:28 -0700)]
staging: comedi: cb_pcimdas: add main connector digital input/output

Add subdevices for the 4 digital input and 4 digital output channels on
the main connector of the board.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcimdas: tidy up cb_pcimdas_auto_attach()
H Hartley Sweeten [Wed, 25 Feb 2015 23:28:42 +0000 (16:28 -0700)]
staging: comedi: cb_pcimdas: tidy up cb_pcimdas_auto_attach()

For aesthetics, add some whitespace to the subdevice init.

Remove the unnecessary comments as well as the initialization of the
analog input subdevice 'len_chanlist'. That member is only used by
subdevices that support async commands.

For aesthetics, rename the analog input subdevice (*insn_read) function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcimdas: provide analog output range table
H Hartley Sweeten [Wed, 25 Feb 2015 23:28:41 +0000 (16:28 -0700)]
staging: comedi: cb_pcimdas: provide analog output range table

The analog output range is not programmable. The DAC ranges are
jumper-settable on the board. For aesthetics, provide a range table
for the user with all possible ranges.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcimdas: define the register map
H Hartley Sweeten [Wed, 25 Feb 2015 23:28:40 +0000 (16:28 -0700)]
staging: comedi: cb_pcimdas: define the register map

Add defines for the registers and bits. Use the defines to remove the
"magic" numbers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcimdas: support analog input programmable ranges
H Hartley Sweeten [Wed, 25 Feb 2015 23:28:39 +0000 (16:28 -0700)]
staging: comedi: cb_pcimdas: support analog input programmable ranges

The hardware uses a switch on the board to select if the analog inputs
are bipolar or uinipolar. The gain is programmable to allow the following
input ranges:

  Gain  Bipolar   Unipolar
    0   +/-10V    0 to 10V
    1   +/-5V     0 to 5V
    2   +/-2.5V   0 to 2.5V
    3   +/-1.25V  0 to 1.25V

Add the necessary code to the driver to allow the user to select the
desired range.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: cb_pcimdas: fix analog input channel configuration
H Hartley Sweeten [Wed, 25 Feb 2015 23:28:38 +0000 (16:28 -0700)]
staging: comedi: cb_pcimdas: fix analog input channel configuration

The hardware uses a switch on the board to set the number of analog
input channels to either 16 single-ended or 8 differential channels.
Currently the switch setting is checked for every (*insn_read) operation
to validate the channel number.

Check the switch setting during the driver attach and initialize the
subdevice accordingly. This allows the core to handle the validation.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: 8253.h: remove unused header
H Hartley Sweeten [Mon, 23 Feb 2015 21:58:03 +0000 (14:58 -0700)]
staging: comedi: 8253.h: remove unused header

All the comedi drivers have been converted to use the comedi_8254 module
to provide support for the 8254 timers. Remove this unused header.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ni_labpc_common: convert driver to use the comedi_8254 module
H Hartley Sweeten [Mon, 23 Feb 2015 21:58:02 +0000 (14:58 -0700)]
staging: comedi: ni_labpc_common: convert driver to use the comedi_8254 module

This driver uses an 8254 timer to generate the pacer clock used for analog
input data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.

The hardware actually has two 8254 devices. Timer B0 is the master for timed
conversions, timer B1 sets the scan pacing, and tmer A0 sets the conversion
pacing.

For the conversion, dev->pacer is used for the "B" timers and a new private
data member, dev->counter, is used for the "A" timers. All the divisor values
are stored in the dev->pacer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: amplc_dio200_common: convert driver to use the comedi_8254 module
H Hartley Sweeten [Tue, 24 Feb 2015 17:38:49 +0000 (10:38 -0700)]
staging: comedi: amplc_dio200_common: convert driver to use the comedi_8254 module

Convert this driver to use the comedi_8254 module to provide the 8254 timer support.

Add 'clock_src' and 'gate_src' members to the comedi_8254 data for convienence.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: amplc_dio200_common: remove 'spinlock' from struct dio200_subdev_8254
H Hartley Sweeten [Mon, 23 Feb 2015 21:58:00 +0000 (14:58 -0700)]
staging: comedi: amplc_dio200_common: remove 'spinlock' from struct dio200_subdev_8254

Currently this driver uses a spinlock in the 8254 subdevice (*insn_read), (*insn_write),
and (*insn_config) functions. The comedi core checks if the subdevice is 'busy', in
parse_insn(), before any of the subdevice functions are attempted.

Remove the unnecessary spinlock.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: amplc_dio200_common: remove unnecessary 'counter_number' checks
H Hartley Sweeten [Mon, 23 Feb 2015 21:57:59 +0000 (14:57 -0700)]
staging: comedi: amplc_dio200_common: remove unnecessary 'counter_number' checks

The 'counter_number' in these functions is the comedi channel number from the
chanspec. The comedi core validates the chanspec before calling the driver
functions. Remove the unnecessary checks.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: amplc_dio200_common: remove 'which' from struct dio200_subdev_8254
H Hartley Sweeten [Mon, 23 Feb 2015 21:57:58 +0000 (14:57 -0700)]
staging: comedi: amplc_dio200_common: remove 'which' from struct dio200_subdev_8254

This member is only used in the "set gate" and "set clock" helper functions. Remove
it and calculate the value when needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: amplc_dio200_common: remove 'gat_sce_ofs' from struct dio200_subdev_8254
H Hartley Sweeten [Mon, 23 Feb 2015 21:57:57 +0000 (14:57 -0700)]
staging: comedi: amplc_dio200_common: remove 'gat_sce_ofs' from struct dio200_subdev_8254

This member is only used one place in the driver. Remove it and calculate the
register offset when needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: amplc_dio200_common: remove 'clk_sce_ofs' from struct dio200_subdev_8254
H Hartley Sweeten [Mon, 23 Feb 2015 21:57:56 +0000 (14:57 -0700)]
staging: comedi: amplc_dio200_common: remove 'clk_sce_ofs' from struct dio200_subdev_8254

This member is only used one place in the driver. Remove it and calculate the
register offset when needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>