platform/kernel/linux-exynos.git
8 years agostaging: comedi: ni_660x: update the MODULE_DESCRIPTION
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:53 +0000 (11:10 -0700)]
staging: comedi: ni_660x: update the MODULE_DESCRIPTION

Change the generic MODULE_DESCRIPTION text to something more useful.

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>
8 years agostaging: comedi: ni_660x: refactor GPCT_OFFSET
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:52 +0000 (11:10 -0700)]
staging: comedi: ni_660x: refactor GPCT_OFFSET

This driver supports boards that have 1 or 2 TIO chips with base
addresses 0x800 apart. Replace the static const array 'GPCT_OFFSET'
with a define and calculate the base address based on the chip index.

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>
8 years agostaging: comedi: ni_660x: remove spinlock 'dma_cfg_lock'
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:51 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove spinlock 'dma_cfg_lock'

This spinlock is only used to protect changes to the private data 'dma_cfg'.

Before calling any function that would change the 'dma_cfg' the spinlock
'mite_channel_lock' is also locked. That spinlock is not unlocked until
after the 'dma_cfg' change.

Remove the redundant 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>
8 years agostaging: comedi: ni_660x: remove ni_gpct_to_660x_register[]
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:50 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove ni_gpct_to_660x_register[]

enum ni_gpct_register and enum ni_660x_register now have a 1:1
relationship for the NITIO_* registers. The static const array
is no longer necessary to find the proper NI660X_* register for
a given NITIO_*. Remove it and refactor the register read/write
functions.

Use the NITIO_* values to init the ni_660x_reg_data[] array and
remove the unnecessary NI660X_* enum values.

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>
8 years agostaging: comedi: ni_660x: sort enum ni_660x_register
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:49 +0000 (11:10 -0700)]
staging: comedi: ni_660x: sort enum ni_660x_register

Sort this enum so that it has a 1:1 relationship with the ni_tio.h
enum ni_gpct_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>
8 years agostaging: comedi: ni_660x: remove inline mite_ring()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:48 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove inline mite_ring()

This fuction just returns a pointer from the private data. The name
might provide some confusion since it appears to be an exported
function from the mite driver.

Just remove it and get the pointer directly where 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>
8 years agostaging: comedi: ni_660x: default DIO channels with subdevice init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:47 +0000 (11:10 -0700)]
staging: comedi: ni_660x: default DIO channels with subdevice init

For aesthetics, move the initialization of the default routing for the
DIO channels so it happens when the subdevice is initialized.

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>
8 years agostaging: comedi: ni_660x: initialize the counter with the subdevice init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:46 +0000 (11:10 -0700)]
staging: comedi: ni_660x: initialize the counter with the subdevice init

Remove the extra for loop and just initialize the counter as the subdevices
are created.

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>
8 years agostaging: comedi: ni_660x: allocate counters early in (*auto_attach)
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:45 +0000 (11:10 -0700)]
staging: comedi: ni_660x: allocate counters early in (*auto_attach)

The ni_gpct_device_construct() could fail allocating the memory for
device and its counters. For aesthetics, call the function before
initializing the subdevices.

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>
8 years agostaging: comedi: ni_660x: init TIO chips before subdevice init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:44 +0000 (11:10 -0700)]
staging: comedi: ni_660x: init TIO chips before subdevice init

For aesthetics, initialize the TIO chips before the subdevices are
allocated and initialized.

Refactor the function to initialize all the TIO chips and move it
to a better place in the driver.

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>
8 years agostaging: comedi: ni_660x: disable interrupts when detaching driver
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:43 +0000 (11:10 -0700)]
staging: comedi: ni_660x: disable interrupts when detaching driver

Make sure the interrupts are disabled before freeing the irq.

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>
8 years agostaging: comedi: ni_660x: ni_gpct_device_destroy() can handle a NULL pointer
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:41 +0000 (11:10 -0700)]
staging: comedi: ni_660x: ni_gpct_device_destroy() can handle a NULL pointer

Remove the unnecessary NULL pointer 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>
8 years agostaging: comedi: ni_660x: tidy up the counter subdevices init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:39 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up the counter subdevices init

For aesthetics, add some whitespace to the subdevice init and use
a couple local variables to make the code easier to follow.

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>
8 years agostaging: comedi: ni_660x: tidy up the misc. constants
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:38 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up the misc. constants

Remove enum ni_660x_constants and just #define the value.

Move all the constant #defines so they are in one place and rename
them so they are more conesistent.

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>
8 years agostaging: comedi: ni_660x: fix memory barrier without comment
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:37 +0000 (11:10 -0700)]
staging: comedi: ni_660x: fix memory barrier without comment

Fix the checkpatch.pl issue. Move the memory barrier to a better place.

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>
8 years agostaging: comedi: ni_660x: add comments for the spinlock_t definitions
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:36 +0000 (11:10 -0700)]
staging: comedi: ni_660x: add comments for the spinlock_t definitions

Fix the checkpatch.pl issues:

CHECK: spinlock_t definition without comment

For aesthetics, rename the 'soft_reg_copy_lock' to clarify what it's
used for.

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>
8 years agostaging: comedi: ni_660x: refactor ni_gpct_to_660x_register()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:35 +0000 (11:10 -0700)]
staging: comedi: ni_660x: refactor ni_gpct_to_660x_register()

Convert this big switch into an array and refactor ni_660x_gpct_{write,read}()
functions to use the array to find the register offset.

All the TIO (GPCT) registers are included in the array except for NITIO_G0_ABZ
and NITIO_G1_ABZ. These registers only exist on the ni_pcimio m-series boards
and this driver will never read/write them.

Just in case someone adds a new entry to the enum ni_gpct_register in ni_tio.h,
add a dev_warn() for any unhandled registers.

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>
8 years agostaging: comedi: ni_660x: add a comment about the initial DIO state
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:34 +0000 (11:10 -0700)]
staging: comedi: ni_660x: add a comment about the initial DIO state

The (*auto_attach) initializes all the DIO channels to a default state.
Add a comment for clarity.

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>
8 years agostaging: comedi: ni_660x: tidy up ni_660x_set_pfi_routing()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:33 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up ni_660x_set_pfi_routing()

Use the comedi.h provided constants (enum ni_660x_pfi_routing) instead
of defining new ones for the output sources.

Use a switch to clarify the channel/source validation.

For aesthetics, rename the private data members 'pfi_output_selects' and
'pfi_direction_bits'.

Remove the 'min_counter_pfi_chan' and 'max_dio_pfi_chan' from
enum ni_660x_constants. The open coded values make the code easier
to follow.

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>
8 years agostaging: comedi: ni_660x: tidy up ni_660x_dio_insn_bits()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:32 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up ni_660x_dio_insn_bits()

Use some local variables to clarify this function.

This (*insn_bits) function is a bit different from most comedi drivers.
Add some comments to clarify why the shifts are used.

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>
8 years agostaging: comedi: ni_660x: tidy up Digital I/O subdevice init
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:31 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up Digital I/O subdevice init

Add some whitespace to the Digital I/O subdevice init and add a
comment about the channels. This driver is a bit goofy, only 32 of
the 40 channels can actually be used for Digital I/Os and 32 of
them can be routed to the counters for alternate use.

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>
8 years agostaging: comedi: ni_660x: Prefer kernel type 'u64' over 'uint64_t'
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:30 +0000 (11:10 -0700)]
staging: comedi: ni_660x: Prefer kernel type 'u64' over 'uint64_t'

Fix the checkpatch.pl issues.

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>
8 years agostaging: comedi: ni_660x: Prefer 'unsigned int' to bare use of 'unsigned'
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:29 +0000 (11:10 -0700)]
staging: comedi: ni_660x: Prefer 'unsigned int' to bare use of 'unsigned'

Fix the checkpatch.pl issues.

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>
8 years agostaging: comedi: ni_660x: remove ni_660x_num_counters()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:28 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove ni_660x_num_counters()

This inline function is only used by the (*auto_attach). Remove it
and just use a local variable for the calculation.

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>
8 years agostaging: comedi: ni_660x: remove enum ni_660x_subdevices
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:27 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove enum ni_660x_subdevices

Hard-coding the subdevice order is normally a bad idea. If a new subdevice
is added, or removed, it could potentially break pretty badly.

Remove the enum and associated NI_660X_GPCT_SUBDEV() helper that hard-code
the subdevice order.

Fix the (*auto_attach) so it initializes all the subdevices without depending
on the hard-coded order.

Change the interrupt handler so that all the counter subdevices are handled
without depending on the hard-coded order.

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>
8 years agostaging: comedi: ni_660x: fix block comment issues
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:26 +0000 (11:10 -0700)]
staging: comedi: ni_660x: fix block comment issues

Fix the checkpatch.pl issues about:

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

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>
8 years agostaging: comedi: ni_660x: remove BUG_ON() in ni_660x_request_mite_channel()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:25 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove BUG_ON() in ni_660x_request_mite_channel()

This BUG_ON() happens if a mite DMA channel is already requested when an
ansynchronous command is started for one of the counter subdevices.

The comedi core will only call the (*do_cmd) if the subdevice is not busy.
In this driver, the (*cancel) for the subdevice will always release any
requested mite DMA channel.

Remove the BUG_ON() which can never occur.

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>
8 years agostaging: comedi: ni_660x: tidy up ni_660x_select_pfi_output()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:24 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up ni_660x_select_pfi_output()

Tidy up this function to fix the checkpatch.pl issues:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

For aesthetics, remove the static const local variables.

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>
8 years agostaging: comedi: ni_660x: tidy up ni_gpct_{write, read}_register()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:23 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up ni_gpct_{write, read}_register()

Rename these functions so they have namespace associated with the
driver.

Fix the checkpatch.pl issues:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

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>
8 years agostaging: comedi: ni_660x: tidy up ni_660x_read_register()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:22 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up ni_660x_read_register()

Rename this function to help shorten some of the long lines.

Remove the inline, let the compiler figure it out.

Change the 'unsigned' parameters to 'unsigned int' to fix the
checkpatch.pl issues:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

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>
8 years agostaging: comedi: ni_660x: tidy up ni_660x_write_register()
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:21 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up ni_660x_write_register()

Rename this function to help shorten some of the long lines.

Remove the inline, let the compiler figure it out.

Change the 'unsigned' parameters to 'unsigned int' to fix the
checkpatch.pl issues:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

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>
8 years agostaging: comedi: ni_660x: cleanup the NI660X_GLOBAL_INT_{STATUS, CFG}
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:20 +0000 (11:10 -0700)]
staging: comedi: ni_660x: cleanup the NI660X_GLOBAL_INT_{STATUS, CFG}

Remove the enums global_interrupt_{status,config}_register_bits and
add defines for the CamelCase values.

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>
8 years agostaging: comedi: ni_660x: cleanup the NI660X_DMA_CFG register helpers
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:19 +0000 (11:10 -0700)]
staging: comedi: ni_660x: cleanup the NI660X_DMA_CFG register helpers

The BUG_ON() checks in the helper functions are not necessary. The mite
driver quiries the PCI chip to determine the number of DMA channels.
This is then used when a DMA channel is requested so the channel will
always be in range.

Convert the inline functions used to set the bits in the NI600X_DMA_CFG
register into macros. Also convert the associated enum dma_selection.
This clarifies the association with the register.

Rename the associated 'dma_configuration_soft_copies' member of the
private data to allow shorting some of the ugly long lines in the
driver.

This also fixes a number of checkpatch.pl issues about:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

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>
8 years agostaging: comedi: ni_660x: remove enum clock_config_register_bits
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:18 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove enum clock_config_register_bits

Remove this enum and add a define for the 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>
8 years agostaging: comedi: ni_660x: tidy up multi-line comment
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:17 +0000 (11:10 -0700)]
staging: comedi: ni_660x: tidy up multi-line comment

Reformat the multi-line comment in the kernel CodingStyle.

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>
8 years agostaging: comedi: ni_660x: cleanup the NI660X_IO_CFG register helpers
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:16 +0000 (11:10 -0700)]
staging: comedi: ni_660x: cleanup the NI660X_IO_CFG register helpers

Convert the inline functions used to set the bits in the NI600X_IO_CFG
registers into macros. Also convert the enum ni_660x_pfi_output_select
into defines. This clarifies the association with the register.

This also fixes a number of checkpatch.pl issues about:

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

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>
8 years agostaging: comedi: ni_660x: rename CamelCase 'NI_660xRegisterData'
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:15 +0000 (11:10 -0700)]
staging: comedi: ni_660x: rename CamelCase 'NI_660xRegisterData'

Rename this CamelCase struct and the associated 'registerData' variable.

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>
8 years agostaging: comedi: ni_660x: remove enum ni_660x_register_direction
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:14 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove enum ni_660x_register_direction

This enum is used to define the, unused, 'direction' of each register
in struct NI_660xRegisterData. Remove the unused member, as well as
the enum.

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>
8 years agostaging: comedi: ni_660x: remove enum ni_register_width
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:13 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove enum ni_register_width

All the registers are defined struct NI_660xRegisterData and they are
either 2 or 4 bytes in size. Remove the enum and just use a char member
to define the size as 2 or 4 bytes.

Simplify the ni_660x_{write,read}_register() functions and remove the
unnecessary BUG() in each.

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>
8 years agostaging: comedi: ni_660x: remove struct NI_660xRegisterData 'name'
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:12 +0000 (11:10 -0700)]
staging: comedi: ni_660x: remove struct NI_660xRegisterData 'name'

This member of the struct is not used, and just takes up space. Remove it.
Instead, add the enum ni_660x_register indexes to the table to clarify, and
document, the entries.

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>
8 years agostaging: comedi: ni_660x: change IOConfigReg() into a macro
H Hartley Sweeten [Tue, 22 Mar 2016 18:10:11 +0000 (11:10 -0700)]
staging: comedi: ni_660x: change IOConfigReg() into a macro

The BUG_ON() in this function is unnecessary. The 'pfi_channel' will
always be in range of the subdevice 'n_chan' (NUM_PFI_CHANNELS) which
will return a valid 'reg'.

Convert the inline function into a simple macro.

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>
8 years agostaging: wilc1000: removes unused local variable
Leo Kim [Fri, 25 Mar 2016 12:16:56 +0000 (21:16 +0900)]
staging: wilc1000: removes unused local variable

This patch removes unused local variable.
This variable is operation definition that back off from sending packets
for some time.
However, that has been deleted operation code.
That is removes all relative code.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes define USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS
Leo Kim [Fri, 25 Mar 2016 12:16:55 +0000 (21:16 +0900)]
staging: wilc1000: removes define USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS

This patch removes define USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS and
use it's feature codes.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unused define
Leo Kim [Fri, 25 Mar 2016 12:16:54 +0000 (21:16 +0900)]
staging: wilc1000: removes unused define

This patch removes unused define.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: replaces memcmp with ether_addr_equal_unaligned
Leo Kim [Fri, 25 Mar 2016 12:16:53 +0000 (21:16 +0900)]
staging: wilc1000: replaces memcmp with ether_addr_equal_unaligned

This patch replaces memcmp with ether_addr_equal_unaligned.
Warning reported by checkpatch.pl
 - Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unused debug flags
Leo Kim [Fri, 25 Mar 2016 12:16:52 +0000 (21:16 +0900)]
staging: wilc1000: removes unused debug flags

This patch removes unused debug flags.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes unused dead codes
Leo Kim [Fri, 25 Mar 2016 12:16:51 +0000 (21:16 +0900)]
staging: wilc1000: removes unused dead codes

This patch removes unused dead codes that define custom feature.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: replaces frame_type with type of struct frame_reg
Leo Kim [Fri, 25 Mar 2016 12:16:50 +0000 (21:16 +0900)]
staging: wilc1000: replaces frame_type with type of struct frame_reg

This patch replaces frame_type with type of struct frame_reg.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: replaces g_struct_frame_reg with frame_reg
Leo Kim [Fri, 25 Mar 2016 12:16:49 +0000 (21:16 +0900)]
staging: wilc1000: replaces g_struct_frame_reg with frame_reg

This patch replaces g_struct_frame_reg with frame_reg.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes typedef of struct struct_frame_reg
Leo Kim [Fri, 25 Mar 2016 12:16:48 +0000 (21:16 +0900)]
staging: wilc1000: removes typedef of struct struct_frame_reg

This patch removes typedef of struct struct_frame_reg.
Renames the struct_frame_reg to frame_reg as well.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: wilc_frame_register: removes unused hif_drv
Leo Kim [Fri, 25 Mar 2016 12:16:47 +0000 (21:16 +0900)]
staging: wilc1000: wilc_frame_register: removes unused hif_drv

This patch removes unused hif_drv of wilc_frame_register function.
It's perform an unnecessary null check and debug print log.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: removes WIRELESS_EXT
Leo Kim [Fri, 25 Mar 2016 12:16:46 +0000 (21:16 +0900)]
staging: wilc1000: removes WIRELESS_EXT

This patch removes WIRELESS_EXT.
Does not used the WIRELESS_EXT define.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use completion instead of struct semaphore hif_sema_driver
Chaehyun Lim [Wed, 23 Mar 2016 12:28:34 +0000 (21:28 +0900)]
staging: wilc1000: use completion instead of struct semaphore hif_sema_driver

struct semaphore hif_sema_driver is used to signal completion of host
interface message. This patch replaces struct semaphore hif_sema_driver
with struct completion hif_driver_comp. It is better to use completion
than semaphore for this case.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use completion instead of struct semaphore hif_sema_thread
Chaehyun Lim [Wed, 23 Mar 2016 12:28:33 +0000 (21:28 +0900)]
staging: wilc1000: use completion instead of struct semaphore hif_sema_thread

struct semaphore hif_sema_thread is used to signal completion of host
interface thread. This patch replaces struct semaphore hif_sema_thread
with struct completion hif_thread_comp. It is better to use completion
than semaphore for this case.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: include: changed 'v' variable to 'state'
Alexander Curtin [Thu, 24 Mar 2016 02:15:53 +0000 (22:15 -0400)]
staging: unisys: include: changed 'v' variable to 'state'

The argument for ULTRA_CHANNELCLI_STRING is supposed to be
an integer representing the channel state. 'state' is a more
descriptive variable name for this.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorbus: replaced use of vague 'x' variable
Alexander Curtin [Thu, 24 Mar 2016 02:15:52 +0000 (22:15 -0400)]
staging: unisys: visorbus: replaced use of vague 'x' variable

In client_bus_info_show, the variable 'x' is used to create keep track
of the offset that the current 'pos' in the output buffer needs to be
incremented by. Since 'off' is already taken 'shift' was used since it's
used to shift the pointer.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorbus: replaced vague 'p' variable with 'pos'
Alexander Curtin [Thu, 24 Mar 2016 02:15:51 +0000 (22:15 -0400)]
staging: unisys: visorbus: replaced vague 'p' variable with 'pos'

In the case of client_bus_info_show, the variable 'p' was used to
indicate the position in the output buffer. This was changed to 'pos' to
indicate that it kept track of the current position in the output
buffer.

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorbus: replaced vague variable name in zoneguid_show
Alexander Curtin [Thu, 24 Mar 2016 02:15:50 +0000 (22:15 -0400)]
staging: unisys: visorbus: replaced vague variable name in zoneguid_show

The variable name "s" doesn't indicate the purpose of the string, which
is to store the id collected from the visorchannel_zoneid function. This
just replaces the name with "zoneid".

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: visorbus: replaced vague variable name in typeguid_show
Alexander Curtin [Thu, 24 Mar 2016 02:15:49 +0000 (22:15 -0400)]
staging: unisys: visorbus: replaced vague variable name in typeguid_show

The variable name "s" doesn't indicate the purpose of the string, which
is to store the id collected from the visorchannel_id function. This
just replaces the name with "typeid".

Signed-off-by: Alexander Curtin <alexander.curtin@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: remove visorinput.c double negative comparison
Erik Arfvidson [Thu, 24 Mar 2016 13:18:10 +0000 (09:18 -0400)]
staging: unisys: remove visorinput.c double negative comparison

This patch simply removes the double negative comparison for
test_bit since test_bit already preforms this check.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: unisys: remove channel.h double negative comparison
Erik Arfvidson [Thu, 24 Mar 2016 13:18:09 +0000 (09:18 -0400)]
staging: unisys: remove channel.h double negative comparison

This patch removes the double negative comparisons for function
readb.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: return size_t for libcfs_ioctl_packlen
James Simmons [Tue, 22 Mar 2016 23:04:16 +0000 (19:04 -0400)]
staging: lustre: libcfs: return size_t for libcfs_ioctl_packlen

Change return value to size_t.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: use BIT macro in linux-module.c
James Simmons [Tue, 22 Mar 2016 23:04:15 +0000 (19:04 -0400)]
staging: lustre: libcfs: use BIT macro in linux-module.c

Use the proper BIT macro for libcfs_ioctl_is_invalid().

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: return proper bool values
James Simmons [Tue, 22 Mar 2016 23:04:14 +0000 (19:04 -0400)]
staging: lustre: libcfs: return proper bool values

Return real bool values for libcfs_ioctl_is_invalid().

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: add uapi headers to libcfs_ioctl.h
James Simmons [Tue, 22 Mar 2016 23:04:13 +0000 (19:04 -0400)]
staging: lustre: libcfs: add uapi headers to libcfs_ioctl.h

Need a few uapi headers to make libcfs_ioctl.h compilable in
userland.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: make libcfs_ioctl.h readable
James Simmons [Tue, 22 Mar 2016 23:04:12 +0000 (19:04 -0400)]
staging: lustre: libcfs: make libcfs_ioctl.h readable

Fix up all thw whitescapes and line up the IOCTL defines
so it is readable.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: move function declarations from libcfs_ioctl.h
James Simmons [Tue, 22 Mar 2016 23:04:11 +0000 (19:04 -0400)]
staging: lustre: libcfs: move function declarations from libcfs_ioctl.h

Move the function declartions that are used only by
kernel space to libcfs.h This makes libcfs_ioctl.h
a offical uapi header now.
Move large inline functions out of libcfs_ioctl.h to
the source file linux-module.c belonging to libcfs.
This code is only used by the core of libcfs and such
inline functions don't belong in a uapi header file.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: migrate inline functions to source file
James Simmons [Tue, 22 Mar 2016 23:04:10 +0000 (19:04 -0400)]
staging: lustre: libcfs: migrate inline functions to source file

Move large inline functions out of libcfs_ioctl.h to
the source file linux-module.c belonging to libcfs.
This code is only used by the core of libcfs and such
inline functions don't belong in a uapi header file.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: removal all userland only macros from libcfs_ioctl.h
James Simmons [Tue, 22 Mar 2016 23:04:09 +0000 (19:04 -0400)]
staging: lustre: libcfs: removal all userland only macros from libcfs_ioctl.h

All the macros in libcfs_ioctl.h that is needed by user
land have been moved into the lustre utilities software
stack.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/17643
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:lustre: remove libcfs pseudo device abstraction
Parinay Kondekar [Tue, 22 Mar 2016 23:04:08 +0000 (19:04 -0400)]
staging:lustre: remove libcfs pseudo device abstraction

With the libcfs ioctl cleanup we no longer need the libcfs
pseudo device abstraction.

Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:lustre: call libcfs_ioctl directly
Parinay Kondekar [Tue, 22 Mar 2016 23:04:07 +0000 (19:04 -0400)]
staging:lustre: call libcfs_ioctl directly

No reason to go through the cfs_psdev_ops abstract
to call libcfs_ioctl. Just call libcfs_ioctl directly.

Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:lustre: remove libcfs_psdev_[open|release]
Parinay Kondekar [Tue, 22 Mar 2016 23:04:06 +0000 (19:04 -0400)]
staging:lustre: remove libcfs_psdev_[open|release]

With struct libcfs_device_userstate gone we can remove
the remaining code of libcfs_psdev_ops.p_[open|close]
as well as the libcfs_psdev_[open|release] functions.

Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:lustre: remove the IOC_LIBCFS_MEMHOG ioctl
Parinay Kondekar [Tue, 22 Mar 2016 23:04:05 +0000 (19:04 -0400)]
staging:lustre: remove the IOC_LIBCFS_MEMHOG ioctl

The IOC_LIBCFS_MEMHOG is not needed so remove the last bits.

Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging:lustre: remove last bits of the IOC_LIBCFS_PANIC ioctl
Parinay Kondekar [Tue, 22 Mar 2016 23:04:04 +0000 (19:04 -0400)]
staging:lustre: remove last bits of the IOC_LIBCFS_PANIC ioctl

A few pieces still exist for the IOC_LIBCFS_PANIC ioctl. Remove
these last bits to prevent old tools from using them. The latest
lustre utilities no longer use this ioctl.

Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: remove libcfs_ioctl_popdata wrapper
John L. Hammond [Tue, 22 Mar 2016 23:04:03 +0000 (19:04 -0400)]
staging: lustre: libcfs: remove libcfs_ioctl_popdata wrapper

Lets just use copy_to_user() directly instead of having a
wrapper function.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14180
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: move libcfs_ioctl_handler stuff to libcfs.h
John L. Hammond [Tue, 22 Mar 2016 23:04:02 +0000 (19:04 -0400)]
staging: lustre: libcfs: move libcfs_ioctl_handler stuff to libcfs.h

Move all the libcfs_ioctl_handler code from libcfs_ioctl.h to
libcfs.h. The header libcfs_ioctl.h is a uapi header so their
is no reason to keep kernel internals in that header.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14180
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: remove libcfsutil.h in comment
John L. Hammond [Tue, 22 Mar 2016 23:04:01 +0000 (19:04 -0400)]
staging: lustre: libcfs: remove libcfsutil.h in comment

The header libcfsutil.h has been long gone in the upstream
client. Replace libcfsutil.h reference to the current user
land header instead.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14180
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: change variable name
James Simmons [Tue, 22 Mar 2016 23:04:00 +0000 (19:04 -0400)]
staging: lustre: libcfs: change variable name

Change arg to uparam name for libcfs_ioctl().

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: simple cleanup in obd_ioctl_popdata
Liang Zhen [Tue, 22 Mar 2016 23:03:59 +0000 (19:03 -0400)]
staging: lustre: simple cleanup in obd_ioctl_popdata

Code simplification for obd_ioctl_popdata.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lnet: make sure lnet data not greater than LIBCFS_IOC_DATA_MAX
Liang Zhen [Tue, 22 Mar 2016 23:03:58 +0000 (19:03 -0400)]
staging: lustre: lnet: make sure lnet data not greater than LIBCFS_IOC_DATA_MAX

Fail to compile if largest LNet user land data structures passed
to kernel are larger than LIBCFS_IOC_DATA_MAX

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: test if userland data is to small
Liang Zhen [Tue, 22 Mar 2016 23:03:57 +0000 (19:03 -0400)]
staging: lustre: libcfs: test if userland data is to small

Ensure that user land data is at least the smallest size.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: update error messages in linux-module.c
Liang Zhen [Tue, 22 Mar 2016 23:03:56 +0000 (19:03 -0400)]
staging: lustre: libcfs: update error messages in linux-module.c

The error message are for libcfs layer not LNet.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: invert test condition for libcfs_ioctl
Liang Zhen [Tue, 22 Mar 2016 23:03:55 +0000 (19:03 -0400)]
staging: lustre: libcfs: invert test condition for libcfs_ioctl

Invert the test of error returned by the handle_ioctl pointer.
This reduces the code by one indentation level.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: test if data is NULL
Liang Zhen [Tue, 22 Mar 2016 23:03:54 +0000 (19:03 -0400)]
staging: lustre: libcfs: test if data is NULL

Make sure data is not NULL otherwise we get an oops
when using the IOC_LIBCFS_MARK_DEBUG ioctl.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: move comment in libcfs_ioctl
Liang Zhen [Tue, 22 Mar 2016 23:03:53 +0000 (19:03 -0400)]
staging: lustre: libcfs: move comment in libcfs_ioctl

Move the comment about libcfs_ioctl_data_adjust to the
section where libcfs_ioctl_data_adjust is actually called.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: add debugging info for libcfs_ioctl
Liang Zhen [Tue, 22 Mar 2016 23:03:52 +0000 (19:03 -0400)]
staging: lustre: libcfs: add debugging info for libcfs_ioctl

Added some lustre debugging to track down potential future
bugs.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: merge libcfs_ioctl_handle into libcfs_ioctl
Liang Zhen [Tue, 22 Mar 2016 23:03:51 +0000 (19:03 -0400)]
staging: lustre: libcfs: merge libcfs_ioctl_handle into libcfs_ioctl

This is apart of the cleanup of libcfs_ioctl* code. In this
part we turn libcfs_ioctl_handle into libcfs_ioctl since
libcfs_ioctl is now a skeleton function.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: merge code from libcfs_ioctl into libcfs_ioctl_getdata
Liang Zhen [Tue, 22 Mar 2016 23:03:50 +0000 (19:03 -0400)]
staging: lustre: libcfs: merge code from libcfs_ioctl into libcfs_ioctl_getdata

This is apart of the cleanup of libcfs_ioctl* code. In this
part some of the code in libcfs_ioctl is migrated into
libcfs_ioctl_getdata_len() which is renamed libcfs_ioctl_getdata()

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: use break in switch options for libcfs_ioctl_handle
Liang Zhen [Tue, 22 Mar 2016 23:03:49 +0000 (19:03 -0400)]
staging: lustre: libcfs: use break in switch options for libcfs_ioctl_handle

Instead of just returning for each switch condition use a break.

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: libcfs: replace LNET_MAX_IOCTL_BUF_LEN with something bigger
Liang Zhen [Tue, 22 Mar 2016 23:03:48 +0000 (19:03 -0400)]
staging: lustre: libcfs: replace LNET_MAX_IOCTL_BUF_LEN with something bigger

The size of LNET_MAX_IOCTL_BUF_LEN restricts the size of
libcfs ioctl to the maximum needs of the LNet layer. Since
libcfs also handles things like debugging we might need
to let user land pass more data to or from the kernel than
what is possible

Signed-off-by: Liang Zhen <liang.zhen@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435
Reviewed-on: http://review.whamcloud.com/11313
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre: lnet: revert commit 4671a0266
James Simmons [Thu, 24 Mar 2016 15:24:02 +0000 (11:24 -0400)]
staging: lustre: lnet: revert commit 4671a0266

Commit 4671a0266 change the parameter of the second parameter of
cfs_precpt_alloc() from a sizeof type to sizeof type *pointer.
This was incorrect in this case and it caused a crash when the LNet
layer was brought up in my testing. The reason is cfs_precpt_alloc()
creates an array of items where the arrays size is equal to the
number of CPTs that exist. Changing to type *pointer only had
cfs_precpt_alloc() create an array of pointers instead of an array
of actual data structures. This patch reverse this change and adds
comments to explain what cfs_precpt_alloc() is actually doing to
avoid potential issues like this again.

Changelog:

v1) Simple revert of the original patch

v2) Added in comments to explain why cfs_precpt_alloc() has the
    arguments it uses.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Cc: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: media: omap1: Replace request_irq with devm_request_irq
Amitoj Kaur Chawla [Tue, 22 Mar 2016 16:53:02 +0000 (22:23 +0530)]
staging: media: omap1: Replace request_irq with devm_request_irq

Replace request_irq with devm_request_irq to get the interrupt
for device which is automatically freed on exit. Remove
corresponding free_irq from probe and remove functions of a
platform device.

Also, remove an unnecessary label.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: media: omap1: Switch to devm_ioremap_resource
Amitoj Kaur Chawla [Tue, 22 Mar 2016 16:52:56 +0000 (22:22 +0530)]
staging: media: omap1: Switch to devm_ioremap_resource

Replace calls to request_mem_region and ioremap with a direct
call to devm_ioremap_resource instead and modify error
handling.
Move the call to platform_get_resource adjacent to the call to
devm_ioremap_resource to make the connection between them more
clear.

Also remove unnecessary labels, variable initialisations and
release_mem_region iounmap from probe and remove functions.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: media: omap1: Replace kzalloc with devm_kzalloc
Amitoj Kaur Chawla [Tue, 22 Mar 2016 16:52:48 +0000 (22:22 +0530)]
staging: media: omap1: Replace kzalloc with devm_kzalloc

Replace kzalloc with devm_kzalloc and consequently remove kfrees in
probe and remove functions of a platform device.

As a result of this change, remove unnecessary out of memory message
and an unnecessary label.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: media: omap1: Replace clk_get with devm_clk_get
Amitoj Kaur Chawla [Tue, 22 Mar 2016 16:52:41 +0000 (22:22 +0530)]
staging: media: omap1: Replace clk_get with devm_clk_get

devm_clk_get allocated resources get released when a driver detaches.
Replace clk_get with devm_clk_get and remove corresponding data
releasing function clk_put from probe and remove functions of a
platform device. Also remove an unnecessary label.

This change was made with the help of the following Coccinelle
semantic patch:
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
  .probe = probefn,
  .remove = removefn,
};

@prb@
identifier platform.probefn, pdev;
expression e;
@@
probefn(struct platform_device *pdev, ...) {
  ...
  e =
- clk_get
+ devm_clk_get
  (...);
   ...
?- clk_put(...);
  ...
}
@remove depends on prb@
identifier platform.removefn;
@@
removefn(...) {
...
?- clk_put(...);
...
}

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8188eu: os_dep: ioctl_linux: Clean up tests if NULL returned on failure
Bhaktipriya Shridhar [Tue, 22 Mar 2016 14:49:49 +0000 (20:19 +0530)]
staging: rtl8188eu: os_dep: ioctl_linux: Clean up tests if NULL returned on failure

Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8188eu: os_dep: usb_intf: Clean up tests if NULL returned on failure
Bhaktipriya Shridhar [Tue, 22 Mar 2016 14:55:55 +0000 (20:25 +0530)]
staging: rtl8188eu: os_dep: usb_intf: Clean up tests if NULL returned on failure

Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8188eu: core: rtw_mlme: Clean up tests if NULL returned on failure
Bhaktipriya Shridhar [Tue, 22 Mar 2016 14:56:33 +0000 (20:26 +0530)]
staging: rtl8188eu: core: rtw_mlme: Clean up tests if NULL returned on failure

Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8188eu: rtw_mlme_ext: Clean up tests if NULL returned on failure
Bhaktipriya Shridhar [Tue, 22 Mar 2016 14:57:39 +0000 (20:27 +0530)]
staging: rtl8188eu: rtw_mlme_ext: Clean up tests if NULL returned on failure

Some functions like kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8188eu: rtw_cmd: Clean up tests if NULL returned on failure
Bhaktipriya Shridhar [Tue, 22 Mar 2016 14:58:28 +0000 (20:28 +0530)]
staging: rtl8188eu: rtw_cmd: Clean up tests if NULL returned on failure

Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:

@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>