firefly-linux-kernel-4.4.55.git
8 years agostaging: lustre: checkpatch: do not init global to NULL
Swee Hua Law [Mon, 10 Aug 2015 13:54:15 +0000 (21:54 +0800)]
staging: lustre: checkpatch: do not init global to NULL

Fix checkpatch problem: remove NULL assignment fro global variable

Signed-off-by: Swee Hua Law <sweehua81@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre-libcfs: make static-variable constant
Patrick Boettcher [Mon, 10 Aug 2015 08:25:09 +0000 (10:25 +0200)]
staging: lustre-libcfs: make static-variable constant

This static can be made constant as it is never modified.

Found during sparse-cleanup.

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: lustre-libcfs: fix sparse warning
Patrick Boettcher [Mon, 10 Aug 2015 08:25:08 +0000 (10:25 +0200)]
staging: lustre-libcfs: fix sparse warning

Fix sparse warnings of the following type:

warning: symbol '....' was not declared. Should it be static?

Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: unisys: Remove useless cast on void pointer
Shraddha Barke [Mon, 10 Aug 2015 08:00:35 +0000 (13:30 +0530)]
Staging: unisys: Remove useless cast on void pointer

void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

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

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre: libcfs: Remove unnecessary cast on void*
Shraddha Barke [Mon, 10 Aug 2015 08:00:34 +0000 (13:30 +0530)]
Staging: lustre: libcfs: Remove unnecessary cast on void*

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

Semantic patch used is as follows:

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

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: wilc1000: Remove null check before kfree
Shraddha Barke [Mon, 10 Aug 2015 08:00:33 +0000 (13:30 +0530)]
Staging: wilc1000: Remove null check before kfree

kfree on NULL pointer is a no-op.

This patch uses the following semantic patch to find such an instance
where NULL check is present before kfree.

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>smpl>

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: rtl8723au: Fix Sparse errors in rtw_security.c
Jacob Kiefer [Sun, 9 Aug 2015 19:20:28 +0000 (15:20 -0400)]
staging: rtl8723au: Fix Sparse errors in rtw_security.c

This patch fixes the following sparse errors:

  CHECK   drivers/staging/rtl8723au/core/rtw_security.c
drivers/staging/rtl8723au/core/rtw_security.c:189:39: \
  warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_security.c:189:39:    \
  expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:189:39:    \
  got restricted __le32 [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:197:39: \
  warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_security.c:197:39:    \
  expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:197:39:    \
  got restricted __le32 [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:682:39: \
  warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_security.c:682:39:    \
  expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:682:39:    \
  got restricted __le32 [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:694:39: \
  warning: incorrect type in assignment (different base types)
drivers/staging/rtl8723au/core/rtw_security.c:694:39:    \
  expected unsigned int [unsigned] [usertype] <noident>
drivers/staging/rtl8723au/core/rtw_security.c:694:39:    \
  got restricted __le32 [usertype] <noident>

Signed-off-by: Jacob Kiefer <jtk54@cornell.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove wilc_strutils.c and wilc_strutils.h
Chaehyun Lim [Mon, 10 Aug 2015 02:33:22 +0000 (11:33 +0900)]
staging: wilc1000: remove wilc_strutils.c and wilc_strutils.h

Remove wilc_strutils.c and wilc_strutils.h that are not needed.
wilc_strutils.o is also removed in Makefile.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove WILC_memcpy_INTERNAL
Chaehyun Lim [Mon, 10 Aug 2015 02:33:21 +0000 (11:33 +0900)]
staging: wilc1000: remove WILC_memcpy_INTERNAL

Remove WILC_memcpy_INTERNAL that is used in the WILC_memcpy
because WILC_memcpy is replaced by memcpy.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove WILC_memcpy function
Chaehyun Lim [Mon, 10 Aug 2015 02:33:20 +0000 (11:33 +0900)]
staging: wilc1000: remove WILC_memcpy function

Remove WILC_memcpy function that is changed to memcpy.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use memcpy instead of WILC_memcpy
Chaehyun Lim [Mon, 10 Aug 2015 02:33:19 +0000 (11:33 +0900)]
staging: wilc1000: use memcpy instead of WILC_memcpy

Use memcpy instead of WILC_memcpy that is a custom function.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove WILC_strncmp function
Chaehyun Lim [Mon, 10 Aug 2015 02:33:18 +0000 (11:33 +0900)]
staging: wilc1000: remove WILC_strncmp function

Remove WILC_strncmp function that is changed to strncmp.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use strncmp instead of WILC_strncmp
Chaehyun Lim [Mon, 10 Aug 2015 02:33:17 +0000 (11:33 +0900)]
staging: wilc1000: use strncmp instead of WILC_strncmp

Use strncmp instead of WILC_strncmp.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove WILC_strncpy function
Chaehyun Lim [Mon, 10 Aug 2015 02:33:16 +0000 (11:33 +0900)]
staging: wilc1000: remove WILC_strncpy function

Remove WILC_strncpy function that is changed to strncpy.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Use strncpy instead of WILC_strncpy
Chaehyun Lim [Mon, 10 Aug 2015 02:33:15 +0000 (11:33 +0900)]
staging: wilc1000: Use strncpy instead of WILC_strncpy

Use strncpy instead of WILC_strncpy that is a custom function

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove WILC_strlen function
Chaehyun Lim [Mon, 10 Aug 2015 02:33:14 +0000 (11:33 +0900)]
staging: wilc1000: remove WILC_strlen function

Remove WILC_strlen function that is changed to strlen.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: use strlen instead of WILC_strlen
Chaehyun Lim [Mon, 10 Aug 2015 02:33:13 +0000 (11:33 +0900)]
staging: wilc1000: use strlen instead of WILC_strlen

Use strlen instead of WILC_strlen that is a custom function.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: remove commented code
Chaehyun Lim [Mon, 10 Aug 2015 02:33:12 +0000 (11:33 +0900)]
staging: wilc1000: remove commented code

Remove commented code that is not used.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: me4000: use bitwise AND instead of logical
Dan Carpenter [Fri, 14 Aug 2015 08:54:05 +0000 (11:54 +0300)]
staging: comedi: me4000: use bitwise AND instead of logical

This was supposed to bitwise AND but there is a typo.

Fixes: 1a02387063fb ('staging: comedi: me4000: remove 'board' from me4000_ai_insn_read()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: adl_pci7x3x: fix digital output on PCI-7230
Ian Abbott [Tue, 11 Aug 2015 12:05:10 +0000 (13:05 +0100)]
staging: comedi: adl_pci7x3x: fix digital output on PCI-7230

The "adl_pci7x3x" driver replaced the "adl_pci7230" and "adl_pci7432"
drivers in commits 8f567c373c4b ("staging: comedi: new adl_pci7x3x
driver") and 657f77d173d3 ("staging: comedi: remove adl_pci7230 and
adl_pci7432 drivers").  Although the new driver code agrees with the
user manuals for the respective boards, digital outputs stopped working
on the PCI-7230.  This has 16 digital output channels and the previous
adl_pci7230 driver shifted the 16 bit output state left by 16 bits
before writing to the hardware register.  The new adl_pci7x3x driver
doesn't do that.  Fix it in `adl_pci7x3x_do_insn_bits()` by checking
for the special case of the subdevice having only 16 channels and
duplicating the 16 bit output state into both halves of the 32-bit
register.  That should work both for what the board actually does and
for what the user manual says it should do.

Fixes: 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: <stable@vger.kernel.org> # 3.13+, needs backporting for 3.7 to 3.12
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: remove "magic" numbers in apci3501_read_insn_timer()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:50 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: remove "magic" numbers in apci3501_read_insn_timer()

Use register bit defines from addi_tcw.h to remove the "magic" numbers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: remove "magic" numbers in apci3501_write_insn_timer()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:49 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: remove "magic" numbers in apci3501_write_insn_timer()

Use register bit defines from addi_tcw.h to remove the "magic" numbers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: remove "magic" numbers in apci3501_config_insn_timer()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:48 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: remove "magic" numbers in apci3501_config_insn_timer()

Use register bit defines from addi_tcw.h to remove the "magic" numbers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_3501: remove "magic" numbers in apci3501_interrupt()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:47 +0000 (13:25 -0700)]
staging: comedi: addi_apci_3501: remove "magic" numbers in apci3501_interrupt()

Use register bit defines from addi_tcw.h to remove the "magic" numbers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_3501: use addi_tcw.h for the timer registers
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:46 +0000 (13:25 -0700)]
staging: comedi: addi_apci_3501: use addi_tcw.h for the timer registers

The APCI3501_TIMER_* register defines in this driver are that same as
the ADDI_TCW_* defines with an additional offset.

Add a 'tcw' (timer/counter/watchdog) member to the private data to
hold the address for the iobase of the registers. Use that and the
defines from addi_tcw.h to address the registers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_3501: rename CamelCase vars in apci3501_interrupt()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:45 +0000 (13:25 -0700)]
staging: comedi: addi_apci_3501: rename CamelCase vars in apci3501_interrupt()

Rename the CamelCase local variables.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_3501: prefer using the BIT macro
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:44 +0000 (13:25 -0700)]
staging: comedi: addi_apci_3501: prefer using the BIT macro

Change the register bit defines to use the 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>
8 years agostaging: comedi: addi_apci_3501: rename private data 'i_IobaseAmcc'
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:43 +0000 (13:25 -0700)]
staging: comedi: addi_apci_3501: rename private data 'i_IobaseAmcc'

Rename this CamelCase member of the private data.

Also, fix the type of the member, it holds a pci_resource_start()
address and should be an unsigned long.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: refactor apci3501_config_insn_timer()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:42 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: refactor apci3501_config_insn_timer()

The handling for the watchdog and timer modes is very similar. Refactor
this function to use a common code path for both modes.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: rename 'ul_Command1' in apci3501_config_insn_timer()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:41 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: rename 'ul_Command1' in apci3501_config_insn_timer()

Rename this CamelCase local variable.

For aesthetics, split the mask/set operations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: refactor apci3501_read_insn_timer()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:40 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: refactor apci3501_read_insn_timer()

The handling of the ADDIDATA_WATCHDOG and ADDIDATA_TIMER is identical.
Refactor this function to use a common code path for both timer modes.

Remove the incorrect dev_err() noise. The subdevice is valid but the
timer_mode is not supported.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: refactor apci3501_write_insn_timer()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:39 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: refactor apci3501_write_insn_timer()

The handling of the ADDIDATA_WATCHDOG and ADDIDATA_TIMER is identical
except for the "stop" operation. Refactor this function to use a common
code path for both timer modes.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: rename 'ul_Command1' in apci3501_write_insn_timer()
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:38 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: rename 'ul_Command1' in apci3501_write_insn_timer()

Rename this CamelCase local variable.

For aesthetics, split the mask/set operations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_3501: rename private data 'b_TimerSelectMode'
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:37 +0000 (13:25 -0700)]
staging: comedi: addi_apci_3501: rename private data 'b_TimerSelectMode'

Rename this CamelCase member of the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci3501: remove useless read/mask to stop watchdog
H Hartley Sweeten [Wed, 12 Aug 2015 20:25:36 +0000 (13:25 -0700)]
staging: comedi: hwdrv_apci3501: remove useless read/mask to stop watchdog

The watchdog is stopped in apci3501_write_insn_timer() by writing a 0 to
the timer control register. There is no need to read the register first
and mask it (as done when the timer is used as a timer).

Reported-by: coverity (CID 1227052)
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: comedi_fops: absorb comedi_free_board_minor()
H Hartley Sweeten [Mon, 10 Aug 2015 20:13:59 +0000 (13:13 -0700)]
staging: comedi: comedi_fops: absorb comedi_free_board_minor()

This function is only called by comedi_cleanup_board_minors() and the
'minor' parameter will always be < COMEDI_NUM_BOARD_MINORS.

For aesthetics, absorb the function and remove the unnecessary BUG_ON().

Split the comedi_clear_board_minor() out to clarify that the return value
is a comedi_device pointer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: comedi_fops: remove BUG_ON() in comedi_dev_get_from_board_minor()
H Hartley Sweeten [Mon, 10 Aug 2015 20:14:00 +0000 (13:14 -0700)]
staging: comedi: comedi_fops: remove BUG_ON() in comedi_dev_get_from_board_minor()

This function is only called by comedi_dev_get_from_minor() and the 'minor'
value will always be < COMEDI_NUM_BOARD_MINORS. Remove the unnecessary
BUG_ON().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: comedi_fops: remove BUG_ON() in comedi_free_subdevice_minor()
H Hartley Sweeten [Mon, 10 Aug 2015 20:14:01 +0000 (13:14 -0700)]
staging: comedi: comedi_fops: remove BUG_ON() in comedi_free_subdevice_minor()

Drivers should not crash the kernel.

This function is only called by comedi_device_detach_cleanup() and the
s->minor will always be valid or the device wouldn't have attached in
the first place.

Leave the checks for safety in accessing the comedi_subdevice_minor_table
array but remove the BUG_ON() calls.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: comedi_fops: remove BUG_ON() in comedi_cleanup()
H Hartley Sweeten [Mon, 10 Aug 2015 20:14:02 +0000 (13:14 -0700)]
staging: comedi: comedi_fops: remove BUG_ON() in comedi_cleanup()

The BUG_ON() checks in this function are not necessary.

comedi_cleanup_board_minors() clears all the entries in the
comedi_board_minor_table array and will call comedi_device_cleanup()
for all attached devices. comedi_device_cleanup() will then
clear the entries in the comedi_subdevice_minor_table array with
comedi_free_subdevice_minor().

Remove the BUG_ON(), drivers should not crash the kernel.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: comedi_fops: remove remaining BUG_ON() checks
H Hartley Sweeten [Mon, 10 Aug 2015 20:14:03 +0000 (13:14 -0700)]
staging: comedi: comedi_fops: remove remaining BUG_ON() checks

The BUG_ON() checks in comedi_subdevice_from_minor() and
comedi_dev_get_from_subdevice_minor() are not necessary.

The 'minor' numbers for a given comedi driver are setup by
comedi_dev_get_from_subdevice_minor() and will always be in
the correct range.

Drivers should not crash the kernel, remove the BUG_ON() checks.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci1564: remove magic numbers in apci1564_counter_insn_read()
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:14 +0000 (11:45 -0700)]
staging: comedi: hwdrv_apci1564: remove magic numbers in apci1564_counter_insn_read()

Use the bit defines from addi_tcw.h to remove the magic numbers in this
function.

Add the missing define for ADDI_TCW_STATUS_HARDWARE_TRIG.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci1564: tidy up apci1564_counter_insn_write()
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:13 +0000 (11:45 -0700)]
staging: comedi: hwdrv_apci1564: tidy up apci1564_counter_insn_write()

Clear the gate and trig bits in the common code path.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci1564: fix counter "mode" setting
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:12 +0000 (11:45 -0700)]
staging: comedi: hwdrv_apci1564: fix counter "mode" setting

According to the (broken) original driver, data[4] passed to this function
is the "timer mode". It appears the original code used the wrong shift to
set the bits.

Use the ADDI_TCW_CTRL_MODE() macro so that the correct bits get set.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci1564: remove useless code in apci1564_counter_insn_config()
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:11 +0000 (11:45 -0700)]
staging: comedi: hwdrv_apci1564: remove useless code in apci1564_counter_insn_config()

The gate, trig, and ena, bits in the 'ctrl' are cleared at the start of
the function. There is no reason clear these bits for each step.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci1564: remove magic number in apci1564_timer_insn_read()
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:10 +0000 (11:45 -0700)]
staging: comedi: hwdrv_apci1564: remove magic number in apci1564_timer_insn_read()

Use the bit define from addi_tcw.h to remove the magic 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>
8 years agostaging: comedi: hwdrv_apci1564: tidy up apci1564_timer_insn_write()
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:09 +0000 (11:45 -0700)]
staging: comedi: hwdrv_apci1564: tidy up apci1564_timer_insn_write()

Clear the gate and trig bits in the common code path.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci1564: use addi_tcw.h defines
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:08 +0000 (11:45 -0700)]
staging: comedi: hwdrv_apci1564: use addi_tcw.h defines

Use the ADDI_TCW_CTRL_REG bit defines in addi_tcw.h to remove the "magic"
numbers.

Add some missing bit defines and mask defines to addi_tcw.h to help
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>
8 years agostaging: comedi: addi_apci_1564: tidy up APCI1564_EEPROM_REG bit defines
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:07 +0000 (11:45 -0700)]
staging: comedi: addi_apci_1564: tidy up APCI1564_EEPROM_REG bit defines

Use the BIT() macro to define 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>
8 years agostaging: comedi: addi_apci_1564: define the APCI1564_DI_IRQ_REG bits
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:06 +0000 (11:45 -0700)]
staging: comedi: addi_apci_1564: define the APCI1564_DI_IRQ_REG bits

Define the bits in this register. Remove the old defines in hwdrv_apci1564.c.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_1564: define the APCI1564_DO_IRQ_REG bits
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:05 +0000 (11:45 -0700)]
staging: comedi: addi_apci_1564: define the APCI1564_DO_IRQ_REG bits

Define the bits in this register.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_1564: define the APCI1564_DO_INT_STATUS_REG bits
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:04 +0000 (11:45 -0700)]
staging: comedi: addi_apci_1564: define the APCI1564_DO_INT_STATUS_REG bits

Define the bits in this register.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: addi_apci_1564: define the APCI1564_DO_INT_CTRL_REG bits
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:03 +0000 (11:45 -0700)]
staging: comedi: addi_apci_1564: define the APCI1564_DO_INT_CTRL_REG bits

Define the bits in this register. Remove the old defines in hwdrv_apci1564.c.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: hwdrv_apci1564: remove unused defines
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:02 +0000 (11:45 -0700)]
staging: comedi: hwdrv_apci1564: remove unused defines

These defines are not used. 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>
8 years agostaging: comedi: addi_tcw.h: prefer using the BIT macro
H Hartley Sweeten [Fri, 7 Aug 2015 18:45:01 +0000 (11:45 -0700)]
staging: comedi: addi_tcw.h: prefer using the BIT macro

Use the BIT macro to define the register 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>
8 years agostaging: speakup: Fix warning reported by checkpatch
Aleksei Fedotov [Fri, 14 Aug 2015 19:34:37 +0000 (22:34 +0300)]
staging: speakup: Fix warning reported by checkpatch

This patch fixes the checkpatch.pl warnings:
WARNING: Block comments use a trailing */ on a separate line
WARNING: Block comments use * on subsequent lines

Signed-off-by: Aleksey Fedotov <lexa@cfotr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: speakup: Remove unnecessary externs
Joe Perches [Mon, 10 Aug 2015 21:51:32 +0000 (14:51 -0700)]
staging: speakup: Remove unnecessary externs

Using 'extern' is not necessary for function prototypes.

Miscellanea:

o Reflow alignments

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: olpc_dcon: Remove unnecessary externs
Joe Perches [Mon, 10 Aug 2015 21:51:27 +0000 (14:51 -0700)]
staging: olpc_dcon: Remove unnecessary externs

Using 'extern' is not necessary for function prototypes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: netlogic: Remove unnecessary externs
Joe Perches [Mon, 10 Aug 2015 21:51:24 +0000 (14:51 -0700)]
staging: netlogic: Remove unnecessary externs

Using 'extern' is not necessary for function prototypes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: android: update TODO
Mike Rapoport [Wed, 12 Aug 2015 18:08:50 +0000 (21:08 +0300)]
staging: android: update TODO

- remove "make sure things build as modules properly"
- remove kuid_t related remarks, they were relevant for logger, but it
  is gone half year ago
- remove dead e-mail address of Brian Swetland
- add e-mail addresses of Arve HjønnevÃ¥g and Riley Andrews

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: android: Remove unnecessary externs
Joe Perches [Mon, 10 Aug 2015 21:51:16 +0000 (14:51 -0700)]
staging: android: Remove unnecessary externs

Using 'extern' is not necessary for function prototypes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: iio: trigger: Use braces on both branches of if statement
Cristina Opriceana [Tue, 11 Aug 2015 10:20:53 +0000 (13:20 +0300)]
Staging: iio: trigger: Use braces on both branches of if statement

Fix style issue related to missing braces, detected by checkpatch.pl.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: iio: trigger: Alignment should match open parenthesis
Cristina Opriceana [Tue, 11 Aug 2015 10:18:18 +0000 (13:18 +0300)]
Staging: iio: trigger: Alignment should match open parenthesis

Fix alignment for function parameters as suggested by checkpatch.pl.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: iio: Remove unnecessary externs
Joe Perches [Mon, 10 Aug 2015 21:51:20 +0000 (14:51 -0700)]
staging: iio: Remove unnecessary externs

Using 'extern' is not necessary for function prototypes.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings
Adrian Remonda [Fri, 14 Aug 2015 10:18:04 +0000 (12:18 +0200)]
Staging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings

This is a patch to the most/aim_cdev.c file. It makes several
local functions and structures static to prevent global visibility.

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: most: hdm-usb/hdm_usb.c. Fix "missing static keyword" warnings
Adrian Remonda [Fri, 14 Aug 2015 10:18:02 +0000 (12:18 +0200)]
Staging: most: hdm-usb/hdm_usb.c. Fix "missing static keyword" warnings

This is a patch to the most/hdm-usb/hdm_usb.c file. It
makes several local functions and structures static to prevent global
visibility.

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings
Adrian Remonda [Fri, 14 Aug 2015 10:18:01 +0000 (12:18 +0200)]
Staging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings

This patch fixes the warning generated by sparse: "Using plain integer
as NULL pointer" by replacing the pointer test against 0 with a logical test.

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: most: mostcore/core.c. Fix "missing static keyword" warnings
Adrian Remonda [Fri, 14 Aug 2015 10:18:00 +0000 (12:18 +0200)]
Staging: most: mostcore/core.c. Fix "missing static keyword" warnings

This is a patch to the mostcore/core.c file. It makes
several local functions and structures static to prevent global
visibility.

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: most: Remove unnecessary externs
Joe Perches [Mon, 10 Aug 2015 21:51:22 +0000 (14:51 -0700)]
staging: most: Remove unnecessary externs

Using 'extern' is not necessary for function prototypes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/most: fix return value for DIM_GetChannelState
Tomas Melin [Sun, 9 Aug 2015 14:08:41 +0000 (17:08 +0300)]
staging/most: fix return value for DIM_GetChannelState

Return NULL instead of 0 for invalid input.

Signed-off-by: Tomas Melin <tomas.melin@iki.fi>
Acked-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging/lustre/llite: get rid of unused ll_super_blocks list
Oleg Drokin [Sun, 9 Aug 2015 00:09:06 +0000 (20:09 -0400)]
staging/lustre/llite: get rid of unused ll_super_blocks list

ll_super_blocks became unused quite a while ago with switch
to the new CLIO code.
So this patch removes the list, ll_sb_lock spinlock that guards it
and superblock info ll_list linkage.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: serial2002: Use monotonic clock
Abhilash Jindal [Tue, 11 Aug 2015 14:31:53 +0000 (10:31 -0400)]
staging: comedi: serial2002: Use monotonic clock

Wall time obtained from do_gettimeofday is susceptible to sudden jumps due to
user setting the time or due to NTP.

Monotonic time is constantly increasing time better suited for comparing two
timestamps.

Signed-off-by: Abhilash Jindal <klock.android@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: comedi: ni_usb6501: fix possible out-of-bounds access
H Hartley Sweeten [Mon, 10 Aug 2015 17:28:08 +0000 (10:28 -0700)]
staging: comedi: ni_usb6501: fix possible out-of-bounds access

Coverity reports a possible Out-of-bounds access (ARRAY_VS_SINGLETON)
with the 'const u8 *port' parameter passed to ni6501_port_command().
This param is an actual array for the SET_PORT_DIR operation, called
by ni6501_dio_insn_config(). But for the WRITE_PORT and READ_PORT
operations, called by ni6501_dio_insn_bits(), it is just the address
of an u8 local variable.

Fix the coverity issue by changing the parameter to an unsigned int
and pass the raw values from ni6501_dio_insn_config() and
ni6501_dio_insn_bits(). ni6501_port_command() then handles the masking
and shifting needed to load the value into the u8 transmit buffer.

For consistency, change the access of the 'bitmap' parameter from an
array access to a pointer operation.

Reported-by: coverity (CID 1248624)
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoMerge tag 'iio-for-4.3b-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Wed, 12 Aug 2015 19:43:41 +0000 (12:43 -0700)]
Merge tag 'iio-for-4.3b-2' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of new device support, features and cleanup for the 4.3 cycle.
Take 2 also includes a fix set that was too late for the 4.2 cycle.

As we had a lot of tools and docs work in this set, I have broken those
out into their own categories in this description.

Fixes from the pull request '4th set of IIO fixes for the 4.2 cycle'.
* Poll functions for both event chardev and the buffer one were returning
  negative error codes (via a positive value).
* A recent change to lsiio adding some error handling that was wrong and
  stopped the tool working.
* bmg160 was missing some dependencies in Kconfig
* berlin2-adc had a misshandled register (wrote a value rather than a bitmap)

New device support
* TI opt3001 light sensor
* TXC PA12 ALS and proximity sensor.
* mcp3301 ADC support (in mcp320x driver)
* ST lsm303agr accelerometer and magnetometer drivers (plus some st-sensors
  common support to allow different WHOAMI register addresses, devices with
  fixed scale and allow interrupt equiped magnetometers).
* ADIS16305, ADIS16367, ADIS16445IMUs (in the adis16400 driver)
* ADIS16266 gyro (in the adis16260 driver)
* ADIS16137 gyro (in the adis16136 driver)

New functionality
* mmc35240 DT bindings.
* Inverse unit conversion macros to aid handing of values written to sysfs
  attributes.

Core cleanup
* Forward declaration of struct iio_trigger to avoid a compile warning.

Driver cleanup / fixes
* mxs-lradc
  - Clarify which parts are supported.
  - Fix spelling erorrs.
  - Missing/extra includes
  - reorder includes
  - add datasheet name listings for all usable channels (to allow them
    to be bound by name from consumer drivers)
* acpi-als - add some function prefixes as per general iio style.
* bmc150_magn - replace a magic value with the existing define.
* vf610 - determine possible sample frequencies taking into account the
  electrical characteristics (defining a minimum sample time)
* dht11
  - whitespace
  - additional docs
  - avoid mulitple assignments in one line
  - Use the new funciton ktime_get_resolution_ns to cleanup a nasty trick
    previously used for timing.
* Fix all drivers that consider 0 a valid IRQ for historical reasons.
* Export I2C module alias info where previously missing (to allow autoprobing)
* Export OF module alias info where previously missing.
* mmc35240 - switch some variables into arrays to improve readability.
* mlx90614 - define some magic numbers for readability.
* bmc150_magn
  - expand area locked by a mutex to cover all the use of the
    data->buffer.
  - use descriptive naming for a mask instead of a magic value.
* berin2-adc
  - pass up an error code rather that a generic error
  - constify the iio_chan_spec
  - some other little tidy ups.
* stk8312
  - fix a dependency on triggered buffers in kconfig
  - add a check for invalid attribute values
  - improve error handling by returning error codes where possible and
    return immediately where relevant
  - rework macro defs to use GENMASK etc
  - change some variable types to reduce unnecessary casting
  - clean up code style
  - drop a local buffer copy for bulk reads and use the one in data->buffer
     instead.
* adis16400 - the adis16448 gyroscope scale was wrong.
* adis16480 - some more wrong scales for various parts.
* adis16300 - has an undocumented product id and serial number registers so
  use them.
* iio_simple_dummy - fix some wrong code indentation.
* bmc150-accel - use the chip ID to detect the chip present rather than
  verifying the expected part was there.  This was in response to a wrong
  ACPI entry on the WinBook TW100.
* mma8452
  - fix _get_hp_filter_index
  - drop a double include
  - pass up an error code rather than rewriting it
  - range check input values to attribute writes
  - register defs tidy up using GENMASK and reordering them to be easier to
    follow.
  - various coding style cleanups
  - put the Kconfig entry in the write place (alphabetically).

Tools related
* Tools cleanup - drop an explicity NULL comparison, some unnecessary braces,
  use the ARRAY_SIZE macro, send error messages to stderr instead of dropping
  them in the middle of normal output.
* Fix tools to allow that scale and offset attributes are optional.
* More tools fixes including allowing true 32bit data (previously an overflow
  prevented more than 31bits)
* Drop a stray header guard that ended up in a c file.
* Make calc_digits static as it isn't exported or in the header.
* Set ci_array pointer to NULL after free as a protection against non safe
  usage of the tools core code.  Also convert a double pointer to a single
  one as the extra level of indirection was unnecessary.

Docs
* DocBook introduction by Daniel Baluta.  Glad we are beginning to
  draw together some more introductory docs to suplement the various
  tools / examples.
* Drop bytes_per_datum sysfs attribute docs as it no longer exists.
* A whole load of missing / fixing of kernel-doc for the core of IIO.
* Document the trigger name sysfs attribute in the ABI docs.
* Minor typos in the ABI docs related to power down modes.

8 years agoiio: event: Remove negative error code from iio_event_poll
Cristina Opriceana [Mon, 3 Aug 2015 10:00:47 +0000 (13:00 +0300)]
iio: event: Remove negative error code from iio_event_poll

Negative return values are not supported by iio_event_poll since
its return type is unsigned int.

Fixes: f18e7a068a0a3 ("iio: Return -ENODEV for file operations if the device has been unregistered")
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: industrialio-buffer: Fix iio_buffer_poll return value
Cristina Opriceana [Mon, 3 Aug 2015 10:37:40 +0000 (13:37 +0300)]
iio: industrialio-buffer: Fix iio_buffer_poll return value

Change return value to 0 if no device is bound since
unsigned int cannot support negative error codes.

Fixes: f18e7a068 ("iio: Return -ENODEV for file operations if the
device has been unregistered")

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: lsiio: fix error code handling error
Linus Walleij [Tue, 4 Aug 2015 14:21:49 +0000 (16:21 +0200)]
iio: lsiio: fix error code handling error

commit acf50b3586f8d8a7530b905e111dda41876d38f4
"tools:iio:lsiio: add error handling"
introduced error handling of errors returned from
read_sysfs_string(), but with a simple if (retval),
missing the fact that these functions return a positive
value if the read was successful.

As a result lsiio regresses and does not show any
devices on my filesystem. Fix this by checking for
only negative error codes.

Cc: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required
Markus Pargmann [Wed, 29 Jul 2015 13:46:03 +0000 (15:46 +0200)]
iio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required

This patch adds selects for IIO_BUFFER and IIO_TRIGGERED_BUFFER. Without
IIO_BUFFER, the driver does not compile.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:adc:berlin2-adc: Fix register definition
Hartmut Knaack [Mon, 27 Jul 2015 22:38:57 +0000 (00:38 +0200)]
iio:adc:berlin2-adc: Fix register definition

Active channel number is stored in BERLIN2_SM_CTRL as value, instead of a
bit map.
The masks for channel interrupts and data ready are a 16 bits wide bit
map each, instead of just 4 bits.

Also correct the data mask for the temperature sensor, which was
Reported-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agostaging: ozwpan: Remove from tree
Jason A. Donenfeld [Mon, 10 Aug 2015 15:49:51 +0000 (17:49 +0200)]
staging: ozwpan: Remove from tree

Ozwpan is completely unmaintained and potentially a security problem. As
this is a staging driver, it should be removed, since it has been
abandoned.

Cc: Shigekatsu Tateno <shigekatsu.tateno@atmel.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoMerge 4.2-rc6 into staging-next
Greg Kroah-Hartman [Mon, 10 Aug 2015 16:07:25 +0000 (09:07 -0700)]
Merge 4.2-rc6 into staging-next

We want the IIO and staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoLinux 4.2-rc6
Linus Torvalds [Sun, 9 Aug 2015 19:54:30 +0000 (15:54 -0400)]
Linux 4.2-rc6

8 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Linus Torvalds [Sun, 9 Aug 2015 07:38:42 +0000 (09:38 +0200)]
Merge branch 'for-linus' of git://git./linux/kernel/git/dtor/input

Pull input subsystem fixes from Dmitry Torokhov:
 "Just small ALPS and Elan touchpads, and other driver fixups"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: elantech - add special check for fw_version 0x470f01 touchpad
  Input: twl4030-vibra - fix ERROR: Bad of_node_put() warning
  Input: alps - only Dell laptops have separate button bits for v2 dualpoint sticks
  Input: axp20x-pek - add module alias
  Input: turbografx - fix potential out of bound access

8 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Sun, 9 Aug 2015 02:59:21 +0000 (05:59 +0300)]
Merge branch 'upstream' of git://git.linux-mips.org/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "Another round of MIPS fixes for 4.2.  No area does particularly stand
  out but we have a two unpleasant ones:

   - Kernel ptes are marked with a global bit which allows the kernel to
     share kernel TLB entries between all processes.  For this to work
     both entries of an adjacent even/odd pte pair need to have the
     global bit set.  There has been a subtle race in setting the other
     entry's global bit since ~ 2000 but it take particularly
     pathological workloads that essentially do mostly vmalloc/vfree to
     trigger this.

     This pull request fixes the 64-bit case but leaves the case of 32
     bit CPUs with 64 bit ptes unsolved for now.  The unfixed cases
     affect hardware that is not available in the field yet.

   - Instruction emulation requires loading instructions from user space
     but the current fast but simplistic approach will fail on pages
     that are PROT_EXEC but !PROT_READ.  For this reason we temporarily
     do not permit this permission and will map pages with PROT_EXEC |
     PROT_READ.

  The remainder of this pull request is more or less across the field
  and the short log explains them well"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: Make set_pte() SMP safe.
  MIPS: Replace add and sub instructions in relocate_kernel.S with addiu
  MIPS: Flush RPS on kernel entry with EVA
  Revert "MIPS: BCM63xx: Provide a plat_post_dma_flush hook"
  MIPS: BMIPS: Delete unused Kconfig symbol
  MIPS: Export get_c0_perfcount_int()
  MIPS: show_stack: Fix stack trace with EVA
  MIPS: do_mcheck: Fix kernel code dump with EVA
  MIPS: SMP: Don't increment irq_count multiple times for call function IPIs
  MIPS: Partially disable RIXI support.
  MIPS: Handle page faults of executable but unreadable pages correctly.
  MIPS: Malta: Don't reinitialise RTC
  MIPS: unaligned: Fix build error on big endian R6 kernels
  MIPS: Fix sched_getaffinity with MT FPAFF enabled
  MIPS: Fix build with CONFIG_OF=y for non OF-enabled targets
  CPUFREQ: Loongson2: Fix broken build due to incorrect include.

8 years agoMerge branch 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
Linus Torvalds [Sun, 9 Aug 2015 02:56:31 +0000 (05:56 +0300)]
Merge branch 'for-linus-4.2' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs fix from Chris Mason:
 "We have a btrfs quota regression fix.

  I merged this one on Thursday and have run it through tests against
  current master.

  Normally I wouldn't have sent this while you were finalizing rc6, but
  I'm feeding mosquitoes in the adirondacks next week, so I wanted to
  get this one out before leaving.  I'll leave longer tests running and
  check on things during the week, but I don't expect any problems"

* 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: qgroup: Fix a regression in qgroup reserved space.

8 years agoMerge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Linus Torvalds [Sun, 9 Aug 2015 02:54:27 +0000 (05:54 +0300)]
Merge branch 'for-rc' of git://git./linux/kernel/git/rzhang/linux

Pull thermal management fixes from Zhang Rui:
 "Specifics:

   - fix an error that "weight_attr" sysfs attribute is not removed
     while unbinding.  From: Viresh Kumar.

   - fix power allocator governor tracing to return the real request.
     From Javi Merino.

   - remove redundant owner assignment of hisi platform thermal driver.
     From Krzysztof Kozlowski.

   - a couple of small fixes of Exynos thermal driver.  From Krzysztof
     Kozlowski and Chanwoo Choi"

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
  thermal: Drop owner assignment from platform_driver
  thermal: exynos: Remove unused code related to platform_data on probe()
  thermal: exynos: Add the dependency of CONFIG_THERMAL_OF instead of CONFIG_OF
  thermal: exynos: Disable the regulator on probe failure
  thermal: power_allocator: trace the real requested power
  thermal: remove dangling 'weight_attr' device file

8 years agoStaging: lustre/lustre/ptlrpc: service.c: Fixed issue with global integer being initi...
Daniel Machon [Sat, 8 Aug 2015 18:43:25 +0000 (20:43 +0200)]
Staging: lustre/lustre/ptlrpc: service.c: Fixed issue with global integer being initialized to 0

Fixed global integer initialization issue.
Global variables should not be explicitly initialized to 0 or NULL.

Signed-off-by: Daniel Machon <dmachon.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: lustre/lnet/selftest: framework.c: Fixed coding style issues
Daniel Machon [Sat, 8 Aug 2015 18:34:59 +0000 (20:34 +0200)]
Staging: lustre/lnet/selftest: framework.c: Fixed coding style issues

Fixed coding style issues where statement should be on the next line

Signed-off-by: Daniel Machon <dmachon.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agoStaging: wilc1000: wilc_platform.h: Fixed include guard spelling error
Daniel Machon [Sat, 8 Aug 2015 18:00:07 +0000 (20:00 +0200)]
Staging: wilc1000: wilc_platform.h: Fixed include guard spelling error

Fixed spelling error

Signed-off-by: Daniel Machon <dmachon.dev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Remove braces for single statement 'if' and 'else'
Chandra S Gorentla [Sat, 8 Aug 2015 12:11:36 +0000 (17:41 +0530)]
staging: wilc1000: Remove braces for single statement 'if' and 'else'

Fixes the checkpatch.pl warning - braces {} are not necessary for any arm
of this statement

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Remove ' ' before quoted '\n'
Chandra S Gorentla [Sat, 8 Aug 2015 12:11:35 +0000 (17:41 +0530)]
staging: wilc1000: Remove ' ' before quoted '\n'

Fixes the checkpatch.pl warning -
'unnecessary whitespace before a quoted newline'.

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Remove unused extern declarations
Chandra S Gorentla [Sat, 8 Aug 2015 12:11:34 +0000 (17:41 +0530)]
staging: wilc1000: Remove unused extern declarations

'extern' declarations which are not referenced within the file are
removed.

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agostaging: wilc1000: Add space between the braces
Chandra S Gorentla [Sat, 8 Aug 2015 12:11:33 +0000 (17:41 +0530)]
staging: wilc1000: Add space between the braces

Inserted space between nested braces.  This fixes the checkpatch.pl
error - space required after that close brace '}'.

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
8 years agotools: iio: remove unnecessary double pointer
Joo Aun Saw [Fri, 24 Jul 2015 15:23:29 +0000 (01:23 +1000)]
tools: iio: remove unnecessary double pointer

Remove unnecessary double pointer from channel sorting function.

Signed-off-by: Joo Aun Saw <jasaw@dius.com.au>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agotools: iio: Set caller's ci_array pointer to NULL after free
Joo Aun Saw [Fri, 24 Jul 2015 15:23:28 +0000 (01:23 +1000)]
tools: iio: Set caller's ci_array pointer to NULL after free

On error, caller's ci_array is freed and set to NULL to avoid
potential double free if some other user of this code is not
sufficiently careful. Counter is reset to zero for consistency.

Signed-off-by: Joo Aun Saw <jasaw@dius.com.au>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio: Fix typos in ABI documentation
Vladimir Barinov [Wed, 29 Jul 2015 12:57:41 +0000 (15:57 +0300)]
iio: Fix typos in ABI documentation

Fix typos in ABI documentation

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:accel:mma8452: reorder Kconfig entry
Hartmut Knaack [Sun, 2 Aug 2015 20:43:52 +0000 (22:43 +0200)]
iio:accel:mma8452: reorder Kconfig entry

Move the entry in Kconfig to its alphabetically correct position.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:accel:mma8452: coding style cleanup
Hartmut Knaack [Sun, 2 Aug 2015 20:43:51 +0000 (22:43 +0200)]
iio:accel:mma8452: coding style cleanup

Some coding style cleanups, mainly indicated by checkpatch.pl, which
includes indentation changes, drop spaces after casts and befor tabs.
Also insert empty lines after logical blocks and before unconditional
returns.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:accel:mma8452: rework register definitions
Hartmut Knaack [Sun, 2 Aug 2015 20:43:50 +0000 (22:43 +0200)]
iio:accel:mma8452: rework register definitions

Rework register definitions to be sorted by register and bit number, with
bit definitions cascaded under the appropriate register, use GENMASK for
consecutive bitmasks and realign properly.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:accel:mma8452: check values to be written
Hartmut Knaack [Sun, 2 Aug 2015 20:43:49 +0000 (22:43 +0200)]
iio:accel:mma8452: check values to be written

Check values to be written to the device for valid lower and upper bounds.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
8 years agoiio:accel:mma8452: pass up real error code
Hartmut Knaack [Sun, 2 Aug 2015 20:43:48 +0000 (22:43 +0200)]
iio:accel:mma8452: pass up real error code

Pass up the error code provided by functions.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>