[PATCH] Staging: comedi: fix block comments coding style issue in comedi.h

2015-11-18 Thread maomao xu
Fix up block comments to make a trailing */ on a separate line Signed-off-by: maomao xu --- drivers/staging/comedi/comedi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h index 66edda1..ec5e59c 100644 --- a/

re: staging: wilc1000: call linux_sdio_init instead of io_init

2015-11-18 Thread Dan Carpenter
Hello Glen Lee, The patch de11ee8b214e: "staging: wilc1000: call linux_sdio_init instead of io_init" from Nov 6, 2015, leads to the following static checker warning: drivers/staging/wilc1000/wilc_sdio.c:574 sdio_init() info: ignoring unreachable code. drivers/staging/wilc1000/wil

Re: [PATCH 05/23] staging: comedi: adv_pci1710: define the mux control register bits

2015-11-18 Thread Ian Abbott
On 13/11/15 18:11, H Hartley Sweeten wrote: For aesthetics, define some macros to set the bits in the mux control register. Also, rename the 'mux_ext' member of the private data. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pc

Re: [PATCH v2 00/23] staging: comedi: adv_pci1710: tidy up driver

2015-11-18 Thread Ian Abbott
On 13/11/15 18:11, H Hartley Sweeten wrote: Now that the PCI-1720 support has been moved to a separate driver, remove some unnecessary boardinfo in this driver and tidy it up a bit. v2: address some issues pointed out by Ian Abbott with the patches that support external analog output refe

Re: [PATCH] staging: comedi: ni_mio_common: add "no_channel" versions of some functions

2015-11-18 Thread Ian Abbott
On 14/11/15 18:19, Andrzej Pietrasiewicz wrote: ni_release_ai_mite_channel(), ni_release_ao_mite_channel(), ni_release_gpct_mite_channel() and ni_release_cdo_mite_channel() call functions which interpret -1 as a special value meaning "no channel". This patch adds explicit "no_channel" versions in

[PATCH 00/28] staging: most: bug-fixes and clean-up

2015-11-18 Thread Christian Gromm
This patchset is needed to have open issues of the MOST driver fixed and the code cleaned up. Christian Gromm (28): staging: most: remove unnecessary keep_mbo variable staging: most: rename variables staging: most: simplify expression staging: most: unify types staging: most: use min_t

[PATCH 04/28] staging: most: unify types

2015-11-18 Thread Christian Gromm
This patch unifies variable types to get less castings. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c index b29307

[PATCH 02/28] staging: most: rename variables

2015-11-18 Thread Christian Gromm
This patch renames some variables for better readability. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c in

[PATCH 01/28] staging: most: remove unnecessary keep_mbo variable

2015-11-18 Thread Christian Gromm
The MBO pointer stacked_mbo and the boolean variable keep_mbo are always changed together and therefore provide the same information. This patch removes keep_mbo and uses stacked_mbo instead. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 12 1 file chan

[PATCH 05/28] staging: most: use min_t

2015-11-18 Thread Christian Gromm
This patch replaces min with min_t. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c index 4bf0322..6ee4eb2 100644 --- a/d

[PATCH 07/28] staging: most: fix tracking of MBO offset

2015-11-18 Thread Christian Gromm
This patch increments mbo_offs by the number of bytes that have been copied and resets it in case a complete mbo has been transferred to user buffer. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH 03/28] staging: most: simplify expression

2015-11-18 Thread Christian Gromm
This patch replaces the ternary ?-operator with a way simpler subtraction. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c i

[PATCH 08/28] staging: most: use readl and writel functions

2015-11-18 Thread Christian Gromm
This patch makes use of functions readl and writel instead of the __raw_* variants. Signed-off-by: Christian Gromm --- drivers/staging/most/hdm-dim2/dim2_hdm.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c b/drivers/staging/m

[PATCH 06/28] staging: most: fix mbo leak

2015-11-18 Thread Christian Gromm
This patch fixes a potential MBO leak in case function aim_read() exits right after the MBO has been fetched from kfifo and before it has been saved to the variable stacked_mbo. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c |2 +- 1 file changed, 1 insertion(+), 1 d

[PATCH 09/28] staging: most: remove function destroy_most_c_obj

2015-11-18 Thread Christian Gromm
This patch removes the function destroy_most_c_obj and executes its code within function destroy_most_inst_obj. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c | 38 +- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/drive

[PATCH 16/28] staging: most: remove reference counter

2015-11-18 Thread Christian Gromm
This patch removes the unnecessary reference conter mod_ref. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c in

[PATCH 23/28] staging: most: fix race conditions

2015-11-18 Thread Christian Gromm
This patch fixes race conditions that might emerge from functions aim_open, aim_close, aim_read, aim_write and aim_disconnect_channel within module cdev. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 89 +- 1 file changed, 54 insertio

[PATCH 21/28] staging: most: fix retrieval of buffer availability

2015-11-18 Thread Christian Gromm
This patch fixes the function channel_has_mbo that delivers the false information in case two AIMs are using the same tx channel. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 12 ++-- drivers/staging/most/mostcore/core.c |7 ++- drivers/stag

[PATCH 13/28] staging: most: move mutex

2015-11-18 Thread Christian Gromm
This patch removes mutex from code that doesn't need any locking. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index 21

[PATCH 15/28] staging: most: remove tainted flag

2015-11-18 Thread Christian Gromm
This patch removes the atomic tainted flag. It is needed to get rid of logical overhead. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c | 33 + 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/staging/most/mostcore/c

[PATCH 19/28] staging: most: remove redundant call to wake_up_interruptible

2015-11-18 Thread Christian Gromm
This patch prevents the cdev module from rousing the channel wait queue in case the channel is about to be closed. It is safe to do so, because the application can not be waiting within read or write and at the same time be calling close. Signed-off-by: Christian Gromm --- drivers/staging/most/a

[PATCH 10/28] staging: most: add missing call to ida_simple_remove

2015-11-18 Thread Christian Gromm
This patch adds two missing calls to function ida_simpel_remove. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index 8be6cdcf..995987d 1

[PATCH 17/28] staging: most: remove code to destroy channel

2015-11-18 Thread Christian Gromm
This patch removes unnecessary code to destroy channel objects. It is needed, because function most_stop_channel, which is indirectly triggered by function most_deregister_interface, already destroys the channels. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c | 13 ---

[PATCH 12/28] staging: most: move initialization of pointer

2015-11-18 Thread Christian Gromm
This patch makes function store_add_link initialize the pointer to an AIM right before the channel is probed. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c

[PATCH 25/28] staging: most: remove stacked_mbo

2015-11-18 Thread Christian Gromm
This patch makes use of kfifo_peek and kfifo_skip, which renders the variable stacked_mbo useless. It is therefore removed. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 16 +++- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/stag

[PATCH 14/28] staging: most: move channel disconnect to function most_deregister_interface

2015-11-18 Thread Christian Gromm
This patch moves the code that disconnects linked channels. It is needed to have cleaning things up done right. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/staging

[PATCH 22/28] staging: most: rename variable channel

2015-11-18 Thread Christian Gromm
This patch renames the variable 'channel' to 'c'. This is needed to have the code look more homogeneous and to prevent format violations. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 216 +- 1 file changed, 108 insertions(+), 108 dele

[PATCH 11/28] staging: most: move call to disconnect_channel callback

2015-11-18 Thread Christian Gromm
This patch invokes AIM's disconnect_channel callback before the corresponding pointers are re-initialized to NULL. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/most/mostcore/core

[PATCH 24/28] staging: most: change type of access_ref

2015-11-18 Thread Christian Gromm
This patch changes the type of the access reference from atomit_t to int. It is needed, because the reference variable is secured by synchronization locks and does not need to be atomic anymore. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 17 - 1 f

[PATCH 27/28] staging: most: add statistics for dropped packets

2015-11-18 Thread Christian Gromm
This patch adds a counter for dropped packets. It needed for statistical analysis. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-network/networking.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/staging/most/aim-network/networking.c b/d

[PATCH 28/28] staging: most: remove 2nd forward declaration of struct most_aim

2015-11-18 Thread Christian Gromm
This patch removes the second forwared declaration of struct most_aim. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c index e5ceb82..e9943

[PATCH 26/28] staging: most: rearrange function aim_write

2015-11-18 Thread Christian Gromm
This patch rearranges the code of function aim_write() of module aim-cdev. It is needed to remove the error lable and make the code straighter. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-)

[PATCH 20/28] staging: most: encapsulate shared code

2015-11-18 Thread Christian Gromm
This patch encapsulates shared code. It therefore creates the new functions stop_channel and destroy_cdev. Signed-off-by: Christian Gromm --- drivers/staging/most/aim-cdev/cdev.c | 55 ++ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/drivers/st

[PATCH 18/28] staging: most: remove redundant mutexes

2015-11-18 Thread Christian Gromm
This patch removes the mutexes stop_task_mutex and deregister mutex, since they can safely be left out. Signed-off-by: Christian Gromm --- drivers/staging/most/mostcore/core.c |9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/m

Re: [PATCH 12/28] staging: most: move initialization of pointer

2015-11-18 Thread Dan Carpenter
On Wed, Nov 18, 2015 at 01:43:36PM +0100, Christian Gromm wrote: > This patch makes function store_add_link initialize the pointer to an AIM > right before the channel is probed. > The patch description implies that this is a cleanup but looking at the patch it looks like a behavior change. Actu

Re: [PATCH 27/28] staging: most: add statistics for dropped packets

2015-11-18 Thread Dan Carpenter
On Wed, Nov 18, 2015 at 01:43:51PM +0100, Christian Gromm wrote: > This patch adds a counter for dropped packets. It needed for statistical > analysis. > > Signed-off-by: Christian Gromm > --- > drivers/staging/most/aim-network/networking.c | 11 --- > 1 file changed, 8 insertions(+),

[PATCH v2 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure

2015-11-18 Thread Vitaly Kuznetsov
inmsg should be freed in case of on_msg() failure to avoid memory leak. Preserve the error code from on_msg(). Signed-off-by: Vitaly Kuznetsov --- Changes since v1: - Preserve the error code from on_msg(). [Dan Carpenter] --- drivers/hv/hv_utils_transport.c | 7 --- 1 file changed, 4 inserti

[PATCH v2 2/4] Drivers: hv: utils: rename outmsg_lock

2015-11-18 Thread Vitaly Kuznetsov
As a preparation to reusing outmsg_lock to protect test-and-set openrations on 'mode' rename it the more general 'lock'. Signed-off-by: Vitaly Kuznetsov --- drivers/hv/hv_utils_transport.c | 14 +++--- drivers/hv/hv_utils_transport.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions

[PATCH v2 4/4] Drivers: hv: utils: fix crash when device is removed from host side

2015-11-18 Thread Vitaly Kuznetsov
The crash is observed when a service is being disabled host side while userspace daemon is connected to the device: [ 90.244859] general protection fault: [#1] SMP ... [ 90.800082] Call Trace: [ 90.800082] [] __fput+0xc8/0x1f0 [ 90.800082] [] fput+0xe/0x10 ... [ 90.800082] []

[PATCH v2 3/4] Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode

2015-11-18 Thread Vitaly Kuznetsov
When Hyper-V host asks us to remove some util driver by closing the appropriate channel there is no easy way to force the current file descriptor holder to hang up but we can start to respond -EBADF to all operations asking it to exit gracefully. As we're setting hvt->mode from two separate contex

[PATCH v2 0/4] Drivers: hv: utils: prevent crash when a utility driver is disabled host side

2015-11-18 Thread Vitaly Kuznetsov
Changes since v1: - Don't re-introduce memory leak in hvt_op_write(), preserve the error code from on_msg() [Dan Carpenter] Original description: I'm observing a crash when a utility driver is disabled host side (e.g. 'Guest services' is disabled live) when we have userspace daemon connected:

Re: [PATCH] comedi: pcmmio: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 14/11/15 13:24, Ranjith Thangavel wrote: BIT macro is used for defining BIT location instead of shifting operator - coding style issue Signed-off-by: Ranjith Thangavel --- drivers/staging/comedi/drivers/pcmmio.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-

Re: [PATCH] comedi: gsc_hpdi: Fix coding style - use kernel type definitions for variables

2015-11-18 Thread Ian Abbott
On 14/11/15 17:21, Ranjith Thangavel wrote: kernel type definitions are preferred for variables over standard type definitions Signed-off-by: Ranjith Thangavel --- drivers/staging/comedi/drivers/gsc_hpdi.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff -

[PATCH] staging: media: bcm2048: fix brace coding style issue in radio-bcm2048.c

2015-11-18 Thread Jitendra Kumar Khasdev
This is a patch to the radio-bcm2048.c file that fixes up a brace warning found by the checkpatch.pl tool. Signed-off-by: Jitendra Kumar Khasdev --- drivers/staging/media/bcm2048/radio-bcm2048.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/bcm2048

Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 14/11/15 13:13, Ranjith Thangavel wrote: BIT macro is used for defining BIT location instead of shifting operator - coding style issue Signed-off-by: Ranjith Thangavel --- drivers/staging/comedi/drivers/ni_6527.c | 27 ++- 1 file changed, 14 insertions(+), 13 del

Re: [PATCH] staging: media: bcm2048: fix brace coding style issue in radio-bcm2048.c

2015-11-18 Thread kbuild test robot
Hi Jitendra, [auto build test ERROR on: linuxtv-media/master] [also build test ERROR on: v4.4-rc1 next-20151118] url: https://github.com/0day-ci/linux/commits/Jitendra-Kumar-Khasdev/staging-media-bcm2048-fix-brace-coding-style-issue-in-radio-bcm2048-c/20151118-235820 base: git

RE: [PATCH 05/23] staging: comedi: adv_pci1710: define the mux control register bits

2015-11-18 Thread Hartley Sweeten
On Wednesday, November 18, 2015 3:33 AM, Ian Abbott wrote: > On 13/11/15 18:11, H Hartley Sweeten wrote: >> For aesthetics, define some macros to set the bits in the mux control >> register. Also, rename the 'mux_ext' member of the private data. >> >> Signed-off-by: H Hartley Sweeten >> Cc: Ian Ab

Re: [PATCH] staging: media: bcm2048: fix brace coding style issue in radio-bcm2048.c

2015-11-18 Thread kbuild test robot
Hi Jitendra, [auto build test ERROR on linuxtv-media/master] [also build test ERROR on v4.4-rc1 next-20151118] url: https://github.com/0day-ci/linux/commits/Jitendra-Kumar-Khasdev/staging-media-bcm2048-fix-brace-coding-style-issue-in-radio-bcm2048-c/20151118-235820 base: git://linuxtv.org

Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 14/11/15 17:10, Ranjith Thangavel wrote: BIT macro is used for defining BIT location instead of shifting operator, usleep_range is preferred over udelay - coding style issue Those two things should be done in separate patches. Signed-off-by: Ranjith Thangavel --- drivers/staging/comedi/

Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 18/11/15 16:26, Ian Abbott wrote: On 14/11/15 17:10, Ranjith Thangavel wrote: BIT macro is used for defining BIT location instead of shifting operator, usleep_range is preferred over udelay - coding style issue Those two things should be done in separate patches. Sorry, I didn't see you'v

Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 16/11/15 16:56, Ranjith Thangavel wrote: BIT macro is used for defining BIT location instead of shifting operator - coding style issue Signed-off-by: Ranjith Thangavel --- drivers/staging/comedi/drivers/ni_6527.c | 24 1 file changed, 12 insertions(+), 12 deleti

Re: [PATCH 1/2] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 16/11/15 17:18, Ranjith Thangavel wrote: BIT macro is used for defining BIT location instead of shifting operator, usleep_range is preferred over udelay - coding style issue This patch doesn't use usleep_range(), so the description is inaccurate. Signed-off-by: Ranjith Thangavel --- dr

RE: [PATCH 1/2] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Hartley Sweeten
On Wednesday, November 18, 2015 9:42 AM, Ian Abbott wrote: > On 16/11/15 17:18, Ranjith Thangavel wrote: [snip] >> -#define DMM32AT_AI_CFG_SCINT_20US (0 << 4) >> -#define DMM32AT_AI_CFG_SCINT_15US (1 << 4) >> -#define DMM32AT_AI_CFG_SCINT_10US (2 << 4) >> -#define DMM32AT_AI_CFG_SCINT_5US

Re: [PATCH 1/2] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 18/11/15 16:45, Hartley Sweeten wrote: On Wednesday, November 18, 2015 9:42 AM, Ian Abbott wrote: On 16/11/15 17:18, Ranjith Thangavel wrote: [snip] -#define DMM32AT_AI_CFG_SCINT_20US (0 << 4) -#define DMM32AT_AI_CFG_SCINT_15US (1 << 4) -#define DMM32AT_AI_CFG_SCINT_10US (2

[PATCH 17/33] staging: comedi: adv_pci_dio: remove defines used for the do registers

2015-11-18 Thread H Hartley Sweeten
These defines are only used to initialize the diosubd_data 'addr' members in the boardinfo. For aesthetics, just open-code the values and remove the defines. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 32 +--

[PATCH 13/33] staging: comedi: adv_pci_dio: remove defines used for the di registers

2015-11-18 Thread H Hartley Sweeten
These defines are only used to initialize the diosubd_data 'addr' members in the boardinfo. For aesthetics, just open-code the values and remove the defines. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 30 ++-

[PATCH 04/33] staging: comedi: adv_pci_dio: post increment 'subdev' in (*auto_attach)

2015-11-18 Thread H Hartley Sweeten
For aesthetics, post-increment the 'subdev' index when used to get a comedi_subdevice pointer instead of incrementing it after the subdevice is initialized. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 16 +---

[PATCH 25/33] staging: comedi: adv_pci_dio: cleanup PCI-175[46] interrupt registers

2015-11-18 Thread H Hartley Sweeten
For aesthetics, replace these defines with a macro. Refactor the switch in pci_dio_reset() to use common code. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 21 + 1 file changed, 9 insertions(+), 1

[PATCH 08/33] staging: comedi: adv_pci_dio: refactor 'io_access' boardinfo

2015-11-18 Thread H Hartley Sweeten
The boards supported by this driver either use 8-bit or 16-bit I/O. The 'io_access' member of the boardinfo is used by the (*auto_attach) to determine which (*insn_bits) function to use. Simplify the boardinfo a bit by refactoring the 'io_access' member into a bit-field flag 'is_16bit'. Use the ne

[PATCH 14/33] staging: comedi: adv_pci_dio: remove board reset during (*detach)

2015-11-18 Thread H Hartley Sweeten
The board reset function disables and clears all interrupts. It also resets all the digital output channels to 0. Interrupts are not used by this driver so the disable/clear during the (*detach) is not necessary. Reseting all the digital outputs to 0 might not be desired depending on what the out

[PATCH 02/33] staging: comedi: adv_pci_dio: tidy up comedi driver block comment

2015-11-18 Thread H Hartley Sweeten
Reformat the bolck comment in the kernel CodingStyle. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 40 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/drivers/staging/comed

[PATCH 26/33] staging: comedi: adv_pci_dio: rename PCI1752_6_CFC define

2015-11-18 Thread H Hartley Sweeten
For aesthetics, rename this define and fix the alignment. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.

[PATCH 06/33] staging: comedi: adv_pci_dio: absorb pci_dio_add_do()

2015-11-18 Thread H Hartley Sweeten
This function initializes a digitial output subdevice. For aesthetics, absorb it into the (*auto_attach). Remove the improper initialization of the SDF_LSAMPL subdev_flag and len_chanlist. These are only used by subdevices that support async commands. Also remove the unnecessary initilaization of

[PATCH 00/33] staging: comedi: adv_pci_dio: cleanup driver

2015-11-18 Thread H Hartley Sweeten
With the PCI-1760 support moved to a separate driver this one can now be simplified and cleaned up pretty nicely. Tidy up this driver and fix all the checkpatch.pl issues. This series applies after: "staging: comedi: adv_pci_dio: separate out PCI-1760 support" H Hartley Sweeten (33): staging:

[PATCH 09/33] staging: comedi: adv_pci_dio: remove need for diosubd_data 'regs' member

2015-11-18 Thread H Hartley Sweeten
Currently the (*insn_bits) functions used the 'regs' member to determine how many registers need to be read or written to update the subdevice. We can use the subdevice 'n_chan' to determine this and make the code a bit clearer. The (*auto_attach) also uses this member to determine how many 8255 d

[PATCH 11/33] staging: comedi: adv_pci_dio: simplify the 'boardid' boardinfo

2015-11-18 Thread H Hartley Sweeten
The "board id" register is always 4-bits (4 di channels) and the register used to read the bits is always > 0. Simplify the 'boardid' boardinfo by replacing it with a 'id_reg' member and open-coding the subdevice n_chan. For aesthetics, remove all the *_BOARDID defines and just open-code the regi

[PATCH 05/33] staging: comedi: adv_pci_dio: use a const pointer to the diosubd_data

2015-11-18 Thread H Hartley Sweeten
For aesthetics, use a const pointer to access the diosubd_data in the boardinfo when doing the (*auto_attach).. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 31 +--- 1 file changed, 19 insertio

[PATCH 15/33] staging: comedi: adv_pci_dio: do board reset early in (*auto_attach)

2015-11-18 Thread H Hartley Sweeten
The board reset function disables and clears all interrupts. It also resets all the digital output channels to 0. Interrupts are not currently used by this driver. For asthetics, do the board reset early in the (*auto_attach) to make sure the interrupts are disabled in case this feature is added.

[PATCH 32/33] staging: comedi: adv_pci_dio: tidy up the comedi comment block

2015-11-18 Thread H Hartley Sweeten
The Description is a bit long winded and the same information is in the Devices. Shorten the Description and tidy up the Devices. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 9 +++-- 1 file changed, 3 insertions(

[PATCH 20/33] staging: comedi: adv_pci_dio: disable channel freeze outside of switch

2015-11-18 Thread H Hartley Sweeten
For aesthetics, move the disable of the channel freeze for the PCI-1752 and PCI-1756 boards out of the switch used to disable and clear interrupts. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 10 -- 1 file ch

[PATCH 07/33] staging: comedi: adv_pci_dio: absorb pci_dio_add_di()

2015-11-18 Thread H Hartley Sweeten
This function initializes a digitial input subdevices. For aesthetics, absorb it into the (*auto_attach). Remove the improper initialization of the SDF_LSAMPL subdev_flag and len_chanlist. These are only used by subdevices that support async commands. Also, remove the unnecessary 'specflags' from

[PATCH 33/33] staging: comedi: adv_pci_dio: update the MODULE_DESCRIPTION

2015-11-18 Thread H Hartley Sweeten
Change the MODULE_DESCRIPTION to something more useful than the generic "Comedi low-level driver". Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 28/33] staging: comedi: adv_pci_dio: remove boardinfo 'cardtype'

2015-11-18 Thread H Hartley Sweeten
This member of the boardinfo is identical to the offset of the boardinfo in the boardtypes array. It's also passed as the 'context' to the driver (*auto_attach). The 'cardtype' is only needed by the (*auto_attach) to determine which PCI BAR to use and in pci_dio_reset() to handle the board specifi

[PATCH 24/33] staging: comedi: adv_pci_dio: cleanup PCI-1753 interrupt register defines

2015-11-18 Thread H Hartley Sweeten
For aesthetics, replace these defines with some macros. Refactor the switch in pci_dio_reset() to not require the fallthrough comment. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 33 1 f

[PATCH 21/33] staging: comedi: adv_pci_dio: cleanup "disable and clear interrupts" comments

2015-11-18 Thread H Hartley Sweeten
For aesthetics, use a common comment for the switch() that disables and clears interrupts. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) di

[PATCH 22/33] staging: comedi: adv_pci_dio: use common defines for PCI-173[036] registers

2015-11-18 Thread H Hartley Sweeten
These boards use the same offsets for the interrupt control registers. For aesthetics, remove the current defines and use common ones. Fix the switch() in pci_dio_reset() to use common code. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/driv

[PATCH 27/33] staging: comedi: adv_pci_dio: cleanup PCI-1762 interrupt registers

2015-11-18 Thread H Hartley Sweeten
For aesthetics, use a common define for the interrupt control and status registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging

[PATCH 23/33] staging: comedi: adv_pci_dio: use common defines for PCI-1739/175[01] registers

2015-11-18 Thread H Hartley Sweeten
These boards use the same offsets for the interrupt control registers. For aesthetics, remove the current defines and use common ones. Fix the switch() in pci_dio_reset() to use common code. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/driv

[PATCH 29/33] staging: comedi: adv_pci_dio: move and rename enum hw_cards_id

2015-11-18 Thread H Hartley Sweeten
For aesthetics, move this enum after the register defines and rename it to have namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 29 1 file changed, 17 in

[PATCH 10/33] staging: comedi: adv_pci_dio: use the diosubd_data 'addr' for di/do s->private

2015-11-18 Thread H Hartley Sweeten
Currently the di/do subdevices store a pointer to the diosubd_data in s->private. The (*insn_bits) functions then use that to get to the 'addr' needed to access the registers. The only member of diosubd_data that is needed by the (*insn_bits) functions is the 'addr'. For aesthetics, just store th

[PATCH 16/33] staging: comedi: adv_pci_dio: reset digital outputs in subdevice init

2015-11-18 Thread H Hartley Sweeten
Currently the board reset function also resets the digital output channels to 0. This works but it makes the reset function a bit messy and each board type has to be handled special. Move the digital output reset into the subdevice init where it can be handle based on the subdevice setup. Signed-

[PATCH 01/33] staging: comedi: adv_pci_dio: remove unnecessary function separation comments

2015-11-18 Thread H Hartley Sweeten
These are not necessary and just add cruft. Remove them. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c b/drivers/s

[PATCH 31/33] staging: comedi: adv_pci_dio: move pci_dio_override_cardtype()

2015-11-18 Thread H Hartley Sweeten
This function is called as part of the pci_driver (*probe) before doing the (*auto_attach) of the comedi driver. For aesthetics, move the function to a more logical place in the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ad

[PATCH 12/33] staging: comedi: adv_pci_dio: remove defines used for the 'timer_regbase'

2015-11-18 Thread H Hartley Sweeten
These defines are only used to initialize the 'timer_regbase' boardinfo. For aesthetics, just open-code the values and remove the defines. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 6 ++ 1 file changed, 2 inser

[PATCH 03/33] staging: comedi: adv_pci_dio: remove 'main_pci_region' boardinfo

2015-11-18 Thread H Hartley Sweeten
All the boards use PCI BAR2 for the dev->iobase except for the pci1736 which uses PCI BAR0. Just use the board->cardtype to determine which PCI BAR to use. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 30 +++--

[PATCH 18/33] staging: comedi: adv_pci_dio: remove defines used for the dio (8255) registers

2015-11-18 Thread H Hartley Sweeten
These defines are only used to initialize the diosubd_data 'addr' members in the boardinfo. For aesthetics, just open-code the values and remove the defines. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 14 +--

[PATCH 19/33] staging: comedi: adv_pci_dio: use a default case in pci_dio_reset()

2015-11-18 Thread H Hartley Sweeten
For aesthetics, use a default case in the switch (board->cardtype) used to reset the various boards. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --gi

[PATCH 30/33] staging: comedi: adv_pci_dio: move and rename the MAX_*_SUBDEV[SG] defines

2015-11-18 Thread H Hartley Sweeten
For aesthetics, move these defines after the register defines and rename them to have namespace associated with the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/adv_pci_dio.c | 22 +++--- 1 file changed, 11 in

Re: [PATCH] staging: media: bcm2048: fix brace coding style issue in radio-bcm2048.c

2015-11-18 Thread Greg KH
On Wed, Nov 18, 2015 at 09:25:22PM +0530, Jitendra Kumar Khasdev wrote: > This is a patch to the radio-bcm2048.c file that fixes up a brace warning > found by the checkpatch.pl tool. > > Signed-off-by: Jitendra Kumar Khasdev > --- > drivers/staging/media/bcm2048/radio-bcm2048.c | 4 ++-- > 1 fil

Re: linux-4.4-rc1/drivers/staging/rts5208/sd.c:4170: bad if test ?

2015-11-18 Thread Greg Kroah-Hartman
On Wed, Nov 18, 2015 at 08:53:51AM +, David Binderman wrote: > hello there, > > [linux-4.4-rc1/drivers/staging/rts5208/sd.c:4170]: (style) Expression '(X & > 0x1e) != 0x3' is always true. > > Source code is > >   if ((ptr[3] & 0x1E) != 0x03) { > > Suggest code rework. Great, please send a

Re: linux-4.4-rc1/drivers/staging/rts5208/sd.c:4170: bad if test ?

2015-11-18 Thread Greg Kroah-Hartman
On Wed, Nov 18, 2015 at 05:25:38PM +, David Binderman wrote: > Hello there Greg, > > > > Date: Wed, 18 Nov 2015 09:14:41 -0800 > > From: gre...@linuxfoundation.org > > To: dcb...@hotmail.com > > CC: de...@driverdev.osuosl.org > > Subject: Re: linux-4.4-

Re: [PATCH] staging: media: bcm2048: fix brace coding style issue in radio-bcm2048.c

2015-11-18 Thread Jitendra
On Wednesday 18 November 2015 10:42 PM, Greg KH wrote: > On Wed, Nov 18, 2015 at 09:25:22PM +0530, Jitendra Kumar Khasdev wrote: >> This is a patch to the radio-bcm2048.c file that fixes up a brace warning >> found by the checkpatch.pl tool. >> >> Signed-off-by: Jitendra Kumar Khasdev >> --- >>

[PATCH 3/8] staging: comedi: make some variables unsigned in comedi_write()

2015-11-18 Thread Ian Abbott
In `comedi_write()`, the `n` and `m` variables are of type `int`. Change them to `unsigned int` as they are used to measure a positive number of bytes. The `count` variable is also of type `int` and holds the returned number of bytes written. Change it to type `ssize_t` to match the function's re

[PATCH 6/8] staging: comedi: return error on "write" if no command set up

2015-11-18 Thread Ian Abbott
The "write" file operation handler, `comedi_write()` returns an error for pretty much any condition that prevents a "write" going ahead. One of the conditions that prevents a "write" going ahead is that no asynchronous command has been set up, but that currently results in a return value of 0 (unl

[PATCH 2/8] staging: comedi: do extra checks for becoming non-busy for "write"

2015-11-18 Thread Ian Abbott
`comedi_write()` is the handler for the "write" file operation for COMEDI devices. It mostly runs without using the main mutex of the COMEDI device, but uses the `attach_lock` rw_semaphore to protect against the COMEDI device becoming "detached". A file object can write data for a COMEDI asynchon

[PATCH 4/8] staging: comedi: avoid bad truncation of a size_t in comedi_write()

2015-11-18 Thread Ian Abbott
At one point in `comedi_write()`, the variable `n` gets assigned to the minimum of the parameter `nbytes` and the amount of writeable buffer space. The way that is done currently is unsafe in the unlikely case that `nbytes` exceeds `UINT_MAX`, so fix it. Signed-off-by: Ian Abbott --- drivers/st

[PATCH 7/8] staging: comedi: simplify returned errors for comedi_write()

2015-11-18 Thread Ian Abbott
In order to perform a "write" file operation, an asynchronous COMEDI command in the "write" direction needs to have been set up by the current file object on the COMEDI "write" subdevice associated with the file object. If there is a "write" subdevice, but a command has not been set up by the file

[PATCH 1/8] staging: comedi: rearrange comedi_write() code

2015-11-18 Thread Ian Abbott
Rearrange the code in `comedi_write()` to reduce the amount of indentation. The code never reiterates the `while` loop once `count` has become non-zero, so we can check that in the `while` condition to save an indentation level. (Note that `nbytes` has been checked to be non-zero before entering

[PATCH 0/8] staging: comedi: some comedi_write() changes

2015-11-18 Thread Ian Abbott
Tidy up the "write" file operation handler, `comedi_write()` a bit and improve the error handling. 1) staging: comedi: rearrange comedi_write() code 2) staging: comedi: do extra checks for becoming non-busy for "write" 3) staging: comedi: make some variables unsigned in comedi_write() 4) staging:

[PATCH 5/8] staging: comedi: allow buffer wraparound in comedi_write()

2015-11-18 Thread Ian Abbott
`comedi_write()` copies data from the user buffer to the acquisition data buffer, which is cyclic, using a single call to `copy_from_user()`. It currently avoids having to deal with wraparound of the cyclic buffer by limiting the amount it copies (and the amount returned to the user). Change it to

  1   2   >