- 25 Apr, 2014 9 commits
-
-
H Hartley Sweeten authored
This test is unnecessary. It covers all the possible combinations of the scan_end_src and stop_src triggers so the final else can never be reached. 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>
-
H Hartley Sweeten authored
This test is unnecessary. The cfc_check_trigger_src() in Step 1 ensures that the trigger source is one of these values and Step 2 makes sure it's only one of these values. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
This step of the (*do_cmdtest) verifies that the selected trigger sources are mutually compatible. For this driver the scan_begin_src must be TRIG_FOLLOW or the same source as the convert_src. Simplify the logic to clarify this. 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>
-
Monam Agarwal authored
This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL) The rcu_assign_pointer() ensures that the initialization of a structure is carried out before storing a pointer to that structure. And in the case of the NULL pointer, there is no structure to initialize. So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL) Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dominique van den Broeck authored
Style-only modifications to make checkpatch.pl --file --strict a bit happier. Removing FSF postal address from file top comment since it has changed in the past, as stated by checkpatch.pl. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dominique van den Broeck authored
Style-only modifications to make checkpatch.pl --file --strict a bit happier. Removed useless "extern" in dma_fifo.h ; Removed one supernumerary space. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dominique van den Broeck authored
Style-only modifications to make checkpatch.pl --file --strict a bit happier. if/else bracket matching (either none or both options should be bracketed). Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dominique van den Broeck authored
Style-only modifications to make checkpatch.pl --file --strict a bit happier. Open parenthesis alignments. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Greg Kroah-Hartman authored
It never really got cleaned up properly, and no one is working on it, so remove it. If someone wants to pick it up, this can be easily reverted. Cc: Krzysztof Halasa <khc@pm.waw.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 22 Apr, 2014 31 commits
-
-
H Hartley Sweeten authored
Clarify the cmd->start_arg validation in Step 3 of the (*do_cmdtest) functions. For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is used by the async (*inttrig) callbacks. Refactor the (*inttrig) functions so that the cmd->start_arg is used to check the trig_num instead of the open coded values. For aesthetics, refactor the (*do_cmd) functions to use if/else instead of the switch to handle the cmd->start_src. 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>
-
H Hartley Sweeten authored
For all cmd->start_src values this driver trivially validates that the cmd->start_arg is 0. For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is used by the async (*inttrig) callback. Refactor the (*inttrig) functions so that the cmd->start_arg is used to check the trig_num instead of the open coded values. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
This driver supports cmd->start_src values of TRIG_NOW, TRIG_EXT, and TRIG_INT. Currently the cmd->start_arg is only validated for TRIG_NOW. For TRIG_EXT sources, the cmd->start_src is driver specific. For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is used by the async (*inttrig) callback. The cmd->start_arg is currently not use in the driver. Just trivially validate it to be 0 for all cmd->start_src values. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. For aesthetics, remove some unnecessary comments in the (*do_cmd) function. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
For both ai and ao commands this driver supports a cmd->start_src of TRIG_NOW or TRIG_INT. The cmd->start_arg is trivially validated for both sources to be 0. For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is used by the async (*inttrig) callback. Refactor the (*inttrig) functions so that the cmd->start_arg is used to check the trig_num instead of the open coded values. For aesthetics, remove some unnecessary comments in the (*do_cmd) functions. 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>
-
H Hartley Sweeten authored
This driver supports a cmd->start_src of TRIG_NOW, TRIG_INT or TRIG_EXT. Clarify the cmd->start_arg validation in Step 3 of the (*do_cmdtest). For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is used by the async (*inttrig) callback. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
This driver supports a cmd->start_src of TRIG_NOW or TRIG_INT. The cmd->start_arg is trivially validated for both sources to be 0. For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is used by the async (*inttrig) callback. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. For aesthetics, refactor the (*do_cmd) to use if/else instead if the switch when handling the cmd->start_src. 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>
-
H Hartley Sweeten authored
This driver supports a cmd->start_src of TRIG_NOW or TRIG_INT. The cmd->start_arg is trivially validated for both sources to be 0. For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is used by the async (*inttrig) callback. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. For aesthetics, refactor the (*do_cmd) to use if/else instead if the switch when handling the cmd->start_src. 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>
-
H Hartley Sweeten authored
This driver supports cmd->start_src sources of TRIG_NOW and TRIG_EXT. Refactor the (*do_cmdtest) to clarify the trivial validation of the cmd->start_arg. This also fixes a bug, the cmd->start_src has the trigger not the cmd->start_arg. 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>
-
H Hartley Sweeten authored
This driver supportes cmd->start_src sources of TRIG_NOW, TRIG_INT, TRIG_OTHER, and TRIG_EXT. Refactor the (*do_cmdtest) to clarify the trivial validation of the cmd->start_arg. For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is passed to the async (*inttrig) callback. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
This driver only a cmd->start_src of TRIG_NOW or TRIG_INT. The cmd->start_arg is trivially validated for both sources to be 0. For a TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is passed to the async (*inttrig) callback. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
The cmd->start_arg should be trivially validated in Step 3 of the (*do_cmdtest) functions. Add the necessary 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>
-
H Hartley Sweeten authored
The cmd->start_arg should be trivially validated in Step 3 of the (*do_cmdtest) functions. Add the necessary 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>
-
H Hartley Sweeten authored
This driver only supports a cmd->start_src of TRIG_INT for ao commands. The cmd->start_arg is trivially validated to be 0. For TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is passed to the async (*inttrig) callback. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
The cmd->start_arg should be trivially validated in Step 3 of the (*do_cmdtest) functions. Add the necessary code. For the analog output, a cmd->start_src of TRIG_NOW and TRIG_INT is supported. For both sources the cmd->start_arg is validated to be 0. For a TRIG_INT source, the cmd->start_Arg is actually the valid trig_num that is passed to the async (*inttrig) callback. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
This driver only supports a cmd->start_src of TRIG_INT for ai commands. The cmd->start_arg is trivially validated to be 0. For TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is passed to the async (*inttrig) callback. Refactor the (*inttrig) function so that the cmd->start_arg is used to check the trig_num instead of the open coded value. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
H Hartley Sweeten authored
This driver supports two cmd->start_src values, TRIG_NOW and TRIG_EXT. For aesthetics, replace the default case when validating the cmd->start_arg with the proper case statement. 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>
-
H Hartley Sweeten authored
This driver trivially validates the cmd->start_arg for all cmd->start_src values to be 0. For TRIG_INT source, the cmd->start_arg is actually the valid trig_num that is passed to the async (*inttrig) callback. Refactor the (*inttrig) functions so that the cmd->start_arg is used to check the trig_num instead of the open coded values. For aesthetics, refactor the ai (*do_cmd) to remove some unnecessary {}. 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>
-
H Hartley Sweeten authored
This driver supports two cmd->start_src values, TRIG_INT and TRIG_EXT. For TRIG_INT sources, the cmd->start_arg is actually the valid trig_num that is passed to the async (*inttrig) callback. This driver trivially validates the arg for this source to be 0. Refactor the (*inttrig) so that the cmd->start_arg is used to check the trig_num instead of the open coded value. For aesthetics, refactor the (*do_cmd) to use if/else instead of the switch when handling the cmd->start_src. All code paths do the spin lock/unlock so move those out of the if/else. 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>
-
H Hartley Sweeten authored
This driver supports two cmd->start_src values, TRIG_NOW and TRIG_INT. TRIG_NOW sources should always have an arg of 0. For TRIG_INT sources, the cmd->start_arg is actually the valid trig_num that is passed to the async (*inttrig) callback. This driver trivially validates the arg for both sources to be 0. Refactor the (*inttrig) so that the cmd->start_arg is used to check the trig_num instead of the open coded value. For aesthetics, refactor the (*do_cmd) to use if/else instead of the switch when handling the cmd->start_src. 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>
-
H Hartley Sweeten authored
This driver supports three cmd->start_src values, TRIG_NOW, TRIG_EXT, and TRIG_INT. TRIG_NOW sources should always have an arg of 0 and arg for TRIG_EXT sources is driver specific. This driver does not use the cmd->start_arg with the TRIG_EXT source so a trivial value of 0 is good. When the cmd->start_src is TRIG_INT the cmd->start_arg is actually the valid trig_num that is passed to the async (*inttrig) callback. This driver allows any value to be used and currently carries that value in the private data. Refactor the (*do_cmdtest) so that the trivial validation of the cmd->start_arg is clear. Refactor the (*inttrig) so that the cmd->start_arg is used directly to check the trig_num and remove the then unused 'ai_inttrig_start' member from 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>
-
H Hartley Sweeten authored
The async command 'arguments' should be trivially validated in Step 3 of the (*do_cmdtest) not Step 2b. Move the validataion in this driver to the proper place. This driver supports two cmd->start_src values, TRIG_NOW and TRIG_EXT. TRIG_NOW sources should always have an arg of 0. The arg for TRIG_EXT sources is driver specific. Properly validate the cmd->start_arg based on the cmd->start_src. Remove the noise when the arg is invalid and modify the cmd->start_arg so that a valid value is returned to the user. 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>
-
H Hartley Sweeten authored
The comedi_subdevices array is kzalloc()'d so the async command callbacks do not need to be set to NULL when the analog output subdevice is initialized. Also, remove the initialzation of the subdevice 'len_chanlist' since this value is only used by the async commands. The core will default it to 1. 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>
-
H Hartley Sweeten authored
For aesthetics, rename the local variable 'error' to 'err'. This is the normal name for this local variable in (*do_cmdtest) functions. 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>
-
H Hartley Sweeten authored
Due to a driver limitation, the (*do_cmdtest) for the analog input subdevice overrides the cmd->chanlist_len to force single channel chanlists. But, the cmd->scan_end_arg was already validated before this happens. Instead of fixing the (*do_cmdtest) just set the subdevice len_chanlist to 1 to limit the chanlist size. Move the comment also. 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>
-
H Hartley Sweeten authored
When the async command 'scan_end_src' is TRIG_COUNT the 'scan_end_arg' is the cmd->chanlist_len. Fix a couple open-coded drivers. Add the check to the drivers that do not validate this command argument. The core validates that the cmd->chanlist_len is <= s->len_chanlist. During the post config after the attach the core also make sure that the s->len_chanlist is initialized. For clarity, initialize the s->len_chanlist in a couple drivers that are relying on the core to initialize it to '1'. 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>
-
H Hartley Sweeten authored
The comedi core checks if the (cmd->chanlist_len > s->len_chanlist) when the comedi_cmd is copied from user to kernel space by __comedi_get_user_cmd(). If so, the core returns -EINVAL and will not call the subdevice (*do_cmdtest) and (*do_cmd). Remove the unnecessary "max" checks in the comedi driver (*do_cmdtest) and helper functions. 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>
-
H Hartley Sweeten authored
The labpc_ai_chanlist_invalid() function validates that the cmd->chanlist is compatible with the hardware. This is step 5 of the (*do_cmdtest). For aesthetics, rename this function and tidy up the code. To minimize the noise, change the comedi_error(), which is a wrapper around dev_err(), to dev_dbg(). 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>
-
H Hartley Sweeten authored
The ai_check_chanlist() function validates that the cmd->chanlist is compatible with the hardware. This is step 5 of the (*do_cmdtest). For aesthetics, rename this function so it has namespace associated with the driver and tidy up the code. To minimize the noise, change the dev_err() to dev_dbg(). 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>
-
H Hartley Sweeten authored
Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible with the hardware. Remove the unnecessary step 5 code in the analog output async command support. For aesthetics, factor out the step 5 code for the "cdio" async command support. Tidy up the factored out 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>
-
H Hartley Sweeten authored
Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible with the hardware. For aesthetics, factor out the step 5 code for the analog input async command support. Tidy up the factored out code. To minimize the noise, change the comedi_error(), which is a wrapper around dev_err(), to dev_dbg(). 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>
-
H Hartley Sweeten authored
Step 5 of the (*do_cmdtest) validates that the cmd->chanlist is compatible with the hardware. For aesthetics, factor out the step 5 code for the async command support. Tidy up the factored out code. To minimize the noise, change the dev_err() to dev_dbg(). 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>
-