linux-2.6-microblaze.git
10 years agostaging: rtl8188eu: Remove 'alloc_sz' from struct recv_buf
navin patidar [Sat, 3 May 2014 11:45:28 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove 'alloc_sz' from struct recv_buf

Driver isn't making any use of value stored in alloc_sz variable.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove 'pallocated_buf' from struct recv_buf
navin patidar [Sat, 3 May 2014 11:45:27 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove 'pallocated_buf' from struct recv_buf

pallocated_buf is not being used by driver.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove 'irp_pending' from struct recv_buf
navin patidar [Sat, 3 May 2014 11:45:26 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove 'irp_pending' from struct recv_buf

irp_pending is initialized to false inside rtw_os_recvbuf_resource_alloc()
and value of irq_pending never changed after that, so 'if (!precvbuf->irp_pending)'
inside rtw_os_read_port() function will be always true.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove pdata, phead, ptail and pend from struct recv_buf
navin patidar [Sat, 3 May 2014 11:45:25 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove pdata, phead, ptail and pend from struct recv_buf

Driver is not making use of value stored in removed variables.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove 'int transfer_len' from struct recv_buf
navin patidar [Sat, 3 May 2014 11:45:24 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove 'int transfer_len' from struct recv_buf

Driver is not making any use of value stored in this variable.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove 'dma_addr_t dma_transfer_addr' from struct recv_buf
navin patidar [Sat, 3 May 2014 11:45:23 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove 'dma_addr_t dma_transfer_addr' from struct recv_buf

Remove unused variable dma_transfer_addr.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove 'spinlock_t recvbuf_lock' from struct recv_buf
navin patidar [Sat, 3 May 2014 11:45:22 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove 'spinlock_t recvbuf_lock' from struct recv_buf

recvbuf_lock is initialized inside rtl8188eu_init_recv_priv() but never used.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove 'struct list_head list' from struct recv_buf
navin patidar [Sat, 3 May 2014 11:45:21 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove 'struct list_head list' from struct recv_buf

Users of 'struct list_head list' variable e.g. rtw_enqueue_recvbuf(),
rtw_enqueue_recvbuf_to_head() and rtw_dequeue_recvbuf() are
already removed.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove function rtw_enqueue_recvbuf()
navin patidar [Sat, 3 May 2014 11:45:20 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove function rtw_enqueue_recvbuf()

rtw_enqueue_recvbuf() is not being used by driver.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove function rtw_enqueue_recvbuf_to_head()
navin patidar [Sat, 3 May 2014 11:45:19 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove function rtw_enqueue_recvbuf_to_head()

rtw_enqueue_recvbuf_to_head() is not being used by driver.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove function rtw_dequeue_recvbuf()
navin patidar [Sat, 3 May 2014 11:45:18 +0000 (17:15 +0530)]
staging: rtl8188eu: Remove function rtw_dequeue_recvbuf()

rtw_dequeue_recvbuf() is not being used by driver.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agortl8821ae: fixed defined-not-used warning
Jan Moskyto Matejka [Wed, 30 Apr 2014 13:22:17 +0000 (15:22 +0200)]
rtl8821ae: fixed defined-not-used warning

by cleaning up BT_AUTO_REPORT_ONLY_8192E_2ANT
(always set to 0, never used as constant)

halbtc8192e2ant_iswifi_status_changed was called only from the unused code

Signed-off-by: Jan Moskyto Matejka <mq@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8192u: fix checkpatch braces warning
Rui Miguel Silva [Mon, 28 Apr 2014 11:12:54 +0000 (12:12 +0100)]
staging: rtl8192u: fix checkpatch braces warning

fix some code style related to the use of braces in a one statement block

Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/rtl8192e: Erroneous return codes (types and values)
Dominique van den Broeck [Sun, 27 Apr 2014 17:11:15 +0000 (19:11 +0200)]
staging/rtl8192e: Erroneous return codes (types and values)

This function returns a bool, that is supposed to be false when something
goes wrong. It's assumed this way by its lone calling function (which is
SetRFPowerState8190(), line 1445 of rtl8192e/rtl8192e/r8192E_phy.c)

Despite of this, this procedure returns non-null enumerations values or
negative codes instead. This patch fixes this.

Signed-off-by: Dominique van den Broeck <domdevlin@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Use USB subsystem functions to check endpoint type
navin patidar [Tue, 29 Apr 2014 01:25:13 +0000 (06:55 +0530)]
staging: rtl8188eu: Use USB subsystem functions to check endpoint type

Use inline functions provided by USB subsystem to check endpoint type,
instead of inline functions implemented by driver to do the same.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8188eu: Remove debugging messages from usb_dvobj_init()
navin patidar [Tue, 29 Apr 2014 01:25:12 +0000 (06:55 +0530)]
staging: rtl8188eu: Remove debugging messages from usb_dvobj_init()

Unnecessary debugging messages are removed from usb_dvobj_init().

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: serqt_usb2: Clean up initializations of variables
Thomas Vegas [Tue, 1 Apr 2014 16:29:37 +0000 (18:29 +0200)]
staging: serqt_usb2: Clean up initializations of variables

Use a more common kernel coding style.

Signed-off-by: Thomas Vegas <thomas_75@safe-mail.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: serqt_usb2: Add blank line after declaration
Thomas Vegas [Tue, 1 Apr 2014 16:28:33 +0000 (18:28 +0200)]
staging: serqt_usb2: Add blank line after declaration

Use a more common kernel coding style.

Signed-off-by: Thomas Vegas <thomas_75@safe-mail.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: serqt_usb2: Remove useless variable
Thomas Vegas [Tue, 1 Apr 2014 16:27:34 +0000 (18:27 +0200)]
staging: serqt_usb2: Remove useless variable

Use a more common kernel coding style.

Signed-off-by: Thomas Vegas <thomas_75@safe-mail.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: remove async parameter from resize_async_buffer()
Ian Abbott [Fri, 2 May 2014 12:50:14 +0000 (13:50 +0100)]
staging: comedi: remove async parameter from resize_async_buffer()

The `struct comedi_async *async` parameter of `resize_async_buffer()` is
redundant as its value can be easily derived from the `struct
comedi_subdevice *s` parameter as `s->async`.  Remove the parameter.

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>
10 years agostaging: comedi: remove redundant pointer dereference in comedi_poll()
Ian Abbott [Fri, 2 May 2014 12:50:13 +0000 (13:50 +0100)]
staging: comedi: remove redundant pointer dereference in comedi_poll()

`s->async->subdevice` in `comedi_poll()` points to the same `struct
comedi_subdevice` as `s`, so the double pointer reference is redundant.
Just use `s`.

(`s->async->subdevice` is initialized by
`__comedi_device_postconfig_async()` in
"drivers/staging/comedi/drivers.c" and doesn't change.)

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>
10 years agostaging: comedi: amplc_dio200_common: correct bound on counter mode
Ian Abbott [Thu, 1 May 2014 16:38:24 +0000 (17:38 +0100)]
staging: comedi: amplc_dio200_common: correct bound on counter mode

For the mode configured by the `INSN_CONFIG_SET_COUNTER_MODE` comedi
instruction for the counter subdevice channels supported by this module,
the upper bound should be `I8254_MODE5 | I8254_BCD` ((5 << 1) | 1)
rather than `I8254_MODE5 | I8254_BINARY` ((5 << 1) | 0).  Fix it.

Reported-by: Hartley Sweeten <HartleyS@visionengravers.com>
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>
10 years agostaging: comedi: drivers: correct mode check for i8254_set_mode()
Ian Abbott [Thu, 1 May 2014 16:38:23 +0000 (17:38 +0100)]
staging: comedi: drivers: correct mode check for i8254_set_mode()

The upper bound check on the `mode` parameter of `i8254_set_mode()` and
`i8254_mm_set_mode()` is incorrect.  The `mode` parameter value consists
of a mode number in the range 0 to 5 in bits 3..1 {represented by the
constants `I8254_MODE0` (0 << 1) through to `I8254_MODE5` (2 << 1)} ORed
with a BCD/binary flag in bit 0 {represented by the constants
`I8254_BINARY` (0) and `I8254_BCD` (1)}.  The maximum allowed value
ought to be `I8254_MODE5 | I8254_BCD` ((5 << 1) | 1), but is currently
`I8254_MODE5 | I8254_BINARY` ((5 << 1) | 0).  Fix it.

None of the comedi drivers use `I8254_BCD` but some of the low-level
drivers allow user-space to configure the counter mode, so all legal
values ought to be allowed.  However, it's pretty unlikely anyone would
want to set the counters to count in BCD (binary coded decimal) so the
bug is not that significant.

Reported-by: Hartley Sweeten <HartleyS@visionengravers.com>
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>
10 years agostaging: comedi: fix checkpatch warnings
Luca Ellero [Wed, 30 Apr 2014 09:22:07 +0000 (11:22 +0200)]
staging: comedi: fix checkpatch warnings

Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: das16: clarify 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:59 +0000 (12:59 -0700)]
staging: comedi: das16: clarify 8254 timer programming

Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify 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>
10 years agostaging: comedi: das16m1: clarify 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:58 +0000 (12:59 -0700)]
staging: comedi: das16m1: clarify 8254 timer programming

Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify 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>
10 years agostaging: comedi: ni_at_a2150: clarify 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:57 +0000 (12:59 -0700)]
staging: comedi: ni_at_a2150: clarify 8254 timer programming

Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify 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>
10 years agostaging: comedi: ni_labpc: fix 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:56 +0000 (12:59 -0700)]
staging: comedi: ni_labpc: fix 8254 timer programming

As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".

The labpc_counter_load() function in this driver is passed an
I8254_MODE* value so we need to use the i8254_set_mode() and
i8254_write() helpers instead of i8254_load() to program the
timers.

The calls to labpc_counter_load() will not fail so change the
return to void and remove all the unnecessary error handling.

Similarly, change the return type of labpc_counter_set_mode() to
void and remove the unnecessary error handling.

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>
10 years agostaging: comedi: das800: clarify 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:55 +0000 (12:59 -0700)]
staging: comedi: das800: clarify 8254 timer programming

Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.

The das800_set_frequency() function will not fail. For aesthetics
change the return to a void and remove the error handling.

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>
10 years agostaging: comedi: amplc_pci244: clarify 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:54 +0000 (12:59 -0700)]
staging: comedi: amplc_pci244: clarify 8254 timer programming

Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify 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>
10 years agostaging: comedi: me4000: fix 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:53 +0000 (12:59 -0700)]
staging: comedi: me4000: fix 8254 timer programming

As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".

Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.

Also, use the CR_CHAN() macro to make sure the only the channel is
used in the insh->chanspec to specify the counter number.

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>
10 years agostaging: comedi: ni_at_ao: fix 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:52 +0000 (12:59 -0700)]
staging: comedi: ni_at_ao: fix 8254 timer programming

As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".

Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify 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>
10 years agostaging: comedi: pcl711: fix 8254 timer programming
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:51 +0000 (12:59 -0700)]
staging: comedi: pcl711: fix 8254 timer programming

As pointed out by Ian Abbott, the i8254_load() function does not
use the I8254_MODE* values to specify the "mode".

Refactor the 8254 timer programming to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows
us to use the I8254_MODE* defines to clarify the code.

For aesthetics, factor the timer programming out as a separate
function.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: hwdrv_apci3120: remove clearing of 'b_OutputMemoryStatus'
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:50 +0000 (12:59 -0700)]
staging: comedi: hwdrv_apci3120: remove clearing of 'b_OutputMemoryStatus'

This private data member is not used by this driver. Remove the unnecessary
clearing of 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>
10 years agostaging: comedi: hwdrv_apci3120: fix 'b_AiCyclicAcquisition' usage
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:49 +0000 (12:59 -0700)]
staging: comedi: hwdrv_apci3120: fix 'b_AiCyclicAcquisition' usage

This private data member is set when an analog input async command is
started by apci3120_cyclic_ai() and cleared when the command finishes
or is canceled.

Rename the CamelCase member to 'ai_running' and convert it to a
bit-field flag.

Remove the unnecessary clearing of the flag before or after calling
apci3120_cancel().

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>
10 years agostaging: comedi: hwdrv_apci3120: cmd->convert_src is always TRIG_TIMER
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:48 +0000 (12:59 -0700)]
staging: comedi: hwdrv_apci3120: cmd->convert_src is always TRIG_TIMER

The (*do_cmdtest) validates that the cmd->convert_src can only be
TRIG_TIMER. Remove the unnecessay checks.

THis also simplifies the (*do_cmd) a bit since "mode 3" (whatever that
is) is never a valid 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>
10 years agostaging: comedi: addi_common.h: remove 'b_AiContinuous' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:47 +0000 (12:59 -0700)]
staging: comedi: addi_common.h: remove 'b_AiContinuous' from private data

This member of the private data can be determined by checking the cmd->stop_src.
Do that instead.

Fix the b_AiContinuous check in apci3120_ai_cmd(). The (*do_cmdtest) validates
that the cmd->stop_arg os >= 1 for TRIG_COUNT and 0 for TRIG_NONE. The correct
test to set this flag is (cmd->stop_src == TRIG_NONE).

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>
10 years agostaging: comedi: addi_common.h: remove 'ui_AiNbrofScans' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:46 +0000 (12:59 -0700)]
staging: comedi: addi_common.h: remove 'ui_AiNbrofScans' from private data

This member of the private data is a copy of the cmd->stop_arg. Use that
instead.

Fix the b_AiContinuous check in apci3120_ai_cmd(). The (*do_cmdtest) validates
that the cmd->stop_arg os >= 1 for TRIG_COUNT and 0 for TRIG_NONE. The correct
test to set this flag is (cmd->stop_src == TRIG_NONE).

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>
10 years agostaging: comedi: addi_common.h: remove 'ui_AiDataLength' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:45 +0000 (12:59 -0700)]
staging: comedi: addi_common.h: remove 'ui_AiDataLength' from private data

This member of the private data is a copy of the s->async->prealloc_bufsz.
Use that instead.

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>
10 years agostaging: comedi: addi_common.h: remove 'ui_AiTimer1' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:44 +0000 (12:59 -0700)]
staging: comedi: addi_common.h: remove 'ui_AiTimer1' from private data

This member of the private data is a copy of the cmd->scan_begin_arg.
Use that instead.

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>
10 years agostaging: comedi: addi_common.h: remove 'ui_AiTimer0' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:43 +0000 (12:59 -0700)]
staging: comedi: addi_common.h: remove 'ui_AiTimer0' from private data

This member of the private data is a copy of the cmd->convert_arg. Use
that instead.

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>
10 years agostaging: comedi: addi_common.h: remove 'pui_AiChannelList' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:42 +0000 (12:59 -0700)]
staging: comedi: addi_common.h: remove 'pui_AiChannelList' from private data

This member of the private data is a copy of the cmd->chanlist. Use that
instead.

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>
10 years agostaging: comedi: addi_common.h: remove 'ui_AiScanLength' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:41 +0000 (12:59 -0700)]
staging: comedi: addi_common.h: remove 'ui_AiScanLength' from private data

This member of the private data is a copy of the cmd->scan_end_arg. Use that
instead.

Use a local variable in apci3120_cyclic_ai() for the DMA 'scan_bytes', which
is the cmd->scan_end_arg * 2. Replace the open-coded '2' with sizeof(short).

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>
10 years agostaging: comedi: addi_common.h: remove 'ui_AiFlags' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:40 +0000 (12:59 -0700)]
staging: comedi: addi_common.h: remove 'ui_AiFlags' from private data

This member of the private data is a copy of the cmd->flags. Use that instead.

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>
10 years agostaging: comedi: amplc_pci230: remove 'ao_continuous' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:39 +0000 (12:59 -0700)]
staging: comedi: amplc_pci230: remove 'ao_continuous' from private data

This member of the private data can be determined by checking the cmd->stop_src.
Do that instead.

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>
10 years agostaging: comedi: amplc_pci230: remove 'ai_continuous' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:38 +0000 (12:59 -0700)]
staging: comedi: amplc_pci230: remove 'ai_continuous' from private data

This member of the private data can be determined by checking the cmd->stop_src.
Do that instead.

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>
10 years agostaging: comedi: amplc_pci224: remove 'ai_stop_continuous' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:37 +0000 (12:59 -0700)]
staging: comedi: amplc_pci224: remove 'ai_stop_continuous' from private data

This member of the private data can be determined by checking the cmd->stop_src.
Do that instead.

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>
10 years agostaging: comedi: addi_apci_2032: tidy up cmd use in apci2032_interrupt()
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:36 +0000 (12:59 -0700)]
staging: comedi: addi_apci_2032: tidy up cmd use in apci2032_interrupt()

Use a local variable for the comedi_cmd and tidy up this function 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>
10 years agostaging: comedi: adl_pci9111: tidy up (*do_cmdtest) Step 4
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:35 +0000 (12:59 -0700)]
staging: comedi: adl_pci9111: tidy up (*do_cmdtest) Step 4

This step in the (*do_cmdtest) fixes the comedi_cmd arguments, usually
for TRIG_TIMER sources.

Tidy up this step to clarify the code and remove the extra local
variables. All the arguments are unsigned long so change the 'tmp'
local variable type and rename it for aesthetics.

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>
10 years agostaging: comedi: 8253.h: remove the unused i8253_cascade_ns_to_timer_*()
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:34 +0000 (12:59 -0700)]
staging: comedi: 8253.h: remove the unused i8253_cascade_ns_to_timer_*()

None of the comedi drivers use the i8253_cascade_ns_to_timer_2div_old()
or i8253_cascade_ns_to_timer_power() helpers to calculate the cascaded
divisors. Remove them to avoid any confusion.

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>
10 years agostaging: comedi: 8253.h: rename i8253_cascade_ns_to_timer_2div()
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:33 +0000 (12:59 -0700)]
staging: comedi: 8253.h: rename i8253_cascade_ns_to_timer_2div()

All of the comedi drivers use the i8253_cascade_ns_to_timer macro
when calculating the divisors for the cascaded timers. This macro
just causes the i8253_cascade_ns_to_timer_2div() inline to be used.

Rename i8253_cascade_ns_to_timer_2div() and remove the 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>
10 years agostaging: comedi: das1800: don't calc pacer divisors twice
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:32 +0000 (12:59 -0700)]
staging: comedi: das1800: don't calc pacer divisors twice

The analog input async command can use the pacer for the scan_begin_src
or the convert_src. The (*do_cmdtest) calculates the divisors when
validating the cmd argument.

There is no reason to recalc the divisors in the (*do_cmd). Just use the
values from the private data.

For aesthetics, rename the setup_counters() function so it has namespace
associated with the driver. Refactor the function to use the values from
the private data and absorb das1800_set_frequency() to clarify the code.
Refactor the function to use the i8254_set_mode() and i8254_write()
helpers instead of i8254_load(). This allows us to use the I8254_* defines
when setting the mode to clarify the code.

This function will not fail so change the return type to void to simplify
the (*do_cmd) 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>
10 years agostaging: comedi: das1800: refactor Step 4 of das1800_ai_do_cmdtest()
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:31 +0000 (12:59 -0700)]
staging: comedi: das1800: refactor Step 4 of das1800_ai_do_cmdtest()

Refactor this code to reduce the indent level and the > 80 char
lines.

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>
10 years agostaging: comedi: das16m1: don't calc pacer divisors twice
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:30 +0000 (12:59 -0700)]
staging: comedi: das16m1: don't calc pacer divisors twice

The analog input async command can use the pacer for the convert_src. The
(*do_cmdtest) calculates the divisors when validating the cmd argument.

There is no reason to recalc the divisors in the (*do_cmd). Just use the
values from the private data.

Refactor das16m1_set_pacer() to use the i8254_set_mode() and i8254_write()
helpers instead of i8254_load(). This allows us to use the I8254_* defines
when setting the mode to clarify the code.

Tidy up das16m1_cmd_exec() a bit. The pacer only needs to be set when the
convert_src is TRIG_TIMER.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: cb_pcidas: don't calc ao pacer divisors twice
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:29 +0000 (12:59 -0700)]
staging: comedi: cb_pcidas: don't calc ao pacer divisors twice

The analog output async command can use the pacer for the scan_begin_src.
The (*do_cmdtest) calculates the divisors when validating the cmd argument.

There is no reason to recalc the divisors in the (*do_cmd). Just use the
values from the private data.

For aesthetics, factor out the code that loads the counters to match the
analog input. Refactor the code to use the i8254_set_mode() and i8254_write()
helpers instead of i8254_load(). This allows us to use the I8254_* defines
when setting the mode to clarify 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>
10 years agostaging: comedi: cb_pcidas: don't calc ai pacer divisors twice
H Hartley Sweeten [Tue, 29 Apr 2014 19:59:28 +0000 (12:59 -0700)]
staging: comedi: cb_pcidas: don't calc ai pacer divisors twice

The analog input async command can use the pacer for the scan_bagin_src
or the convert_src. The (*do_cmdtest) validates that only one of these
sources has the TRIG_TIMER selected and calculates the divisors when
validating the cmd argument.

There is no reason to recalc the divisors in the (*do_cmd). Just use
the values from the private data.

Also, refactor cb_pcidas_load_counters() to use the i8254_set_mode()
and i8254_write() helpers instead of i8254_load(). This allows us to
use the I8254_* defines when setting the mode to clarify 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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_act_chan' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:43 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: remove 'ai_act_chan' from private data

This member of the private data is not ued by the driver. Remove 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>
10 years agostaging: comedi: adv_pci1710: remove 'i8254_osc_base' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:42 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: remove 'i8254_osc_base' from private data

This member of the private data is always set to I8254_OSC_BASE_10MHZ. Remove
it from the private data and just open code the value.

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>
10 years agostaging: comedi: adv_pci1710: always enable PCI171x_PARANOIDCHECK code
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:41 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: always enable PCI171x_PARANOIDCHECK code

This define enables code that checks for analog input channel dropout
when reading samples. The define is enabled so we might as well always
enable the code and remove the define.

Factor out the common channel dropout detect code as a helper function
and cleanup 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>
10 years agostaging: comedi: adv_pci1710: rename interrupt helper functions
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:40 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: rename interrupt helper functions

For aesthetics, rename the helper functions that are called by
the interrupt function to handle reading the analog input samples.

Also, change the parameters to the helpers to the comedi_device
and comedi_subdevice pointers.

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>
10 years agostaging: comedi: adv_pci1710: tidy up start_pacer()
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:39 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: tidy up start_pacer()

For aesthetics, rename this function so it has namespace associated
with the driver.

Change the parameters to the function. The 'mode' is really a flag to
load the counters and the divisors can be found in the private data.

To clarify the code and remove the magic numbers, use the 8253.h
helpers to set the timer mode and load the counters.

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>
10 years agostaging: comedi: adv_pci1710: remove local var in pci171x_ai_cmd()
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:38 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: remove local var in pci171x_ai_cmd()

The local variable 'mode' is not necessary. We can determine the mode
by checking the cmd->convert_src and cmd->start_src. Do this instead
to clarify 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>
10 years agostaging: comedi: adv_pci1710: only calc the pacer divisors once
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:37 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: only calc the pacer divisors once

When the cmd->convert_src == TRIG_TIMER the divisors needed to
generate the pacer time are calculated in the (*do_cmdtest) to
validate the cmd->convert_arg. The core always does the (*do_cmdtest)
before the (*do_cmd) so there is no reason to recalc the divisors.

Save the calculated divisors in the private data as 'next_divisor[12]'.
The (*do_cmd) then transfers them to the private data 'divisor[12]' so
that they can be used to set the timer for the command immediately or
later when the cmd->start_src is TRIG_EXT (mode 2 in this 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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_eos' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:36 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: remove 'ai_eos' from private data

This member of the private data is is not necessary. We can just check the
cmd->flags for TRIG_WAKE_EOS when needed. Remvoe the member.

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>
10 years agostaging: comedi: adv_pci1710: remove 'ai_buf_ptr' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:35 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: remove 'ai_buf_ptr' from private data

This member of the private data is set to 0 but never used. Just remove 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>
10 years agostaging: comedi: adv_pci1710: remove 'neverending_ai' from private data
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:34 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: remove 'neverending_ai' from private data

This member of the private data is not necessary. We can determine if
the analog input command is neverending by checking the cmd->stop_src:

  TRIG_COUNT -> !neverending_ai
  TRIG_NONE -> neverending_ai

Do that instead and remove the unnecessary member.

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>
10 years agostaging: comedi: adv_pci1710: don't check the chanlist twice
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:33 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: don't check the chanlist twice

The chanlist is checked in Step 5 of the (*do_cmdtest) there is no
reason to check it again in the (*do_cmd). The only reason its done
again is to get the actual 'seglen', the non-repeating length of the
chanlist.

Save the 'seglen' found by pci171x_ai_check_chanlist() in the private
data and use that in the (*do_cmd). Rename the private data member to
clarify it. Also, remove the unused 'act_chanlist_pos' member from the
private data.

Refactor the error handling in pci171x_ai_check_chanlist() so it returns
and errno for failure and 0 for success.

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>
10 years agostaging: comedi: adv_pci1710: tidy up pci171x_ai_check_chanlist()
H Hartley Sweeten [Tue, 29 Apr 2014 18:08:32 +0000 (11:08 -0700)]
staging: comedi: adv_pci1710: tidy up pci171x_ai_check_chanlist()

Tidy up this function to clarify what the chanlist is being checked 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>
10 years agostaging: comedi: fix coding style issues in comedi_fops.c
Raghavendra Ganiga [Thu, 1 May 2014 08:23:12 +0000 (13:53 +0530)]
staging: comedi: fix coding style issues in comedi_fops.c

This is a patch to fix coding style
warnings found by checkpatch.pl tool

Signed-off-by: Raghavendra Chandra Ganiga <ravi23ganiga@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: addi_apci_1564: remove use of devpriv->s_EeParameters
Chase Southwood [Sat, 3 May 2014 07:49:15 +0000 (02:49 -0500)]
staging: comedi: addi_apci_1564: remove use of devpriv->s_EeParameters

This driver no longer reads the eeprom to find the board specific data,
all the necessary data is in the boardinfo. Use the boardinfo directly
instead of passing through devpriv->s_EeParameters.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: addi_apci_1564: remove unnecessary info from boardinfo
Chase Southwood [Tue, 29 Apr 2014 08:37:17 +0000 (03:37 -0500)]
staging: comedi: addi_apci_1564: remove unnecessary info from boardinfo

The i_IorangeBase1, i_PCIEeprom, and pc_EepromChip data in the boardinfo
was only needed to work out the usage of the PCI bars.  Now that that is
squared away, this info is no longer needed and can be removed.

Signed-off-by: Chase Southwood <chase.southwood@gmail.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>
10 years agostaging: comedi: addi_apci_1564: simplify the PCI bar reading and don't read the...
Chase Southwood [Wed, 30 Apr 2014 07:57:59 +0000 (02:57 -0500)]
staging: comedi: addi_apci_1564: simplify the PCI bar reading and don't read the unused bars

This driver only uses PCI bar 0 (devpriv->i_IobaseAmcc), and PCI bar 1
(dev->iobase), don't bother reading the unused PCI bars.

Signed-off-by: Chase Southwood <chase.southwood@gmail.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>
10 years agostaging: comedi: addi_apci_1564: board has 32 digital inputs
Chase Southwood [Tue, 29 Apr 2014 08:34:23 +0000 (03:34 -0500)]
staging: comedi: addi_apci_1564: board has 32 digital inputs

This board always has 32 digital inputs. Remove the test when
initializing the subdevice.

Also, since this board is the only one supported by this driver,
remove the boardinfo about the digital inputs and just use the
data directly in the subdevice init.

Signed-off-by: Chase Southwood <chase.southwood@gmail.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>
10 years agostaging: comedi: addi_apci_1564: remove unnecessary include
Chase Southwood [Sun, 27 Apr 2014 01:36:44 +0000 (20:36 -0500)]
staging: comedi: addi_apci_1564: remove unnecessary include

This include is no longer needed.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: addi_apci_1564: remove eeprom support code
Chase Southwood [Sun, 27 Apr 2014 01:35:58 +0000 (20:35 -0500)]
staging: comedi: addi_apci_1564: remove eeprom support code

Reading the eeprom on this board is not necessary.  All information
required is in the boardinfo.

Remove the eeprom support code which is not really useful here.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: comedi: remove duplicate pointer assignments in attach functions
Christian Engelmayer [Sat, 26 Apr 2014 14:04:29 +0000 (16:04 +0200)]
staging: comedi: remove duplicate pointer assignments in attach functions

Some board pointer are assigned twice via comedi_board() in the comedi low
level driver attach functions. Remove the duplicate assignment from the
variable definition where the pointer is not used anyway until assigned later
in the function when dev->board_ptr, that comedi_board() relies on, is setup
correctly.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agogoldfish bus: don't call request_mem_region
Alan Cox [Mon, 28 Apr 2014 19:50:56 +0000 (20:50 +0100)]
goldfish bus: don't call request_mem_region

This is a bug fix that has been lurking in the Google tree but not pushed
upstream.

From: Octavian Purdila <octavian.purdila@intel.com>

The memory region is already reserved in goldfish_init() during
platform init.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agogoldfish: Add a 64bit write helper
Alan [Mon, 28 Apr 2014 19:47:36 +0000 (20:47 +0100)]
goldfish: Add a 64bit write helper

The base code imported from the Google tree is ifdef heaven. Prepare to fix
this by adding a helper function.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agogoldfish: 64-bit nand driver for goldfish platform
Jun Tian [Mon, 28 Apr 2014 19:47:22 +0000 (20:47 +0100)]
goldfish: 64-bit nand driver for goldfish platform

Enable the 64-bit nand data support in the goldfish nand driver.

Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agogoldfish: 64-bit audio driver for goldfish platform
Jun Tian [Mon, 28 Apr 2014 19:47:03 +0000 (20:47 +0100)]
goldfish: 64-bit audio driver for goldfish platform

Enable the 64-bit goldfish audio driver.
Support 64-bit buffer address and data read/write.

Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: android: fix missing a blank line after declarations
Seunghun Lee [Wed, 30 Apr 2014 16:30:23 +0000 (01:30 +0900)]
staging: android: fix missing a blank line after declarations

This patch fixes "Missing a blank line after declarations" warnings.

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: rtl8192u: cleanup a switch statement
Dan Carpenter [Wed, 30 Apr 2014 10:06:03 +0000 (13:06 +0300)]
staging: rtl8192u: cleanup a switch statement

The white space was all wrong here.  The case statements were indented
too far.  The if else blocks weren't indented at all.  There was a break
statement aligned with the else block and it confused my static checker
because "were curly braces intended" so that the break statement was
only on the else side?  Also I removed some commented out code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: frontier: fix some indenting
Dan Carpenter [Tue, 29 Apr 2014 12:42:13 +0000 (15:42 +0300)]
staging: frontier: fix some indenting

There were a couple lines which were not indented far enough and it was
confusing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8188eu: indent for loop body
Dan Carpenter [Tue, 29 Apr 2014 12:41:01 +0000 (15:41 +0300)]
staging: r8188eu: indent for loop body

The for loop body wasn't indented so it upset my static checker.  Also
I removed an obsolete comment on the same line.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: r8188eu: cleanup by using "len" consistently
Dan Carpenter [Fri, 4 Apr 2014 21:18:55 +0000 (00:18 +0300)]
staging: r8188eu: cleanup by using "len" consistently

"*(p + 1)" and "len" are the same thing.  For reviewers who don't know
that, then this code is worrying because we cap "len", but pass
"*(p + 1)" to memcpy().

I have changed the code to use "len" throughout.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: nokia_h4p: Fix a coding style problem
Sarath Lakshman [Wed, 2 Apr 2014 21:00:18 +0000 (02:30 +0530)]
staging: nokia_h4p: Fix a coding style problem

Fold a line to make it less than 80 characters

Signed-off-by: Sarath Lakshman <sarathlakshman@slynux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre use kernel socket sockopt apis
Fredrick John Berchmans [Sat, 3 May 2014 02:50:15 +0000 (19:50 -0700)]
staging: lustre use kernel socket sockopt apis

Change old way of ops->setsockopt or ops->getsockopt in kernel
to kernel_setsockopt or kernel_getsockopt.

Signed-off-by: Fredrick John Berchmans <fredrickprashanth@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre/llite: Fix unused variable warning if !CONFIG_FS_POSIX_ACL
Geert Uytterhoeven [Fri, 2 May 2014 16:28:35 +0000 (18:28 +0200)]
staging/lustre/llite: Fix unused variable warning if !CONFIG_FS_POSIX_ACL

If CONFIG_FS_POSIX_ACL=n:

drivers/staging/lustre/lustre/llite/xattr.c: In function 'll_setxattr_common':
drivers/staging/lustre/lustre/llite/xattr.c:115:27: warning: unused variable 'rce' [-Wunused-variable]

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: Use %zd to format ssize_t
Geert Uytterhoeven [Fri, 2 May 2014 16:28:34 +0000 (18:28 +0200)]
staging: lustre: Use %zd to format ssize_t

drivers/staging/lustre/lustre/llite/rw26.c: In function 'll_direct_IO_26':
drivers/staging/lustre/lustre/llite/rw26.c:383:2: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'ssize_t' [-Wformat]
drivers/staging/lustre/lustre/llite/rw26.c:383:2: warning: format '%lu' expects argument of type 'long unsigned int', but argument 10 has type 'ssize_t' [-Wformat]

Join the quoted string split across lines to fix a checkpatch warning while
we're at it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre/libcfs: Fix build errors for !CONFIG_SMP
Geert Uytterhoeven [Fri, 2 May 2014 16:28:33 +0000 (18:28 +0200)]
staging/lustre/libcfs: Fix build errors for !CONFIG_SMP

When CONFIG_SMP=n:

drivers/staging/lustre/include/linux/libcfs/linux/linux-mem.h:58:31: fatal error: libcfs/libcfs_cpu.h: No such file or directory

drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:78:1: error: redefinition of 'cfs_cpt_table_print'
drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h:109:1: note: previous definition of 'cfs_cpt_table_print' was here

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: integer overflow in obd_ioctl_is_invalid()
Dan Carpenter [Mon, 28 Apr 2014 10:58:58 +0000 (13:58 +0300)]
staging: lustre: integer overflow in obd_ioctl_is_invalid()

The obd_ioctl_getdata() function caps "data->ioc_len" at
OBD_MAX_IOCTL_BUFFER and then calls this obd_ioctl_is_invalid() to check
that the other values inside data are valid.

There are several lengths inside data but when they are added together
they must not be larger than "data->ioc_len".  The checks against
"(data->ioc_inllen1 > (1<<30))" are supposed to ensure that the addition
does not have an integer overflow.  But "(1<<30) * 4" actually can
overflow 32 bits, so the checks are insufficient.

I have changed it to "> OBD_MAX_IOCTL_BUFFER" instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre/lnet: fix potential null pointer dereference
Oleg Drokin [Mon, 28 Apr 2014 02:25:58 +0000 (22:25 -0400)]
staging/lustre/lnet: fix potential null pointer dereference

Pointer 'ni' checked for NULL at line 1569 may be passed to
function and may be dereferenced there by passing argument 1 to
function 'lnet_ni_notify_locked' at line 1621.
found by Klocwork Insight tool

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
CC: Dmitry Eremin <dmitry.eremin@intel.com>
CC: Liang Zhen <liang.zhen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre/lnet: fix potential null pointer dereference in kiblnd_rejected
Dmitry Eremin [Mon, 28 Apr 2014 02:25:57 +0000 (22:25 -0400)]
staging/lustre/lnet: fix potential null pointer dereference in kiblnd_rejected

Null pointer 'cp' that comes from line 2544 may be dereferenced
at line 2618.
found by Klocwork Insight tool

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: http://review.whamcloud.com/9386
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre/lnet: remove unused variable in lnet_destroy_remote_nets_table
Dmitry Eremin [Mon, 28 Apr 2014 02:25:56 +0000 (22:25 -0400)]
staging/lustre/lnet: remove unused variable in lnet_destroy_remote_nets_table

Local variable 'hash' is never used
found by Klocwork Insight tool

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: http://review.whamcloud.com/9386
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Isaac Huang <he.huang@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre/lnet: Drop useless LASSERT in ksocknal_select_ips
Oleg Drokin [Mon, 28 Apr 2014 02:25:55 +0000 (22:25 -0400)]
staging/lustre/lnet: Drop useless LASSERT in ksocknal_select_ips

It should never be NULL because our interface list is up to date,
and even if it does, we'll just crash anyway so we are no better off.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging/lustre: Replace jobid acquiring with per node setting
Oleg Drokin [Mon, 28 Apr 2014 02:21:52 +0000 (22:21 -0400)]
staging/lustre: Replace jobid acquiring with per node setting

Insted of meddling directly in process environment variables
(which is also not possible on certain platforms due to not exported
symbols), create jobid_name proc file to represent this info
(to be filled by job scheduler epilogue).

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
CC: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agostaging: lustre: check for integer overflow
Vitaly Osipov [Sat, 26 Apr 2014 15:08:21 +0000 (01:08 +1000)]
staging: lustre: check for integer overflow

In ll_ioctl_fiemap(), a user-supplied value is used to calculate a
length of a buffer which is later allocated with user data.

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10 years agoMerge 3.15-rc3 into staging-next
Greg Kroah-Hartman [Mon, 28 Apr 2014 04:38:34 +0000 (21:38 -0700)]
Merge 3.15-rc3 into staging-next

10 years agoLinux 3.15-rc3
Linus Torvalds [Mon, 28 Apr 2014 02:29:27 +0000 (19:29 -0700)]
Linux 3.15-rc3

10 years agoword-at-a-time: avoid undefined behaviour in zero_bytemask macro
Will Deacon [Wed, 23 Apr 2014 16:52:52 +0000 (17:52 +0100)]
word-at-a-time: avoid undefined behaviour in zero_bytemask macro

The asm-generic, big-endian version of zero_bytemask creates a mask of
bytes preceding the first zero-byte by left shifting ~0ul based on the
position of the first zero byte.

Unfortunately, if the first (top) byte is zero, the output of
prep_zero_mask has only the top bit set, resulting in undefined C
behaviour as we shift left by an amount equal to the width of the type.
As it happens, GCC doesn't manage to spot this through the call to fls(),
but the issue remains if architectures choose to implement their shift
instructions differently.

An example would be arch/arm/ (AArch32), where LSL Rd, Rn, #32 results
in Rd == 0x0, whilst on arch/arm64 (AArch64) LSL Xd, Xn, #64 results in
Xd == Xn.

Rather than check explicitly for the problematic shift, this patch adds
an extra shift by 1, replacing fls with __fls. Since zero_bytemask is
never called with a zero argument (has_zero() is used to check the data
first), we don't need to worry about calling __fls(0), which is
undefined.

Cc: <stable@vger.kernel.org>
Cc: Victor Kamensky <victor.kamensky@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>