]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
9 years agostaging: comedi: me4000: tidy up ME4000_AO_CTRL_REG bit defines
H Hartley Sweeten [Wed, 5 Aug 2015 17:45:02 +0000 (10:45 -0700)]
staging: comedi: me4000: tidy up ME4000_AO_CTRL_REG bit defines

Use the BIT() marco to define the bits of this register.

For aesthetics, rename all the defines to remove the '_BIT' from the
name.

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: me4000: tidy up ME4000_AO_STATUS_REG bit defines
H Hartley Sweeten [Wed, 5 Aug 2015 17:45:01 +0000 (10:45 -0700)]
staging: comedi: me4000: tidy up ME4000_AO_STATUS_REG bit defines

Use the BIT() marco to define the bits of this register.

For aesthetics, rename all the defines to remove the '_BIT' from the
name.

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: me4000: tidy up ME4000_IRQ_STATUS_REG bit defines
H Hartley Sweeten [Wed, 5 Aug 2015 17:45:00 +0000 (10:45 -0700)]
staging: comedi: me4000: tidy up ME4000_IRQ_STATUS_REG bit defines

Use the BIT() marco to define the bits of this register.

For aesthetics, rename all the defines to remove the '_BIT' from the
name.

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: me4000: tidy up ME4000_AI_CTRL_REG bit defines
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:59 +0000 (10:44 -0700)]
staging: comedi: me4000: tidy up ME4000_AI_CTRL_REG bit defines

Use the BIT() marco to define the bits of this register.

For aesthetics, rename all the defines to remove the '_BIT' from the
name.

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: me4000: tidy up ME4000_AI_STATUS_REG bit defines
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:58 +0000 (10:44 -0700)]
staging: comedi: me4000: tidy up ME4000_AI_STATUS_REG bit defines

Use the BIT() marco to define the bits of this register.

For aesthetics, rename all the defines to remove the '_BIT' from the
name. Also, use ME4000_AI_STATUS_REG instead of ME4000_AI_CTRL_REG
when reading the register (they happen to be the same).

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: me4000: use comedi_range_is_bipolar() in ai (*insn_read)
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:57 +0000 (10:44 -0700)]
staging: comedi: me4000: use comedi_range_is_bipolar() in ai (*insn_read)

Use the helper function to check the range type instead of relying on the
value. For aesthetics, rename the local variable used for the 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: me4000: use correct types for extracted chanspec values
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:56 +0000 (10:44 -0700)]
staging: comedi: me4000: use correct types for extracted chanspec values

The chanspec channel, range, and aref are unsigned int values. Use the
correct types when extracting them.

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: me4000: fix me4000_ai_insn_read()
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:55 +0000 (10:44 -0700)]
staging: comedi: me4000: fix me4000_ai_insn_read()

The coemdi (*insn_read) functions are supposed to read insn->n values
from the hardware. Make this function work like the core expects.

Use the comedi_offset_munge() helper to munge the two's complement
values to offset binary.

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: me4000: use comedi_timeout() to wait for ai (*insn_read)
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:54 +0000 (10:44 -0700)]
staging: comedi: me4000: use comedi_timeout() to wait for ai (*insn_read)

Use the comedi_timeout() helper to busy-wait for the analog input end-of-
conversion instead of the udelay().

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: me4000: tidy up ME4000_AI_CHANNEL_LIST_REG bit defines
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:53 +0000 (10:44 -0700)]
staging: comedi: me4000: tidy up ME4000_AI_CHANNEL_LIST_REG bit defines

Use the BIT() macro to define the bits of this register.

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: me4000: fix ai_write_chanlist()
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:52 +0000 (10:44 -0700)]
staging: comedi: me4000: fix ai_write_chanlist()

Rename this function so it has namespace associated with the driver.

The last entry of the chanlist needs the ME4000_AI_LIST_LAST_ENTRY bit
set to end the list. Fix the function and tidy if up a bit.

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: me4000: simplify analog input range programming
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:51 +0000 (10:44 -0700)]
staging: comedi: me4000: simplify analog input range programming

The comedi_lrange table for the analog inputs is inverted compared
to the values that need to be written to the ME4000_AI_CHANNEL_LIST_REG
to select the range.

Create a macro, ME4000_AI_LIST_RANGE(), to handle the inversion. Remove
the old defines and simplify the code a bit.

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: me4000: remove unnecessary ME4000_AI_LIST_INPUT_SINGLE_ENDED
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:50 +0000 (10:44 -0700)]
staging: comedi: me4000: remove unnecessary ME4000_AI_LIST_INPUT_SINGLE_ENDED

This define evaluates to 0 and is OR'ed with the 'entry' value that is
written to the ME4000_AI_CHANNEL_LIST_REG when the channel aref is a
single-ended type (AREF_GROUND or AREF_COMMON). OR'ing a zero value is
pretty silly, just remove it.

Remove the switch() in me4000_ai_insn_read() to simplify the code.

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: me4000: rename local variables used for 'dev->private'
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:49 +0000 (10:44 -0700)]
staging: comedi: me4000: rename local variables used for 'dev->private'

In comedi drivers the local variable used for the dev->private pointer is
normally named 'devpriv'. For aesthetics, rename the variables in this
driver. Also, rename the struct to follow the norm.

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: me4000: refactor 'ai_sh_nchan' boardinfo
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:48 +0000 (10:44 -0700)]
staging: comedi: me4000: refactor 'ai_sh_nchan' boardinfo

Some of the boards supported by this driver can do analog input sample &
hold on 8 of the channels. The 'ai_sh_nchan' member of the boardinfo is
used to indicate which boards support this feature. To save a bit of space,
convert this member to a bit-field, 'can_do_sh_ai'. Note, this feature is
not currently supported.

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: me4000: refactor 'ao_fifo' boardinfo
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:47 +0000 (10:44 -0700)]
staging: comedi: me4000: refactor 'ao_fifo' boardinfo

This member of the boardinfo is always '4' for the boards that have an
analog output FIFO. Covert it to a bit-field, 'has_ao_fifo', to save a
bit of space.

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: me4000: refactor 'ao_nchan' boardinfo
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:46 +0000 (10:44 -0700)]
staging: comedi: me4000: refactor 'ao_nchan' boardinfo

For the boards that have analog output capability, there are always
4 analog output channels. Convert the 'ao_nchan' member of the boardinfo
into a bit-field, 'has_ao', to save a bit of space and set the analog
output subdevice 'n_chan' to 4 when supported.

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: me4000: refactor 'ai_diff_nchan' boardinfo
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:45 +0000 (10:44 -0700)]
staging: comedi: me4000: refactor 'ai_diff_nchan' boardinfo

This member of the boardinfo is only used as a flag indicating that the
board supports differential analog inputs. Convert the member to a bit-
field to save a bit of space. For aesthetics, rename the member to
'can_do_diff_ai'.

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: me4000: make boardinfo flags bit-fields
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:44 +0000 (10:44 -0700)]
staging: comedi: me4000: make boardinfo flags bit-fields

Change the boardinfo 'has_counter' and 'ai_trig_analog' flags into
bit-fields to save a bit of space.

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: me4000: remove 'board' from me4000_ai_check_chanlist()
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:43 +0000 (10:44 -0700)]
staging: comedi: me4000: remove 'board' from me4000_ai_check_chanlist()

The maximum differential channel is half the subdevice 'n_chan'. Use
that instead and remove the need for the 'board' variable.

Also, the comedi core does no validate the aref flags. Add a check
to ensure that the subdevice actually supports the AREF_DIFF mode.

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: me4000: remove 'board' from me4000_ai_insn_read()
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:42 +0000 (10:44 -0700)]
staging: comedi: me4000: remove 'board' from me4000_ai_insn_read()

The 'board' pointer is only used in this function to verify that the
'chan' is valid for an aref of AREF_DIFF. For differential inputs, the
maximum channel is half the subdevice 'n_chan'. Use that instead and
remove the 'board' variable.

Also, the comedi core does not validate the aref flags. Add a check
to ensure that the subdevice actually supports the AREF_DIFF mode.

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: me4000: remove 'chan' check in me4000_ai_insn_read()
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:41 +0000 (10:44 -0700)]
staging: comedi: me4000: remove 'chan' check in me4000_ai_insn_read()

The comedi core validates that the 'chan' is valid for the subdevice
before calling the (*insn_read) operation. Remove the unnecessary check.

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: me4000: only set SDF_DIFF when supported
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:40 +0000 (10:44 -0700)]
staging: comedi: me4000: only set SDF_DIFF when supported

Some of the boards supported by this driver do not have differential analog
inputs. Only set the SDF_DIFF subdev_flag when the board supports it.

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: me4000: all board types have analog inputs
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:39 +0000 (10:44 -0700)]
staging: comedi: me4000: all board types have analog inputs

All the boards supported by this driver have analog inputs. They just
differ in the number of channels (32 or 16).

Always initialize the analog input subdevice in me4000_auto_attach().

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: me4000: remove 'dio_nchan' boardinfo
H Hartley Sweeten [Wed, 5 Aug 2015 17:44:38 +0000 (10:44 -0700)]
staging: comedi: me4000: remove 'dio_nchan' boardinfo

All the boards supported by this driver have 32 digital I/O channels.
Remove the unnecessary boardinfo.

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 agowilc1000: wilc_wfi_cfgoperations.c: Fixed initialization of global boolean.
Daniel Machon [Tue, 4 Aug 2015 22:09:35 +0000 (00:09 +0200)]
wilc1000: wilc_wfi_cfgoperations.c: Fixed initialization of global boolean.

Globals are initialized to zero or NULL by GCC. No need to explicitly initialize them.

Signed-off-by: Daniel Machon <dmachon.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: Fix style warning on header
Miguel Bernabeu Diaz [Wed, 5 Aug 2015 20:33:23 +0000 (22:33 +0200)]
staging: lustre: Fix style warning on header

Fix checkpatch.pl warning:
WARNING: Use #include <linux/io.h> instead of <asm/io.h>

Signed-off-by: Miguel Bernabeu Diaz <miguelbernadi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: obdclass: Use kasprintf
Shraddha Barke [Tue, 4 Aug 2015 20:22:45 +0000 (01:52 +0530)]
Staging: lustre: obdclass: Use kasprintf

This patch uses kasprintf which combines kzalloc and sprintf.
kasprintf also takes care of the size calculation.

Semantic patch used is as follows:

@@
expression a,flag;
expression list args;
statement S;
@@

 a =
- \(kmalloc\|kzalloc\)(...,flag)
+ kasprintf (flag,args)
  <... when != a
  if (a == NULL || ...) S
  ...>
- sprintf(a,args);

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: mgc: Replace comma with a semicolon
Shraddha Barke [Tue, 4 Aug 2015 17:50:51 +0000 (23:20 +0530)]
Staging: lustre: mgc: Replace comma with a semicolon

Replace comma between expression statements by a semicolon.
The semantic patch used is as follows:

@@
expression e1,e2;
@@
e1
- ,
+ ;
e2;

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: netlogic: Replace comma with a semicolon
Shraddha Barke [Tue, 4 Aug 2015 17:50:52 +0000 (23:20 +0530)]
Staging: netlogic: Replace comma with a semicolon

Replace comma between expression statements by a semicolon.
The semantic patch used is as follows:

@@
expression e1,e2;
@@
e1
- ,
+ ;
e2;

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: libcfs: Replace comma with a semicolon
Shraddha Barke [Tue, 4 Aug 2015 17:50:50 +0000 (23:20 +0530)]
Staging: lustre: libcfs: Replace comma with a semicolon

Replace comma between expression statements by a semicolon.
The semantic patch used is as follows:

@@
expression e1,e2;
@@
e1
- ,
+ ;
e2;

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: osc: Drop unnecessary cast on void *
Shraddha Barke [Tue, 4 Aug 2015 17:32:34 +0000 (23:02 +0530)]
Staging: lustre: osc: Drop unnecessary cast on void *

 This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: lov: Drop unnecessary cast on void *
Shraddha Barke [Tue, 4 Aug 2015 17:32:35 +0000 (23:02 +0530)]
Staging: lustre: lov: Drop unnecessary cast on void *

This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: libcfs: Drop unnecessary cast on void*
Shraddha Barke [Tue, 4 Aug 2015 17:32:33 +0000 (23:02 +0530)]
Staging: lustre: libcfs: Drop unnecessary cast on void*

This patch does away with the cast on void * as it is unnecessary.

Semantic patch used is as follows:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic: Convert to using napi
Neil Horman [Tue, 4 Aug 2015 19:09:47 +0000 (15:09 -0400)]
staging: unisys: visornic: Convert to using napi

Switch the visornic over to use napi.  Currently there is a kernel
thread that sits and waits on a wait queue to get notified of incoming
virtual interrupts. It would be nice if we could handle frame reception
using the standard napi processing instead.  This patch creates our napi
instance and has the rx thread schedule it

Given that the unisys hypervisor currently requires that queue servicing
be done by a polling loop that wakes up every 2ms, lets instead also
convert that to a timer, which is simpler, and allows us to remove all
the thread starting and stopping code.

Signed-off-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrivers: staging: wilc1000: remove space after '('
Chandra S Gorentla [Wed, 5 Aug 2015 16:41:57 +0000 (22:11 +0530)]
drivers: staging: wilc1000: remove space after '('

The character ' ' is removed after the character '('.  This fixes the
checkpatch.pl error - "space prohibited after that open
parenthesis '('".

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrivers: staging: wilc1000: use 'void' for no arguments functions
Chandra S Gorentla [Wed, 5 Aug 2015 16:41:55 +0000 (22:11 +0530)]
drivers: staging: wilc1000: use 'void' for no arguments functions

Added 'void' keyword in the paranthesis of function definitions, when
there are no arguments to the functions.  This fixes the checkpatch.pl
error - "Bad function definition 'function()' should probably be
function(void)".

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_cfgoperations.c: Fixed coding styles issues.
Daniel Machon [Wed, 5 Aug 2015 06:18:31 +0000 (08:18 +0200)]
staging: wilc1000: wilc_cfgoperations.c: Fixed coding styles issues.

Fixed coding styles issues with braces.

Signed-off-by: Daniel Machon <dmachon.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: wilc1000: Remove typedefs for struct
Shraddha Barke [Tue, 4 Aug 2015 19:59:22 +0000 (01:29 +0530)]
Staging: wilc1000: Remove typedefs for struct

The Linux kernel coding style guidelines suggest not using typedefs for
structure and enum types. This patch gets rid of the typedefs for
Ack_session_info_t.

The following Coccinelle semantic patch detects the cases for struct type:

@tn@
identifier i;
type td;
@@

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

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

-td
+ struct i

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: iio_simple_dummy: Fix indentation errors
Lars Svensson [Wed, 5 Aug 2015 12:15:12 +0000 (14:15 +0200)]
staging: iio_simple_dummy: Fix indentation errors

Fixing indentation errors in
drivers/staging/iio/iio_simple_dummy_events.c.

Signed-off-by: Lars Svensson <lars1.svensson@sonymobile.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: Fixed C99 style comment to C89 style.
Lior Pugatch [Tue, 4 Aug 2015 19:18:04 +0000 (22:18 +0300)]
staging: vt6655: Fixed C99 style comment to C89 style.

Patch created to satisfy checkpatch.pl

Signed-off-by: Lior Pugatch <buzz5800@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8723au: fix up coding style warnings reported by checkpatch.pl.
Ting-Chih Hsiao [Tue, 4 Aug 2015 03:21:10 +0000 (11:21 +0800)]
staging: rtl8723au: fix up coding style warnings reported by checkpatch.pl.

remove spaces at the start of a line
align enum variable with other parameters

Signed-off-by: Ting-Chih Hsiao <s894330@hotmail.com>
Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Properly reference kthread_run instead of cfs_daemonize
Oleg Drokin [Tue, 4 Aug 2015 01:57:45 +0000 (21:57 -0400)]
staging/lustre: Properly reference kthread_run instead of cfs_daemonize

cfs_daemonize is long gone and replaced by a proper call to kthread_run,
so update the comment to reflect that fact.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre/ptlrpc: Remove stray cfs_daemonize comment
Oleg Drokin [Tue, 4 Aug 2015 01:57:44 +0000 (21:57 -0400)]
staging/lustre/ptlrpc: Remove stray cfs_daemonize comment

Ever since daemonize was removed in 3.18, there are no longer
any flags passed to kthread_run.
Most of the comments were deleted, but this one lingered on
until now.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: improve comedi_check_chanlist() documentation
Ian Abbott [Wed, 5 Aug 2015 17:13:26 +0000 (18:13 +0100)]
staging: comedi: improve comedi_check_chanlist() documentation

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: do not return -ENOSYS.
Ted Chen [Tue, 4 Aug 2015 17:18:46 +0000 (01:18 +0800)]
staging: comedi: do not return -ENOSYS.

fixed coding style issue by replacing ENOSYS
with EIO because it means 'invalid syscall nr'
and nothing else.

Signed-off-by: Ted Chen <tedc.37zngo@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: android: timed_gpio.c: fix coding style errors
Jandy Gou [Wed, 5 Aug 2015 02:09:02 +0000 (10:09 +0800)]
Staging: android: timed_gpio.c: fix coding style errors

remove extra space and replace tab to space after a variable

Signed-off-by: Jandy Gou <qingsong.gou@ck-telecom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8188eu/core: fixed code indentation warning as reported by checkpatch.pl
Mayank Bareja [Mon, 3 Aug 2015 11:23:01 +0000 (11:23 +0000)]
Staging: rtl8188eu/core: fixed code indentation warning as reported by checkpatch.pl

fixed code indentation warning as detected with checkpatch.pl.
Replaced spaces with tabs.

Signed-off-by: Mayank Bareja <mbareja@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rts5208: Fix code indentation warning as detected by checkpatch.pl
Yash Shah [Mon, 3 Aug 2015 11:18:31 +0000 (11:18 +0000)]
Staging: rts5208: Fix code indentation warning as detected by checkpatch.pl

Fixed code indentation warning as detected by checkpatch.pl.

Signed-off-by: Yash Shah <yshah1@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: service.c: make local functions static
Zoltán Lajos Kis [Sun, 2 Aug 2015 20:36:31 +0000 (22:36 +0200)]
staging: lustre: service.c: make local functions static

Makes functions that are not used outside the file in which they are defined
static, as reported by sparse:

drivers/staging/lustre/lustre/ptlrpc/service.c:72:35: warning: symbol
'ptlrpc_alloc_rqbd' was not declared. Should it be static?
1065 drivers/staging/lustre/lustre/ptlrpc/service.c:105:1: warning:
symbol 'ptlrpc_free_rqbd' was not declared. Should it be static?
1066 drivers/staging/lustre/lustre/ptlrpc/service.c:122:1: warning:
symbol 'ptlrpc_grow_req_bufs' was not declared. Should it be static?
1067 drivers/staging/lustre/lustre/ptlrpc/service.c:3055:5: warning:
symbol 'ptlrpc_svcpt_health_check' was not declared. Should it be
static?

Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>"
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: echo_client: fix sparse declaration warnings
Zoltán Lajos Kis [Sun, 2 Aug 2015 17:22:30 +0000 (19:22 +0200)]
staging: lustre: echo_client: fix sparse declaration warnings

Fixes the following sparse warnings:

drivers/staging/lustre/lustre/obdecho/echo_client.c:2142:5: warning: symbol 'echo_client_init' was not declared. Should it be static?
drivers/staging/lustre/lustre/obdecho/echo_client.c:2157:6: warning: symbol 'echo_client_exit' was not declared. Should it be static?

Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>"
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: r819xU_firmware: fix coding style
Kent Gustavsson [Sun, 2 Aug 2015 16:14:50 +0000 (18:14 +0200)]
staging: rtl8192u: r819xU_firmware: fix coding style

Line over 80 characters. This is for Eudyptula Challenge

Signed-off-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Get rid of inode_dio_write_done and inode_dio_read
Oleg Drokin [Fri, 31 Jul 2015 23:42:59 +0000 (19:42 -0400)]
staging/lustre: Get rid of inode_dio_write_done and inode_dio_read

These primitives are long deprecated and unused.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Get rid of ll_pagevec_ macros
Oleg Drokin [Fri, 31 Jul 2015 23:42:58 +0000 (19:42 -0400)]
staging/lustre: Get rid of ll_pagevec_ macros

They are noop anyways.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Use hlist primitives directly
Oleg Drokin [Fri, 31 Jul 2015 23:42:57 +0000 (19:42 -0400)]
staging/lustre: Use hlist primitives directly

Get rid of ll_d_hlist* compat defines.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Drop FMODE_UNSIGNED_OFFSET define
Oleg Drokin [Fri, 31 Jul 2015 23:42:56 +0000 (19:42 -0400)]
staging/lustre: Drop FMODE_UNSIGNED_OFFSET define

It's not really used anywhere.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: remove unused ll_quota_on and ll_quota_off
Oleg Drokin [Fri, 31 Jul 2015 23:42:55 +0000 (19:42 -0400)]
staging/lustre: remove unused ll_quota_on and ll_quota_off

They are not used anywhere, so safe to drop.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: Drop SEEK_* definition checks
Oleg Drokin [Fri, 31 Jul 2015 23:42:54 +0000 (19:42 -0400)]
staging/lustre: Drop SEEK_* definition checks

SEEK_DATA and SEEK_HOLE are always defined in the kernel,
drop the definition checks

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Rework EEPROM handling code
Mateusz Kulikowski [Thu, 30 Jul 2015 21:48:50 +0000 (23:48 +0200)]
staging: rtl8192e: Rework EEPROM handling code

Card configuration is stored in SPI EEPROM (93c46 or 93c56)
working in 128|256x16 mode.
Communication is handled using GPIO bitbang.

>From behaviour perspective, delay after read was removed.
It is not needed as we wait after reading GPIO mapped to
PCI-E register - it should have no side effects.

According to sample EEPROM datasheet (AT93Cx6), max frequency for
worst case scenario (1.8V supply) is 250kHZ (vs. 1MHz for 5V).
Driver generates ~50kHZ clock - margin should be big enough
even for devices from other vendors.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visorchannel: Add peek function
Neil Horman [Fri, 31 Jul 2015 22:56:32 +0000 (18:56 -0400)]
staging: unisys: visorchannel: Add peek function

According to unisys, the s_par hypervisor has a bug in which it never
triggers an interrupt.  That makes the visornic effectively a 2ms poll
loop.  In order to just have the rx thread shceduling a napi poll every
2ms, lets instead give it the chance to check the response queue for
data before we schedule.  This helper provides that functionality

Signed-off-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: android: Allow compile test of GPIO consumers if !GPIOLIB
Geert Uytterhoeven [Sun, 2 Aug 2015 09:09:51 +0000 (11:09 +0200)]
staging: android: Allow compile test of GPIO consumers if !GPIOLIB

The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: Allow compile test of GPIO consumers if !GPIOLIB
Geert Uytterhoeven [Sun, 2 Aug 2015 09:09:52 +0000 (11:09 +0200)]
staging: fbtft: Allow compile test of GPIO consumers if !GPIOLIB

The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: fbtft: core: Don't set device platform_data
Noralf Trønnes [Thu, 30 Jul 2015 17:55:01 +0000 (19:55 +0200)]
staging: fbtft: core: Don't set device platform_data

Pass platform_data as an argument to fbtft_framebuffer_alloc()
instead of using dev->platform_data.

This fixes an issue where the device comes from Device Tree
and fbtft_probe_common() sets dev->platform_data to allocated
memory. When the module is reloaded, dev->platform_data points
to freed memory.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: most: fix hdm-dim2 build error
Randy Dunlap [Mon, 3 Aug 2015 18:35:51 +0000 (11:35 -0700)]
staging: most: fix hdm-dim2 build error

Fix build of hdm-dim2. Since it calls a function that is provided
by AIM_NETWORK, make it depend on that symbol.

Also fix a misspelling in the Kconfig file.

drivers/built-in.o: In function `deliver_netinfo_thread':
dim2_hdm.c:(.text+0x3a9563): undefined reference to `most_deliver_netinfo'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jain Roy Ambi <JainRoy.Ambi@microchip.com>
Cc: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: most: fix aim-sound build errors
Randy Dunlap [Mon, 3 Aug 2015 18:35:47 +0000 (11:35 -0700)]
staging: most: fix aim-sound build errors

Fix build errors: driver uses snd_pcm*() interfaces, so select
SND_PCM.

drivers/built-in.o: In function `audio_rx_completion':
sound.c:(.text+0x3cd376): undefined reference to `snd_pcm_period_elapsed'
drivers/built-in.o: In function `pcm_prepare':
sound.c:(.text+0x3cd3b0): undefined reference to `snd_pcm_format_physical_width'
sound.c:(.text+0x3cd3ce): undefined reference to `snd_pcm_format_big_endian'
sound.c:(.text+0x3cd42c): undefined reference to `snd_pcm_format_big_endian'
drivers/built-in.o: In function `pcm_hw_free':
sound.c:(.text+0x3cd50a): undefined reference to `snd_pcm_lib_free_vmalloc_buffer'
drivers/built-in.o: In function `pcm_hw_params':
sound.c:(.text+0x3cd54c): undefined reference to `_snd_pcm_lib_alloc_vmalloc_buffer'
drivers/built-in.o: In function `playback_thread':
sound.c:(.text+0x3cd6a0): undefined reference to `snd_pcm_period_elapsed'
drivers/built-in.o: In function `audio_probe_channel':
sound.c:(.text+0x3cdc0b): undefined reference to `snd_pcm_new'
sound.c:(.text+0x3cdc2b): undefined reference to `snd_pcm_set_ops'
drivers/built-in.o:(.data+0x952d0): undefined reference to `snd_pcm_lib_ioctl'
drivers/built-in.o:(.data+0x95318): undefined reference to `snd_pcm_lib_get_vmalloc_page'

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: most: avoid possible integer overflow
Christian Gromm [Mon, 3 Aug 2015 11:44:30 +0000 (13:44 +0200)]
Staging: most: avoid possible integer overflow

This patch prevents a potential integer overlow.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: probe: iounmap mmio when probe fails
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:47 +0000 (23:31 +0200)]
staging: rtl8192e: probe: iounmap mmio when probe fails

In case of probe failure, io memory was not released properly.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Drop large switch in rtl92e_config_rf
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:46 +0000 (23:31 +0200)]
staging: rtl8192e: Drop large switch in rtl92e_config_rf

The same steps were made for each RF path independently.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Fix IW_IOCTL macro
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:45 +0000 (23:31 +0200)]
staging: rtl8192e: Fix IW_IOCTL macro

Macro caused checkpatch complaints - replace [] braces with ()
and use [] braces as array initializers.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove phy_RF8256_Config_ParaFile
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:44 +0000 (23:31 +0200)]
staging: rtl8192e: Remove phy_RF8256_Config_ParaFile

Merge function into rtl92e_config_rf as having them
separated gives no benefit.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Simplify rtl92e_set_bandwidth
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:43 +0000 (23:31 +0200)]
staging: rtl8192e: Simplify rtl92e_set_bandwidth

Move phy version check outside of the loop.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Simplify rtl92e_is_halfn_supported_by_ap
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:42 +0000 (23:31 +0200)]
staging: rtl8192e: Simplify rtl92e_is_halfn_supported_by_ap

Function should return struct member - no extra logic is needed.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: MgntActSet_RF_State: remove ProtectOrNot parameter
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:41 +0000 (23:31 +0200)]
staging: rtl8192e: MgntActSet_RF_State: remove ProtectOrNot parameter

It is set at the very beginning of function to a constant value.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove rtl8192_data_hard_resume
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:40 +0000 (23:31 +0200)]
staging: rtl8192e: Remove rtl8192_data_hard_resume

Function is empty; rtllib checks if handler is NULL.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove rtl8192_data_hard_stop
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:39 +0000 (23:31 +0200)]
staging: rtl8192e: Remove rtl8192_data_hard_stop

Function is empty; rtllib checks if handler is NULL.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove ActUpdateChannelAccessSetting
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:38 +0000 (23:31 +0200)]
staging: rtl8192e: Remove ActUpdateChannelAccessSetting

Function is empty and called only once.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192e: Remove rtl8192_phy_updateInitGain
Mateusz Kulikowski [Tue, 28 Jul 2015 21:31:37 +0000 (23:31 +0200)]
staging: rtl8192e: Remove rtl8192_phy_updateInitGain

Function is empty and called only once.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: das16: remove a duplicate condition
Dan Carpenter [Wed, 29 Jul 2015 21:36:32 +0000 (00:36 +0300)]
staging: comedi: das16: remove a duplicate condition

We checked that "it->options[3]" was non-zero on the line before so
there is no need to check again.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-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: rtl8192e: don't just print an error and continue
Dan Carpenter [Tue, 28 Jul 2015 15:49:25 +0000 (18:49 +0300)]
staging: rtl8192e: don't just print an error and continue

I was looking at how TOTAL_CAM_ENTRY is used and I saw this code.  We
print an error but continue writing "EntryNo" to a register as if it
were valid.  "EntryNo" is controlled by the user in rtl8192_ioctl() so
it definitely can be invalid.  I'm not positive what happens with the
invalid data but it can't be good.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: rtl8192e: array overflow in rtl92e_set_swcam()
Dan Carpenter [Tue, 28 Jul 2015 15:48:21 +0000 (18:48 +0300)]
Staging: rtl8192e: array overflow in rtl92e_set_swcam()

"EntryNo" is comes from the user in the ioctl and it's a number between
0-255.  The ieee->swcamtable[] array only has 32 elements so it can
result in memory corruption.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: panel: fix block comment usage
Alex Wilson [Fri, 31 Jul 2015 17:08:29 +0000 (11:08 -0600)]
staging: panel: fix block comment usage

Fixed two coding style warnings concerning multiline comments.

Signed-off-by: Alex Wilson <alex.david.wilson@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agodrivers: staging: Drop unlikely before IS_ERR(_OR_NULL)
Viresh Kumar [Fri, 31 Jul 2015 08:38:30 +0000 (14:08 +0530)]
drivers: staging: Drop unlikely before IS_ERR(_OR_NULL)

IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

This also replaces an IS_ERR(x) + (x == NULL) check to IS_ERR_OR_NULL
check.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agolinux-next: drivers: staging: most: Fix return value
Michael Hornung [Fri, 31 Jul 2015 20:18:17 +0000 (22:18 +0200)]
linux-next: drivers: staging: most: Fix return value

* Fix sparse warning "Using plain integer as NULL pointer"

Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: most: replace pr_*() functions by dev_*()
Christian Gromm [Thu, 30 Jul 2015 16:19:41 +0000 (18:19 +0200)]
Staging: most: replace pr_*() functions by dev_*()

This patch replaces pr_*() functions with dev_*().

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: most: fix doing DMA on stack
Christian Gromm [Thu, 30 Jul 2015 16:18:55 +0000 (18:18 +0200)]
Staging: most: fix doing DMA on stack

This patch fixes error "doing DMA on the stack" by using kzalloc
for buffer allocation.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: most: replace min() by min_t()
Christian Gromm [Thu, 30 Jul 2015 13:31:39 +0000 (15:31 +0200)]
Staging: most: replace min() by min_t()

This patch fixes wrong casting.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: most: fix double unlock
Christian Gromm [Thu, 30 Jul 2015 13:31:37 +0000 (15:31 +0200)]
Staging: most: fix double unlock

This patch fixes double unlocking of a spinlock the aim-v4l2 module.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: android: Fixed line over 80 char
Jignesh R Patel [Tue, 28 Jul 2015 10:49:36 +0000 (16:19 +0530)]
staging: android: Fixed line over 80 char

Fixes the following checkpatch warning:
Warning: Line over 80 characters

Signed-off-by: Jignesh R Patel <jigneshpatel0103@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging:dgap :Compression of lines for immediate return
Shraddha Barke [Mon, 27 Jul 2015 18:00:52 +0000 (23:30 +0530)]
Staging:dgap :Compression of lines for immediate return

This patch compresses two lines into a single line
if immediate return statement is found. Remove variable rc as
it is no longer needed.

It is done using script Coccinelle. And coccinelle uses the following
semantic patch for this compression function:

@@
type T;
identifier i,f;
constant C;
@@
- T i;
  ...when != i
     when strict
(
  return -C;
|
- i =
+ return
     f(...);
- return i;
)

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: rtl8192u: Fix checkpatch issue with comma in r819xU_firmware.c
Freeman Zhang [Mon, 27 Jul 2015 06:37:25 +0000 (14:37 +0800)]
staging: rtl8192u: Fix checkpatch issue with comma in r819xU_firmware.c

Add space after ',' to fix the error message provided by checkpatch.pl:
ERROR: space required after that ','

Signed-off-by: Freeman Zhang <freeman.zhang1992@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging : android :Replace comma with a semicolon
Shraddha Barke [Mon, 27 Jul 2015 10:06:26 +0000 (15:36 +0530)]
Staging : android :Replace comma with a semicolon

Replace comma between expression statements by a semicolon.
The semantic patch used is as follows:

@@
expression e1,e2;
@@
e1
- ,
+ ;
e2;

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: slicoss: Add blank line after variable declarations.
Ciprian Manea [Sun, 26 Jul 2015 21:26:18 +0000 (22:26 +0100)]
staging: slicoss: Add blank line after variable declarations.

This patch fixes the checkpatch.pl warning:

WARNING: Missing a blank line after declarations
+ unsigned long flags;
+ pshmem = (struct slic_shmem *)(unsigned long)

Signed-off-by: Ciprian Manea <ciprian.manea.cm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/xgifb: fix dumpVGAReg compile error if DEBUG is set
Peter Huewe [Fri, 24 Jul 2015 23:59:08 +0000 (01:59 +0200)]
staging/xgifb: fix dumpVGAReg compile error if DEBUG is set

If DEBUG is set dumpVGAReg is called and tries to access
XGISR which is defined as (xgifb_info->dev_info.P3c4)
which is not known within this function.

-> add as parameter to dumpVGAReg so xgifb_info becomes known

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: octeon: add missing blank line after declarations
Kevin Darbyshire-Bryant [Sat, 25 Jul 2015 09:48:28 +0000 (10:48 +0100)]
staging: octeon: add missing blank line after declarations

Fixes checkpatch.pl
WARNING: Missing a blank line after delarations

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: dgnc: dgnc_driver.h: remove unnecessary comments
Navy Cheng [Mon, 27 Jul 2015 08:09:35 +0000 (16:09 +0800)]
Staging: dgnc: dgnc_driver.h: remove unnecessary comments

The public headers is well known by others and the redundant commits make
the code mess. Remove the comments of the public headers to make the code
tidy.

Signed-off-by: Navy Cheng <navych@126.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic - consolidate+simplify xmit watermark checks
Tim Sell [Tue, 28 Jul 2015 16:29:11 +0000 (12:29 -0400)]
staging: unisys: visornic - consolidate+simplify xmit watermark checks

The code that tests for high and low xmit watermarks was consolidatedand
simplified. The output behavior should be identical, with the exception
of an off-by-one error being corrected in the tests done when the counters
overflowed.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic: enable skb->len error-check, remove DEBUG blocks
Tim Sell [Tue, 28 Jul 2015 16:29:10 +0000 (12:29 -0400)]
staging: unisys: visornic: enable skb->len error-check, remove DEBUG blocks

* A skb->len error-check was enabled (removed from a "#ifdef DEBUG" block).
* Several unneeded "#ifdef DEBUG" blocks were removed.
* A dev_err() was converted to the more-appropriate netdev_err().

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic_resume needs to mirror _serverdown_complete
Tim Sell [Tue, 28 Jul 2015 16:29:09 +0000 (12:29 -0400)]
staging: unisys: visornic_resume needs to mirror _serverdown_complete

Previously we simplified the serverdown function to basically turn it
into a dev_close(), but missed the analogous logic in visornic_resume()
(which is essentially the "book-end" of visornic_serverdown_complete()).
As a result, during IO partition recovery, the nic would go closed when
the IO partition went away, but would never be opened again when the IO
partition came back.

This patch changes visornic_resume() to use dev_open(), so that it once
again plays nicely with visornic_serverdown_complete().  Because
dev_open() forces us into the visornic_open() path, other logic in
visornic_resume() was no longer necessary, and lended to simplifying
visornic_resume() even more.

Fixes: 36645d72a377 ("staging: unisys: simplify visornic_serverdown_complete")
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic - correctly reset flag prior to send_enbdis()
Tim Sell [Tue, 28 Jul 2015 16:29:08 +0000 (12:29 -0400)]
staging: unisys: visornic - correctly reset flag prior to send_enbdis()

Because devdata->enab_dis_acked is the flag used to determine whether an
enable/disable operation to the IO partition has completed, it should
always be cleared prior to initiating the operation.  The call added to
visornic_enable_with_timeout() added in this patch makes the usage there
consistent with visornic_disable_with_timeout().

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: unisys: visornic - prevent lock recursion after IO recovery
Tim Sell [Fri, 31 Jul 2015 17:21:33 +0000 (13:21 -0400)]
staging: unisys: visornic - prevent lock recursion after IO recovery

In the patch which changed the serverdown logic to by synchronous, we
were
mistakenly holding on to devdata->priv_lock in the call to
visornic_serverdown_complete(), which ultimately ended up recursively
attempting to grab the same lock via the path:

    --> dev_close
        --> visornic_close()
            --> visornic_disable_with_timeout()

Evidence:

    BUG: spinlock recursion on CPU#0, kworker/u2:0/1567
     lock: 0xffff88002d7e4c90, .magic: dead4ead, .owner: kworker/
     .owner_cpu: 0
    CPU: 0 PID: 1567 Comm: kworker/u2:0 Tainted: G        WC
         4.2.0-rc3-ARCH+ #60
    Hardware name: Dell Inc. PowerEdge T110/ , BIOS 1.23 12/15/2009
    Workqueue: visorchipset_controlvm controlvm_periodic_work [visorbus]
     ffff8800216a9380 ffff88002d167878 ffffffff81476874 000000000000061f
     ffff88002d7e4c90 ffff88002d167898 ffffffff8109e2bc ffff88002d7e4c90
     ffffffff81763d7c ffff88002d1678b8 ffffffff8109e330 ffff88002d7e4c90
    Call Trace:
     [<ffffffff81476874>] dump_stack+0x4f/0x73
     [<ffffffff8109e2bc>] spin_dump+0x7c/0xc0
     [<ffffffff8109e330>] spin_bug+0x30/0x40
     [<ffffffff8109e547>] do_raw_spin_lock+0x127/0x140
     [<ffffffff8147bf8b>] _raw_spin_lock_irqsave+0x4b/0x60
     [<ffffffffa0168a5c>] ? visornic_disable_with_timeout.clone.2+0x3c/
                          [visornic]
     [<ffffffff8147c639>] ? _raw_spin_unlock_bh+0x39/0x40
     [<ffffffffa0168a5c>] visornic_disable_with_timeout.clone.2+0x3c/
                          [visornic]
     [<ffffffffa0168c6e>] visornic_close+0xe/0x20 [visornic]
     [<ffffffff813ae8d2>] __dev_close_many+0x92/0xe0
     [<ffffffff813ae9ea>] dev_close_many+0x7a/0x110
     [<ffffffff81097556>] ? down+0x16/0x50
     [<ffffffff813af01f>] dev_close+0x3f/0x50
     [<ffffffffa0166b61>] visornic_serverdown+0x91/0x1a0 [visornic]
     [<ffffffffa0155760>] ? device_changestate_responder.clone.
                          [visorbus]
     [<ffffffffa0166c85>] visornic_pause+0x15/0x20 [visornic]
     [<ffffffffa015101f>] initiate_chipset_device_pause_resume+0x9f/0xe0
                          [visorbus]
     [<ffffffffa0151093>] chipset_device_pause+0x13/0x20 [visorbus]
     [<ffffffffa0153cbb>] device_epilog+0x12b/0x1a0 [visorbus]
     [<ffffffffa015506b>] handle_command+0x72b/0x970 [visorbus]
     [<ffffffffa015214e>] ? visorchannel_signalremove+0x6e/0x80
[visorbus]
     [<ffffffffa0155521>] controlvm_periodic_work+0x271/0x420 [visorbus]
     [<ffffffff8106cb52>] process_one_work+0x1d2/0x540
     [<ffffffff8106cab9>] ? process_one_work+0x139/0x540
     [<ffffffff814771b7>] ? __schedule+0x807/0xc30
     [<ffffffff8106cf57>] worker_thread+0x57/0x4c0
     [<ffffffff8106cf00>] ? process_scheduled_works+0x40/0x40
     [<ffffffff8106cf00>] ? process_scheduled_works+0x40/0x40
     [<ffffffff81073b19>] kthread+0xe9/0x110
     [<ffffffff81073a30>] ? __init_kthread_worker+0x70/0x70
     [<ffffffff8147cddf>] ret_from_fork+0x3f/0x70
     [<ffffffff81073a30>] ? __init_kthread_worker+0x70/0x70
    BUG: spinlock lockup suspected on CPU#0, kworker/u2:0/1567

Fixes: f2b70efaf48f ("staging: unisys: Make serverdown synchronous")
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>