]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
9 years agostaging: wilc1000: add an argument for Handle_SetWfiDrvHandler
Johnny Kim [Thu, 20 Aug 2015 07:32:51 +0000 (16:32 +0900)]
staging: wilc1000: add an argument for Handle_SetWfiDrvHandler

Similar to functions of same layer, this patch add an argument for
Handle_SetWfiDrvHandler function. As a result, the redundant typecasting is
removed.

Signed-off-by: Johnny Kim <johnny.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: use the real data type
Johnny Kim [Thu, 20 Aug 2015 07:32:50 +0000 (16:32 +0900)]
staging: wilc1000: use the real data type

This patch changes the type of gu8FlushedJoinReqDrvHandler with his real
data type becasue typecasting is not necessary. In result, typecasting
which is not necessary and some building warnings is removed.

Signed-off-by: Johnny Kim <johnny.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: rename WILC_MsgQueueDestroy to wilc_mq_destroy
Chaehyun Lim [Wed, 19 Aug 2015 06:59:08 +0000 (15:59 +0900)]
staging: wilc1000: rename WILC_MsgQueueDestroy to wilc_mq_destroy

This patch replaces WILC_MsgQueueDestroy to wilc_mq_destroy to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: rename WILC_MsgQueueRecv to wilc_mq_recv
Chaehyun Lim [Wed, 19 Aug 2015 06:59:07 +0000 (15:59 +0900)]
staging: wilc1000: rename WILC_MsgQueueRecv to wilc_mq_recv

This patch replaces WILC_MsgQueueRecv with wilc_mq_recv
to shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: rename WILC_MsgQueueSend to wilc_mq_send
Chaehyun Lim [Wed, 19 Aug 2015 06:59:06 +0000 (15:59 +0900)]
staging: wilc1000: rename WILC_MsgQueueSend to wilc_mq_send

This patch replaces WILC_MsgQueueSend with wilc_mq_send to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: rename WILC_MsgQueueCreate to wilc_mq_create
Chaehyun Lim [Wed, 19 Aug 2015 06:59:05 +0000 (15:59 +0900)]
staging: wilc1000: rename WILC_MsgQueueCreate to wilc_mq_create

This patch replaces WILC_MsgQueueCreate with wilc_mq_create to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: replace WILC_ErrNo by int type
Chaehyun Lim [Wed, 19 Aug 2015 06:59:04 +0000 (15:59 +0900)]
staging: wilc1000: replace WILC_ErrNo by int type

This patch replaces WILC_ErrNo with int type.
WILC_ErrNo typedef is also removed.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_msgqueue.c: fix bool comparison style
Chaehyun Lim [Wed, 19 Aug 2015 06:59:03 +0000 (15:59 +0900)]
staging: wilc1000: wilc_msgqueue.c: fix bool comparison style

This patch changes bool comparison style found by checkpatch.pl
CHECK: Using comparison to true is error prone

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_msgqueue.c: remove kfree NULL check
Chaehyun Lim [Wed, 19 Aug 2015 06:59:02 +0000 (15:59 +0900)]
staging: wilc1000: wilc_msgqueue.c: remove kfree NULL check

This patch removes kfree NULL check.
WARNING: kfree(NULL) is safe and this check is probably not required.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_msgqueue.c: use ! operator instead of NULL comparison
Chaehyun Lim [Wed, 19 Aug 2015 06:59:01 +0000 (15:59 +0900)]
staging: wilc1000: wilc_msgqueue.c: use ! operator instead of NULL comparison

This patch uses ! operator instead of NULL comparison.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_msgqueue.c: remove unnecessary parentheses
Chaehyun Lim [Wed, 19 Aug 2015 06:59:00 +0000 (15:59 +0900)]
staging: wilc1000: wilc_msgqueue.c: remove unnecessary parentheses

This patch remove unnecessary parentheses found by checkpatch.pl
CHECK: Unnecessary parentheses around pHandle->hSem

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_msgqueue.c: remove blank line before a close brace
Chaehyun Lim [Wed, 19 Aug 2015 06:58:59 +0000 (15:58 +0900)]
staging: wilc1000: wilc_msgqueue.c: remove blank line before a close brace

This patch removes blank line before a close brace "}"
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_msgqueue.c: remove multiple blank lines
Chaehyun Lim [Wed, 19 Aug 2015 06:58:58 +0000 (15:58 +0900)]
staging: wilc1000: wilc_msgqueue.c: remove multiple blank lines

This patch removes multiple blank lines.
CHECK: Please don't use multiple blank lines

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_msgqueue.c: remove blank line after open brace
Chaehyun Lim [Wed, 19 Aug 2015 06:58:57 +0000 (15:58 +0900)]
staging: wilc1000: wilc_msgqueue.c: remove blank line after open brace

This patch removes a blank line for open brace "{"
CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: wilc_msgqueue.c: remove braces for single statement
Chaehyun Lim [Wed, 19 Aug 2015 06:58:56 +0000 (15:58 +0900)]
staging: wilc1000: wilc_msgqueue.c: remove braces for single statement

This patch removes braces for single statement blocks.
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: add a blank line after declaration
Chaehyun Lim [Tue, 18 Aug 2015 14:18:11 +0000 (23:18 +0900)]
staging: wilc1000: add a blank line after declaration

This patch adds a blank line after declaration found by checkpatch.pl
WARNING: Missing a blank line after declarations.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid possible memory leak
Raphaël Beamonte [Wed, 19 Aug 2015 03:14:50 +0000 (23:14 -0400)]
staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid possible memory leak

The MALLOC_WILC_BUFFER() macro was using a return statement, and didn't
take care of possible memory leaks and subsequent bugs when it was failing
after succeeding some allocations. This patch corrects this behavior.

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: wilc1000: remove FREE_WILC_BUFFER()
Raphaël Beamonte [Wed, 19 Aug 2015 03:14:49 +0000 (23:14 -0400)]
staging: wilc1000: remove FREE_WILC_BUFFER()

It was just a wrapper around kfree(), so call that instead.

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: android: fix coding style checks in sw_sync.c
Trung Thanh Le [Sat, 15 Aug 2015 14:09:45 +0000 (22:09 +0800)]
staging: android: fix coding style checks in sw_sync.c

replace comparison "obj" to NULL with "!obj"

Signed-off-by: Trung Thanh Le <trungthanh1608@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: android: ashmem.c: 'Alignment' style issue
Peng Sun [Thu, 27 Aug 2015 07:41:07 +0000 (15:41 +0800)]
staging: android: ashmem.c: 'Alignment' style issue

fix two CHECK issues by checkpatch.pl with --strict:
Alignment should match open parenthesis

Signed-off-by: Peng Sun <sironhide0null@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: android: ashmem.c: 'No space necessary after' style issue
Peng Sun [Thu, 27 Aug 2015 07:41:06 +0000 (15:41 +0800)]
staging: android: ashmem.c: 'No space necessary after' style issue

fix two CHECK issues by checkpatch.pl with --strict:
No space is necessary after a cast

Signed-off-by: Peng Sun <sironhide0null@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: android: ashmem.c: 'spaces preferred around that -' style issue
Peng Sun [Thu, 27 Aug 2015 07:41:05 +0000 (15:41 +0800)]
staging: android: ashmem.c: 'spaces preferred around that -' style issue

fix a CHECK style issue by checkpatch.pl with --strict:
spaces preferred around that '-'

Signed-off-by: Peng Sun <sironhide0null@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: replace typedef struct tagSRxDesc
Malcolm Priestley [Sat, 15 Aug 2015 20:57:35 +0000 (21:57 +0100)]
staging: vt6655: replace typedef struct tagSRxDesc

with struct vnt_rx_desc and all members the same.

volatile is removed from pointers as this generates warning
message.

Only the first four members of vnt_rx_desc need to be volatile.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: replace typedef struct tagDEVICE_RD_INFO
Malcolm Priestley [Sat, 15 Aug 2015 20:57:34 +0000 (21:57 +0100)]
staging: vt6655: replace typedef struct tagDEVICE_RD_INFO

with struct vnt_rd_info

volatile is removed because it will generate a warning
(in any case this member is not) and renaming rd_info.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: replace typedef struct tagRDES1
Malcolm Priestley [Sat, 15 Aug 2015 20:57:33 +0000 (21:57 +0100)]
staging: vt6655: replace typedef struct tagRDES1

with struct vnt_rdes1 and members
wReqCount -> req_count
wReserved -> reserved

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: vt6655: replace typedef struct tagRDES0
Malcolm Priestley [Sat, 15 Aug 2015 20:57:32 +0000 (21:57 +0100)]
staging: vt6655: replace typedef struct tagRDES0

with struct vnt_rdes0 replacing members as follows
wResCount -> res_count
f15Reserved -> f15_reserved
f1Owner -> owner

big endian
f8Reserved1 -> f8_reserved1
f7Reserved -> f7_reserved

Narrowing endian differences to inside structure.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: remove unnecessary clearing of private data
H Hartley Sweeten [Mon, 24 Aug 2015 17:14:06 +0000 (10:14 -0700)]
staging: comedi: usbduxfast: remove unnecessary clearing of private data

The clearing of the private data members in the (*detatch) is not
necessary. The comedi core is going to kfree the private data as soon
as the (*detach) finishes.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: absorb usbduxfast_attach_common()
H Hartley Sweeten [Mon, 24 Aug 2015 17:14:05 +0000 (10:14 -0700)]
staging: comedi: usbduxfast: absorb usbduxfast_attach_common()

This function is only called by the (*auto_attach) to do the final
setup of the analog input subdevice.

For aesthetics absorb it into usbduxfast_auto_attach() and reorder
the initialization of the subdevice to better follow the "norm" in
comedi drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: remove unnecessary semaphore down/up
H Hartley Sweeten [Mon, 24 Aug 2015 17:14:04 +0000 (10:14 -0700)]
staging: comedi: usbduxfast: remove unnecessary semaphore down/up

The semaphore down/up in usbduxfast_attach_common() is not necessary.
This function is only called as part of the (*auto_attach) and does
not talk to the USB device.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: document strange ai maxdata
H Hartley Sweeten [Mon, 24 Aug 2015 17:14:03 +0000 (10:14 -0700)]
staging: comedi: usbduxfast: document strange ai maxdata

The subdevice 'maxdata' is typically a mask of the valid bits that can
be returned by a subdevice, (1 << bits) - 1. The analog inputs of this
device have a resolution of 12-bits so the 'maxdata' should be 0x0fff.
But, this hardware can produce a value of 0x1000 indicating an overflow
from the ADC. The comedilib library's comedi_to_phys() function will
then return NAN when this value is read from the hardware.

Add a comment to clarify the strage 'maxdata' 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>
9 years agostaging: comedi: usbduxfast: use a common exit path in ai (*do_cmd)
H Hartley Sweeten [Mon, 24 Aug 2015 17:14:02 +0000 (10:14 -0700)]
staging: comedi: usbduxfast: use a common exit path in ai (*do_cmd)

For aesthetics, use 'goto' and a common exit point in this function so
that the up of the semaphore is not overlooked.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: tidy up the conversion timing validation
H Hartley Sweeten [Mon, 24 Aug 2015 17:14:01 +0000 (10:14 -0700)]
staging: comedi: usbduxfast: tidy up the conversion timing validation

Cleanup the validation of the cmd->convert_arg to use the same calculation
in the (*do_cmdtest) and the (*do_cmd).

Remove the, then unnecessary, redundant check in the (*do_cmd).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: TRIG_EXT is only valid for cmd->start_src
H Hartley Sweeten [Mon, 24 Aug 2015 17:14:00 +0000 (10:14 -0700)]
staging: comedi: usbduxfast: TRIG_EXT is only valid for cmd->start_src

According to the code, and verified with the author Bernd Porr, the
TRIG_EXT trigger is only valid for the cmd->start_src. Remove this
trigger from the cmd->scan_begin_src and cmd->convert_src.

The only valid scan_begin_src is then TRIG_FOLLOW  and the convert_src
is only TRIG_TIMER. Remove the redundant unique trigger checks in Step
2b of the (*do_cmdtest) as well as any other unnecessary checks of
those trigger sources.

Also remove the incorrect comment for a cmd->stop_src of TRIG_EXT.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: TRIG_EXT only works for 1 or 16 channels
H Hartley Sweeten [Mon, 24 Aug 2015 17:13:59 +0000 (10:13 -0700)]
staging: comedi: usbduxfast: TRIG_EXT only works for 1 or 16 channels

Move this check from the (*do_cmd) to the (*do_cmdtest).

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: fix multi-line comment
H Hartley Sweeten [Mon, 24 Aug 2015 17:13:58 +0000 (10:13 -0700)]
staging: comedi: usbduxfast: fix multi-line comment

This comment does not need to be multi-line. Fix it to remove the
checkpatch warning.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: use preferred kernel types
H Hartley Sweeten [Mon, 24 Aug 2015 17:13:57 +0000 (10:13 -0700)]
staging: comedi: usbduxfast: use preferred kernel types

As suggested by checkpatch.pl:

CHECK: Prefer kernel type 'u8' over 'uint8_t'
CHECK: Prefer kernel type 's8' over 'int8_t'

For consistency, also change the uint16_t and int16_t types to
u16 and s16.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: remove impossible 'if (!devpriv)' checks
H Hartley Sweeten [Mon, 24 Aug 2015 17:13:56 +0000 (10:13 -0700)]
staging: comedi: usbduxfast: remove impossible 'if (!devpriv)' checks

The private data 'devpriv' is allocated in the (*auto_attach) before
the subdevices are initialized and the (*auto_attach) has to complete
successfully before the core will call any of the subdevice operations.
Because of this the (!devpriv) checks in the subdevice code can never
fail. Remove them.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: only chanlist of 1, 2, 3, or 16 are supported
H Hartley Sweeten [Mon, 24 Aug 2015 17:13:55 +0000 (10:13 -0700)]
staging: comedi: usbduxfast: only chanlist of 1, 2, 3, or 16 are supported

The analog input (*do_cmd) only supports channel lists of 1, 2, 3, or 16
channels. Add a check for this to usbduxfast_ai_check_chanlist() and remove
the check from usbduxfast_ai_cmd().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxfast: chanlist check is Step 5 of (*do_cmdtest)
H Hartley Sweeten [Mon, 24 Aug 2015 17:13:54 +0000 (10:13 -0700)]
staging: comedi: usbduxfast: chanlist check is Step 5 of (*do_cmdtest)

The channel list should be checked in Step 5 of the (*do_cmdtest) not
as part of the (*do_cmd). Factor the check out of usbduxfast_ai_cmd().

Tidy up the factored out code. The channel number 'i' will never be
greater than NUMCHANNELS due to the subdevice setup and the checks
done in the code. The up/down of the semaphore is also not needed
because the (*do_cmdtest) never actually tries to access the hardware.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: fix the block comments
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:27 +0000 (16:58 -0700)]
staging: comedi: s526: fix the block comments

Tidy up the block comments to fix the checkpatch.pl warnings.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: remove #if 0'ed out code block
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:26 +0000 (16:58 -0700)]
staging: comedi: s526: remove #if 0'ed out code block

This #if 0'ed out code is not necessary. It's actually just a copy
of the psuedo code in the S526 Hardware Manual that shows an example
of a counter application. 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>
9 years agostaging: comedi: s526: remove unnecessary defines
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:25 +0000 (16:58 -0700)]
staging: comedi: s526: remove unnecessary defines

Remove a couple unused defines,

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: remove s526_ai_insn_config()
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:24 +0000 (16:58 -0700)]
staging: comedi: s526: remove s526_ai_insn_config()

This (*insn_config) does not follow the comedi core API. It also
would not work as expected.

It appears to be trying to configure the analog input subdevice so
that the (*insn_read) would read multiple channels (data[0]) and
optionally enable the 15us delay (data[1]) needed for the multiplexor
to change channels between samples.

Unfortunately, the comedi core expects (*insn_read) operations to
return 1 or more samples for a single channel, which is what the
(*insn_read) in this driver does.

The (*insn_config) is also enabling the analog input end-of-conversion
interrupt. This isn't needed, and might be a problem since the driver
does not currently request and interrupt. The enable bit does not
need to be set for the end-of-conversion to occur in the interrupt
status register.

Remove the (*insn_config) and modify the (*insn_read) to automatically
handle the 15us delay when needed.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: tidy up s526_ai_rinsn()
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:23 +0000 (16:58 -0700)]
staging: comedi: s526: tidy up s526_ai_rinsn()

Rename this function to follow the normal naming in comedi drivers.

Use the comedi_offset_munge() helper to munge the hardware two's
complement data to the comedi offset binary format.

Change the final return to insn->n to clarify the return value without
the need for the comment.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: wait for analog output conversions to complete
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:22 +0000 (16:58 -0700)]
staging: comedi: s526: wait for analog output conversions to complete

It's possible for the user to write more than one value to an analog
output channel with the (*insn_write) operation. Use comedi_timeout()
to check the interrupt status register to ensure that each data
conversion is complete before writing the next 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>
9 years agostaging: comedi: s526: tidy up subdevice init
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:21 +0000 (16:58 -0700)]
staging: comedi: s526: tidy up subdevice init

For aesthetics, add some whitespace to the subdevice initialization.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: define the eeprom data and control registers
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:20 +0000 (16:58 -0700)]
staging: comedi: s526: define the eeprom data and control registers

Define these registers and their bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: define the miscellaneous register and bits
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:19 +0000 (16:58 -0700)]
staging: comedi: s526: define the miscellaneous register and bits

Define this register and its bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: define the digtial I/O control register and bits
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:18 +0000 (16:58 -0700)]
staging: comedi: s526: define the digtial I/O control register and bits

Define this register and its bits and remove the magic numbers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: define the interrupt enable/status registers
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:17 +0000 (16:58 -0700)]
staging: comedi: s526: define the interrupt enable/status registers

These registers use the same bit defines. Define both of them and
the bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: add defines for the ao/ai data register
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:16 +0000 (16:58 -0700)]
staging: comedi: s526: add defines for the ao/ai data register

The same register is used for analog output and input data. Add defines
for both for added 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>
9 years agostaging: comedi: s526: define the ADC (analog input) control register and bits
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:15 +0000 (16:58 -0700)]
staging: comedi: s526: define the ADC (analog input) control register and bits

Define this register and its bits and remove the magic numbers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: define the DAC (analog output) control register and bits
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:14 +0000 (16:58 -0700)]
staging: comedi: s526: define the DAC (analog output) control register and bits

Define this register and its bits and remove the magic numbers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: define the watchdog timer control register and bits
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:13 +0000 (16:58 -0700)]
staging: comedi: s526: define the watchdog timer control register and bits

Define this register and it's bits so that we can possibly support
it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: define the timer control register and bits
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:12 +0000 (16:58 -0700)]
staging: comedi: s526: define the timer control register and bits

Define this register and it's bits so that we can possibly support
it.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: refactor gpct registers
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:11 +0000 (16:58 -0700)]
staging: comedi: s526: refactor gpct registers

The S526 board has 4 general purpose counter/timers. The current
defines used for the registers of these devices do not provide much
clarity in what they are.

Refactor the code to add some clarity.

Replace the current register defines with macros that return the
correct offset based on the counter 'channel'. Introduce a some helper
functions to handle reading/writing the LSB/MSB registers so that
they are always accessed in the correct oreder.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: s526: tidy up multi-line comments
H Hartley Sweeten [Mon, 17 Aug 2015 23:58:10 +0000 (16:58 -0700)]
staging: comedi: s526: tidy up multi-line comments

Format the multi-line comments 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>
9 years agostaging: comedi: serial2002: use proper errno
H Hartley Sweeten [Mon, 17 Aug 2015 20:18:43 +0000 (13:18 -0700)]
staging: comedi: serial2002: use proper errno

checkpatch.pl reports:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Change the error code to -ENOTTY.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: serial2002: usleep_range is preferred over udelay
H Hartley Sweeten [Mon, 17 Aug 2015 20:18:42 +0000 (13:18 -0700)]
staging: comedi: serial2002: usleep_range is preferred over udelay

Fix checkpatch issue: "CHECK: usleep_range is preferred over udelay;
see Documentation/timers/timers-howto.txt". Replace the udelay() with
usleep_range() with a reasonable upper limit.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: serial2002: tidy up multi-line comments
H Hartley Sweeten [Mon, 17 Aug 2015 20:18:41 +0000 (13:18 -0700)]
staging: comedi: serial2002: tidy up multi-line comments

Format the multi-line comments 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>
9 years agostaging: comedi: unioxx5: remove this flawed driver
H Hartley Sweeten [Mon, 17 Aug 2015 20:03:22 +0000 (13:03 -0700)]
staging: comedi: unioxx5: remove this flawed driver

I was going to clean up this driver but looking it over it has a
number of serious flaws. Also, Fastwell published an End-Of-Life
notification for the board on 24/Jan/2014 (End-of-sale 30/Jun/2014,
End-of-delivery 30/Dec/2014).

Since the driver has a comedi driver status of "unkown", lets just
remove the driver instead of trying to fix the flaws.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: ssv_dnp: tidy up multi-line comments
H Hartley Sweeten [Sat, 15 Aug 2015 00:09:12 +0000 (17:09 -0700)]
staging: comedi: ssv_dnp: tidy up multi-line comments

Format the multi-line comments in the kernel CodingStyle.

Move the comment about the I/O ports in dnp_attach() to the start
of the function. This is typically where the resources are reserved.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbdux: use comedi_offset_munge()
H Hartley Sweeten [Fri, 14 Aug 2015 22:23:31 +0000 (15:23 -0700)]
staging: comedi: usbdux: use comedi_offset_munge()

Use the comedi_offset_munge() helper to convert the hardware two's
complement values to the offset binary format expected by comedi.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbdux: remove impossible 'if (!devpriv)' check
H Hartley Sweeten [Fri, 14 Aug 2015 22:23:30 +0000 (15:23 -0700)]
staging: comedi: usbdux: remove impossible 'if (!devpriv)' check

The comedi core can only call this subdevice function is the private
data was successfully allocated during the (*auto_attach). Remove
the unnecessary check.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbdux: rename dev->private local variables
H Hartley Sweeten [Fri, 14 Aug 2015 22:23:29 +0000 (15:23 -0700)]
staging: comedi: usbdux: rename dev->private local variables

For aesthetics, consistently use the same name. 'devpriv', for the
local variable used to reference the private data, 'dev->private'.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbdux: use common code path to check the cmd->scan_begin_arg
H Hartley Sweeten [Fri, 14 Aug 2015 22:23:28 +0000 (15:23 -0700)]
staging: comedi: usbdux: use common code path to check the cmd->scan_begin_arg

There are currently separate code paths to check the scan_begin_arg based
of the USB speed. Refactor the code to use a common code path and simplify
the code.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbdux: add missing spaces
H Hartley Sweeten [Fri, 14 Aug 2015 22:23:27 +0000 (15:23 -0700)]
staging: comedi: usbdux: add missing spaces

Add some missing space to quiet the checkpatch.pl issues about:

CHECK: spaces preferred around that '/' (ctx:VxV)
CHECK: spaces preferred around that '*' (ctx:VxV)
CHECK: spaces preferred around that '+' (ctx:VxV)

For aesthetics, use tabs instead of spaces in all the defines and

ensure they have common alignment.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbdux: use preferred kernel types
H Hartley Sweeten [Fri, 14 Aug 2015 22:23:26 +0000 (15:23 -0700)]
staging: comedi: usbdux: use preferred kernel types

As suggested by checkpatch.pl:

CHECK: Prefer kernel type 'u8' over 'uint8_t'
CHECK: Prefer kernel type 'u16' over 'uint16_t'

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: vmk80xx: tidy up defines
H Hartley Sweeten [Fri, 14 Aug 2015 21:35:29 +0000 (14:35 -0700)]
staging: comedi: vmk80xx: tidy up defines

For aesthetics, use tabs instead of spaces for the whitespace.

Convert the bit defines to use the preferred BIT 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>
9 years agostaging: comedi: vmk80xx: cleanup multi-line comment
H Hartley Sweeten [Fri, 14 Aug 2015 21:35:28 +0000 (14:35 -0700)]
staging: comedi: vmk80xx: cleanup 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>
9 years agostaging: comedi: usbduxsigma: use comedi_offset_munge()
H Hartley Sweeten [Fri, 14 Aug 2015 18:39:42 +0000 (11:39 -0700)]
staging: comedi: usbduxsigma: use comedi_offset_munge()

Use the comedi_offset_munge() helper to convert the hardware two's
complement values to the offset binary format expected by comedi.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxsigma: tidy up block comments
H Hartley Sweeten [Fri, 14 Aug 2015 18:39:41 +0000 (11:39 -0700)]
staging: comedi: usbduxsigma: tidy up block comments

Merge the two comments and format it 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>
9 years agostaging: comedi: usbduxsigma: use prefered kernel types
H Hartley Sweeten [Fri, 14 Aug 2015 18:39:40 +0000 (11:39 -0700)]
staging: comedi: usbduxsigma: use prefered kernel types

As suggested by checkpatch.pl:

CHECK: Prefer kernel type 'u8' over 'uint8_t'
CHECK: Prefer kernel type 'u32' over 'uint32_t'

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: comedi: usbduxsigma: add missing spaces
H Hartley Sweeten [Fri, 14 Aug 2015 18:39:39 +0000 (11:39 -0700)]
staging: comedi: usbduxsigma: add missing spaces

Add some missing space to quiet the checkpatch.pl issues about:

CHECK: spaces preferred around that '/' (ctx:VxV)
CHECK: spaces preferred around that '+' (ctx:VxV)
CHECK: spaces preferred around that '*' (ctx:VxV)
CHECK: spaces preferred around that '-' (ctx:VxV)

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: put constant on the right of binary operator
Julia Lawall [Sat, 29 Aug 2015 17:30:12 +0000 (19:30 +0200)]
staging: lustre: put constant on the right of binary operator

Move constants to the right of binary operators.

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

// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@

(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: osc: put constant on the right of binary operator
Julia Lawall [Sat, 29 Aug 2015 17:30:11 +0000 (19:30 +0200)]
staging: lustre: osc: put constant on the right of binary operator

Move constants to the right of binary operators.

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

// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@

(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoStaging: lustre: obd: put constant on the right of binary operator
Julia Lawall [Sat, 29 Aug 2015 17:30:10 +0000 (19:30 +0200)]
Staging: lustre: obd: put constant on the right of binary operator

Move constants to the right of binary operators.

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

// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@

(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: llite: put constant on the right of binary operator
Julia Lawall [Sat, 29 Aug 2015 17:30:09 +0000 (19:30 +0200)]
staging: lustre: llite: put constant on the right of binary operator

Move constants to the right of binary operators.

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

// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@

(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: libcfs: put constant on the right of binary operator
Julia Lawall [Sat, 29 Aug 2015 17:30:08 +0000 (19:30 +0200)]
staging: lustre: libcfs: put constant on the right of binary operator

Move constants to the right of binary operators.

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

// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@

(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: ldlm: put constant on the right of binary operator
Julia Lawall [Sat, 29 Aug 2015 17:30:07 +0000 (19:30 +0200)]
staging: lustre: ldlm: put constant on the right of binary operator

Move constants to the right of binary operators.

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

// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@

(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lnet: lib-ptl.c: put constant on the right of binary operator
Julia Lawall [Sat, 29 Aug 2015 17:30:06 +0000 (19:30 +0200)]
staging: lustre: lnet: lib-ptl.c: put constant on the right of binary operator

Move constants to the right of binary operators.

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

// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@

(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: include: put constant on the right of binary operator
Julia Lawall [Sat, 29 Aug 2015 17:30:05 +0000 (19:30 +0200)]
staging: lustre: include: put constant on the right of binary operator

Move constants to the right of binary operators.

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

// <smpl>
@@
constant c;
expression e;
binary operator b = {==,!=,&,|};
@@

(
- c
+ e
b
- e
+ c
|
- c < e
+ e > c
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: fix OPEN_BRACE checkpatch.pl errors
Mike Rapoport [Sat, 22 Aug 2015 14:17:23 +0000 (17:17 +0300)]
staging: lustre: fix OPEN_BRACE checkpatch.pl errors

Fix occurencies of the following checkpatch.pl error:
ERROR: open brace '{' following function declarations go on
the next line

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: fix GLOBAL_INITIALISERS checkpatch.pl errors
Mike Rapoport [Sat, 22 Aug 2015 14:17:21 +0000 (17:17 +0300)]
staging: lustre: fix GLOBAL_INITIALISERS checkpatch.pl errors

Fix occurencies of the following checkpatch.pl error:
ERROR: do not initialise globals to 0 or NULL

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: fix CODE_INDENT checkpatch.pl errors
Mike Rapoport [Sat, 22 Aug 2015 14:17:20 +0000 (17:17 +0300)]
staging: lustre: fix CODE_INDENT checkpatch.pl errors

Fix occurencies of the following checkpatch.pl error:
ERROR: code indent should use tabs where possible

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging/lustre: fix block comment formatting
Jeff Becker [Mon, 24 Aug 2015 18:28:18 +0000 (11:28 -0700)]
staging/lustre: fix block comment formatting

Running checkpatch.pl on lnet/klnds/o2iblnd/o2iblnd.h produces several
"Block comments use a trailing */ on a separate line" warnings. This patch
fixes these.

Signed-off-by: Jeff Becker <Jeffrey.C.Becker@nasa.gov>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: lustre: llite: Added a space
Anjali Menon [Tue, 18 Aug 2015 13:54:24 +0000 (19:24 +0530)]
staging: lustre: lustre: llite: Added a space

Added a space to fix the following coding style error detected by
checkpatch error:

ERROR: space required after that close brace '}'

Signed-off-by: Anjali Menon <cse.anjalimenon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agostaging: lustre: simplify ptlrpc_deactivate_and_unlock_import
Maxime Lorrillere [Mon, 17 Aug 2015 12:04:49 +0000 (14:04 +0200)]
staging: lustre: simplify ptlrpc_deactivate_and_unlock_import

The locking scheme used in ptlrpc_deactivate_and_unlock_import and
ptlrpc_deactivate_import generates the followings sparse errors:
drivers/staging/lustre/lustre/ptlrpc/import.c:209:9: warning: context
imbalance in 'ptlrpc_deactivate_and_unlock_import' - unexpected unlock
drivers/staging/lustre/lustre/ptlrpc/import.c:221:6: warning: context
imbalance in 'ptlrpc_deactivate_import' - wrong count at exit

As ptlrpc_deactivate_and_unlock_import is only used by
ptlrpc_deactivate_import as a helper function, this patch moves its code
into ptlrpc_deactivatre_import to fix the sparse warnings.

Signed-off-by: Maxime Lorrillere <maxime.lorrillere@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9 years agoLinux 4.3-rc1
Linus Torvalds [Sat, 12 Sep 2015 23:35:56 +0000 (16:35 -0700)]
Linux 4.3-rc1

9 years agoMerge tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper...
Linus Torvalds [Sat, 12 Sep 2015 19:24:29 +0000 (12:24 -0700)]
Merge tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris

Pull CRIS updates from Jesper Nilsson:
 "Mostly removal of old cruft of which we can use a generic version, or
  fixes for code not commonly run in the cris port, but also additions
  to enable some good debug"

* tag 'cris-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/jesper/cris: (25 commits)
  CRISv10: delete unused lib/dmacopy.c
  CRISv10: delete unused lib/old_checksum.c
  CRIS: fix switch_mm() lockdep splat
  CRISv32: enable LOCKDEP_SUPPORT
  CRIS: add STACKTRACE_SUPPORT
  CRISv32: annotate irq enable in idle loop
  CRISv32: add support for irqflags tracing
  CRIS: UAPI: use generic types.h
  CRIS: UAPI: use generic shmbuf.h
  CRIS: UAPI: use generic msgbuf.h
  CRIS: UAPI: use generic socket.h
  CRIS: UAPI: use generic sembuf.h
  CRIS: UAPI: use generic sockios.h
  CRIS: UAPI: use generic auxvec.h
  CRIS: UAPI: use generic headers via Kbuild
  CRIS: UAPI: fix elf.h export
  CRIS: don't make asm/elf.h depend on asm/user.h
  CRIS: UAPI: fix ptrace.h
  CRISv32: Squash compile warnings for axisflashmap
  CRISv32: Add GPIO driver to the default configs
  ...

9 years agoblk: rq_data_dir() should not return a boolean
Linus Torvalds [Wed, 27 May 2015 22:32:15 +0000 (15:32 -0700)]
blk: rq_data_dir() should not return a boolean

rq_data_dir() returns either READ or WRITE (0 == READ, 1 == WRITE), not
a boolean value.

Now, admittedly the "!= 0" doesn't really change the value (0 stays as
zero, 1 stays as one), but it's not only redundant, it confuses gcc, and
causes gcc to warn about the construct

    switch (rq_data_dir(req)) {
        case READ:
            ...
        case WRITE:
            ...

that we have in a few drivers.

Now, the gcc warning is silly and stupid (it seems to warn not about the
switch value having a different type from the case statements, but about
_any_ boolean switch value), but in this case the code itself is silly
and stupid too, so let's just change it, and get rid of warnings like
this:

  drivers/block/hd.c: In function ‘hd_request’:
  drivers/block/hd.c:630:11: warning: switch condition has boolean value [-Wswitch-bool]
     switch (rq_data_dir(req)) {

The odd '!= 0' came in when "cmd_flags" got turned into a "u64" in
commit 5953316dbf90 ("block: make rq->cmd_flags be 64-bit") and is
presumably because the old code (that just did a logical 'and' with 1)
would then end up making the type of rq_data_dir() be u64 too.

But if we want to retain the old regular integer type, let's just cast
the result to 'int' rather than use that rather odd '!= 0'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge branch 'writeback-plugging'
Linus Torvalds [Sat, 12 Sep 2015 18:19:01 +0000 (11:19 -0700)]
Merge branch 'writeback-plugging'

Fix up the writeback plugging introduced in commit d353d7587d02
("writeback: plug writeback at a high level") that then caused problems
due to the unplug happening with a spinlock held.

* writeback-plugging:
  writeback: plug writeback in wb_writeback() and writeback_inodes_wb()
  Revert "writeback: plug writeback at a high level"

9 years agowriteback: plug writeback in wb_writeback() and writeback_inodes_wb()
Linus Torvalds [Fri, 11 Sep 2015 20:37:19 +0000 (13:37 -0700)]
writeback: plug writeback in wb_writeback() and writeback_inodes_wb()

We had to revert the pluggin in writeback_sb_inodes() because the
wb->list_lock is held, but we could easily plug at a higher level before
taking that lock, and unplug after releasing it.  This does that.

Chris will run performance numbers, just to verify that this approach is
comparable to the alternative (we could just drop and re-take the lock
around the blk_finish_plug() rather than these two commits.

I'd have preferred waiting for actual performance numbers before picking
one approach over the other, but I don't want to release rc1 with the
known "sleeping function called from invalid context" issue, so I'll
pick this cleanup version for now.  But if the numbers show that we
really want to plug just at the writeback_sb_inodes() level, and we
should just play ugly games with the spinlock, we'll switch to that.

Cc: Chris Mason <clm@fb.com>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Jan Kara <jack@suse.cz>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agothermal: fix intel PCH thermal driver mismerge
Linus Torvalds [Sat, 12 Sep 2015 03:06:59 +0000 (20:06 -0700)]
thermal: fix intel PCH thermal driver mismerge

I didn't notice this when merging the thermal code from Zhang, but his
merge (commit 5a924a07f882: "Merge branches 'thermal-core' and
'thermal-intel' of .git into next") of the thermal-core and
thermal-intel branches was wrong.

In thermal-core, commit 17e8351a7739 ("thermal: consistently use int for
temperatures") converted the thermal layer to use "int" for
temperatures.

But in parallel, in the thermal-intel branch commit d0a12625d2ff
("thermal: Add Intel PCH thermal driver") added support for the intel
PCH thermal sensor using the old interfaces that used "unsigned long"
pointers.

This resulted in warnings like this:

  drivers/thermal/intel_pch_thermal.c:184:14: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
    .get_temp = pch_thermal_get_temp,
                ^
  drivers/thermal/intel_pch_thermal.c:184:14: note: (near initialization for ‘tzd_ops.get_temp’)
  drivers/thermal/intel_pch_thermal.c:186:19: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
    .get_trip_temp = pch_get_trip_temp,
                     ^
  drivers/thermal/intel_pch_thermal.c:186:19: note: (near initialization for ‘tzd_ops.get_trip_temp’)

This fixes it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge branch 'akpm' (patches from Andrew)
Linus Torvalds [Sat, 12 Sep 2015 02:34:09 +0000 (19:34 -0700)]
Merge branch 'akpm' (patches from Andrew)

Merge fourth patch-bomb from Andrew Morton:

 - sys_membarier syscall

 - seq_file interface changes

 - a few misc fixups

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  revert "ocfs2/dlm: use list_for_each_entry instead of list_for_each"
  mm/early_ioremap: add explicit #include of asm/early_ioremap.h
  fs/seq_file: convert int seq_vprint/seq_printf/etc... returns to void
  selftests: enhance membarrier syscall test
  selftests: add membarrier syscall test
  sys_membarrier(): system-wide memory barrier (generic, x86)
  MODSIGN: fix a compilation warning in extract-cert

9 years agoARCv2: [axs103_smp] Reduce clk for SMP FPGA configs
Vineet Gupta [Fri, 11 Sep 2015 23:32:22 +0000 (16:32 -0700)]
ARCv2: [axs103_smp] Reduce clk for SMP FPGA configs

Newer bitfiles needs the reduced clk even for SMP builds

Cc: <stable@vger.kernel.org> #4.2
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge tag 'ntb-4.3' of git://github.com/jonmason/ntb
Linus Torvalds [Sat, 12 Sep 2015 02:29:00 +0000 (19:29 -0700)]
Merge tag 'ntb-4.3' of git://github.com/jonmason/ntb

Pull NTB fixes from Jon Mason:
 "NTB bug and documentation fixes, new device IDs, performance
  improvements, and adding a mailing list to MAINTAINERS for NTB"

* tag 'ntb-4.3' of git://github.com/jonmason/ntb:
  NTB: Fix range check on memory window index
  NTB: Improve index handling in B2B MW workaround
  NTB: Fix documentation for ntb_peer_db_clear.
  NTB: Fix documentation for ntb_link_is_up
  NTB: Use unique DMA channels for TX and RX
  NTB: Remove dma_sync_wait from ntb_async_rx
  NTB: Clean up QP stats info
  NTB: Make the transport list in order of discovery
  NTB: Add PCI Device IDs for Broadwell Xeon
  NTB: Add flow control to the ntb_netdev
  NTB: Add list to MAINTAINERS

9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Sat, 12 Sep 2015 02:17:28 +0000 (19:17 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull more input updates from Dmitry Torokhov:
 "Second round of updates for the input subsystem.

  This introduces two brand new touchscreen drivers (Colibri and
  imx6ul_tsc), some small driver fixes, and we are no longer report
  errors from evdev_flush() as users do not really have a way of
  handling errors, error codes that we were returning were not on the
  list of errors supposed to be returned by close(), and errors were
  causing issues with one of older versions of systemd"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: imx_keypad - remove obsolete comment
  Input: touchscreen - add imx6ul_tsc driver support
  Input: Add touchscreen support for Colibri VF50
  Input: i8042 - lower log level for "no controller" message
  Input: evdev - do not report errors form flush()
  Input: elants_i2c - extend the calibration timeout to 12 seconds
  Input: sparcspkr - fix module autoload for OF platform drivers
  Input: regulator-haptic - fix module autoload for OF platform driver
  Input: pwm-beeper - fix module autoload for OF platform driver
  Input: ab8500-ponkey - Fix module autoload for OF platform driver
  Input: cyttsp - remove unnecessary MODULE_ALIAS()
  Input: elan_i2c - add ACPI ID "ELAN1000"

9 years agoMerge tag 'pm+acpi-4.3-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Sat, 12 Sep 2015 02:11:06 +0000 (19:11 -0700)]
Merge tag 'pm+acpi-4.3-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more power management and ACPI updates from Rafael Wysocki:
 "These are mostly fixes and cleanups on top of the previous PM+ACPI
  pull request (cpufreq core and drivers, cpuidle, generic power domains
  framework).  Some of them didn't make to that pull request and some
  fix issues introduced by it.

  The only really new thing is the support for suspend frequency in the
  cpufreq-dt driver, but it is needed to fix an issue with Exynos
  platforms.

  Specifics:

   - build fix for the new Mediatek MT8173 cpufreq driver (Guenter
     Roeck).

   - generic power domains framework fixes (power on error code path,
     subdomain removal) and cleanup of a deprecated API user (Geert
     Uytterhoeven, Jon Hunter, Ulf Hansson).

   - cpufreq-dt driver fixes including two fixes for bugs related to the
     new Operating Performance Points Device Tree bindings introduced
     recently (Viresh Kumar).

   - suspend frequency support for the cpufreq-dt driver (Bartlomiej
     Zolnierkiewicz, Viresh Kumar).

   - cpufreq core cleanups (Viresh Kumar).

   - intel_pstate driver fixes (Chen Yu, Kristen Carlson Accardi).

   - additional sanity check in the cpuidle core (Xunlei Pang).

   - fix for a comment related to CPU power management (Lina Iyer)"

* tag 'pm+acpi-4.3-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  intel_pstate: fix PCT_TO_HWP macro
  intel_pstate: Fix user input of min/max to legal policy region
  PM / OPP: Return suspend_opp only if it is enabled
  cpufreq-dt: add suspend frequency support
  cpufreq: allow cpufreq_generic_suspend() to work without suspend frequency
  PM / OPP: add dev_pm_opp_get_suspend_opp() helper
  staging: board: Migrate away from __pm_genpd_name_add_device()
  cpufreq: Use __func__ to print function's name
  cpufreq: staticize cpufreq_cpu_get_raw()
  PM / Domains: Ensure subdomain is not in use before removing
  cpufreq: Add ARM_MT8173_CPUFREQ dependency on THERMAL
  cpuidle/coupled: Add sanity check for safe_state_index
  PM / Domains: Try power off masters in error path of __pm_genpd_poweron()
  cpufreq: dt: Tolerance applies on both sides of target voltage
  cpufreq: dt: Print error on failing to mark OPPs as shared
  cpufreq: dt: Check OPP count before marking them shared
  kernel/cpu_pm: fix cpu_cluster_pm_exit comment

9 years agoMerge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target...
Linus Torvalds [Sat, 12 Sep 2015 02:00:42 +0000 (19:00 -0700)]
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull SCSI target updates from Nicholas Bellinger:
 "Here are the outstanding target-pending updates for v4.3-rc1.

  Mostly bug-fixes and minor changes this round.  The fallout from the
  big v4.2-rc1 RCU conversion have (thus far) been minimal.

  The highlights this round include:

   - Move sense handling routines into scsi_common code (Sagi)

   - Return ABORTED_COMMAND sense key for PI errors (Sagi)

   - Add tpg_enabled_sendtargets attribute for disabled iscsi-target
     discovery (David)

   - Shrink target struct se_cmd by rearranging fields (Roland)

   - Drop iSCSI use of mutex around max_cmd_sn increment (Roland)

   - Replace iSCSI __kernel_sockaddr_storage with sockaddr_storage (Andy +
     Chris)

   - Honor fabric max_data_sg_nents I/O transfer limit (Arun + Himanshu +
     nab)

   - Fix EXTENDED_COPY >= v4.1 regression OOPsen (Alex + nab)"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (37 commits)
  target: use stringify.h instead of own definition
  target/user: Fix UFLAG_UNKNOWN_OP handling
  target: Remove no-op conditional
  target/user: Remove unused variable
  target: Fix max_cmd_sn increment w/o cmdsn mutex regressions
  target: Attach EXTENDED_COPY local I/O descriptors to xcopy_pt_sess
  target/qla2xxx: Honor max_data_sg_nents I/O transfer limit
  target/iscsi: Replace __kernel_sockaddr_storage with sockaddr_storage
  target/iscsi: Replace conn->login_ip with login_sockaddr
  target/iscsi: Keep local_ip as the actual sockaddr
  target/iscsi: Fix np_ip bracket issue by removing np_ip
  target: Drop iSCSI use of mutex around max_cmd_sn increment
  qla2xxx: Update tcm_qla2xxx module description to 24xx+
  iscsi-target: Add tpg_enabled_sendtargets for disabled discovery
  drivers: target: Drop unlikely before IS_ERR(_OR_NULL)
  target: check DPO/FUA usage for COMPARE AND WRITE
  target: Shrink struct se_cmd by rearranging fields
  target: Remove cmd->se_ordered_id (unused except debug log lines)
  target: add support for START_STOP_UNIT SCSI opcode
  target: improve unsupported opcode message
  ...