Commit graph

495769 commits

Author SHA1 Message Date
Matthew Tyler 3f9773a54a staging: lustre: Cleanup cfs_str2mask in libcfs_string.c
- Replace body-less for-loop with while loop
- Use '\0' for null character instead of 0

Signed-off-by: Matthew Tyler <matt.tyler@flashics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:39:32 -08:00
Matthew Tyler 5156647235 staging: lustre: Fix minor style error in libcfs_string.c
Signed-off-by: Matthew Tyler <matt.tyler@flashics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:39:32 -08:00
Al Viro f351bad2b4 lustre: don't use iovec instead of kvec
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:36:11 -08:00
Dean Ancajas 4d4e1eef9a Staging: lustre: obd: Fix a coding style issue
Fixed a brace coding style issue for functions.

Signed-off-by: Dean Michael Ancajas <dbancajas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:30:59 -08:00
Fred Chou ff2bf19e8d staging:lustre:lustre:ptlrpc: fix sparse warnings in lproc_ptlrpc.c
Fixed the below warning in sparse:

drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:184:6:
warning: symbol 'ptlrpc_lprocfs_register' was not declared.
Should it be static?

Signed-off-by: Fred Chou <fred.chou.nd@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:30:59 -08:00
Tristan Lelong 3760489623 staging: lustre: replace static value with define
This patch replace the value '80' used in several files in the lustre source code
with a define LUSTRE_MDT_MAXNAMELEN.

This value is used in 4 different structures as the maximum len for a service name.
According to the comments, these names follow a convention which make it possible
to use the same define for LCS, LSS, LCF, and LSF.

Signed-off-by: Tristan Lelong <tristan@lelong.xyz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:29:31 -08:00
Tristan Lelong e84962e3af staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
This patch fix a sparse warning in lustre sources

warning: incorrect type in argument 1 (different address spaces)
    expected void [noderef] <asn:1>*to
    got char *<noident>

This is done by adding the missing __user attribute on userland pointers inside the LPROC_SEQ_FOPS like macros:
- LPROC_SEQ_FOPS
- LPROC_SEQ_FOPS_RW_TYPE
- LPROC_SEQ_FOPS_WR_ONLY
- LDLM_POOL_PROC_WRITER

The patch also updates all the functions that are used by this macro:
- lprocfs_wr_*
- *_seq_write

as well as some helpers used by the previously modified functions (otherwise fixing the sparse warning add some new ones):
- lprocfs_write_frac_helper
- lprocfs_write_helper
- lprocfs_write_u64_helper

The patch also fixes one __user pointer direct dereference by strncmp in function fld_proc_hash_seq_write.

Signed-off-by: Tristan Lelong <tristan@lelong.xyz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:26:22 -08:00
Brian Vandre 41f53d5739 staging: lustre: fld: fixed symbol was not declared
Fixes the sparse warning:
"warning: symbol 'fld_type_proc_dir' was not declared. Should it be static?"

Also removes initialization to NULL.

Signed-off-by: Brian Vandre <bvandre@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:25:58 -08:00
Austin Kerbow fa2592cdc5 Staging: ft1000-pcmcia: fix else close brace style
Fix the following checkpatch.pl errors

ERROR: else should follow close brace '}'
+                       }
+                       else {

ERROR: else should follow close brace '}'
+                       }
+                       else {

ERROR: else should follow close brace '}'
+                       }
+                       else {

ERROR: else should follow close brace '}'
+       }
+       else {

ERROR: else should follow close brace '}'
+                       }
+                       else {

Signed-off-by: Austin Kerbow <amkerbow@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:22:31 -08:00
Rickard Strandqvist 64ed8f51f9 staging: ft1000: ft1000-usb: ft1000_hw.c: Fix a potential memory leak.
Avoid allocate memory if we will exit the function.

Was found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:22:31 -08:00
Dean Michael Ancajas 0a5470f80c Staging: ft1000: ft1000-pcmcia: Fixed a coding style issue
Fixed a coding style issue for braces.

Signed-off-by: Dean Michael Ancajas <dbancajas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:20:52 -08:00
Rickard Strandqvist f37e90e9a1 staging: gs_fpgaboot: io.c: Remove unused function
Remove the function bitswap() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Reviewed-by: Insop Song <Insop.Song@gainspeed.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:19:52 -08:00
Gustavo A. R. Silva 9b872a74b8 Staging: nvec: Fixed a typo
Fixed a typo in nvec.c file

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:18:33 -08:00
Murilo Opsfelder Araujo 4e8e87162e staging: olpc_dcon: fix sparse symbol not declared warning
This patch gets rid of the following sparse warning:

drivers/staging/olpc_dcon/olpc_dcon.c:787:19: warning: symbol 'dcon_driver' was not declared. Should it be static?

Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:17:10 -08:00
tolga ceylan 88789fabd7 Staging: NetLogic: Coding style correction
Misspelled comment corrected

Signed-off-by: tolga ceylan <tolga.ceylan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:17:10 -08:00
Gustavo A. R. Silva 22b9c2a89f Staging: olpc_dcon: Fixed a typo
Fixed a typo in olpc_dcon_xo_1.c file.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:17:10 -08:00
Mathieu Poirier b6fe6e0608 staging: skein: Fixing single statement macro checkpatch warning
WARNING: Single statement macros should not use a do {} while (0) loop

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by:  Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:05:52 -08:00
Mathieu Poirier 1fab3fde75 staging: skein: Fixing trailing whitespace error
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by:  Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:05:52 -08:00
Alexey Khoroshilov d7312aab23 staging: dgnc: implement proper error handling in dgnc_start()
dgnc_start() ignores errors in class_create() and device_create()
and it does not deallocate resources if dgnc_tty_preinit() fails.

The patch implements proper error handling.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:04:12 -08:00
Gustavo A. R. Silva 1cf3273dfb Staging: octeon-usb: Fixed a typo
Fixed a typo in octeon-hcd.c file

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:00:23 -08:00
Gustavo A. R. Silva f5801a8176 Staging: octeon: Fixed a typo
Fixed a typo in ethernet.c file.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:00:23 -08:00
Jamie Lawler 85fdebc3ed Staging: octeon: Add blank lines after declarations
There are 2 missing blank lines after variable declarations in
octeon/ethernet-rx.c. They have been added per the coding style.

Signed-off-by: Jamie Lawler <jamie.lawler@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 15:00:23 -08:00
Ning Zhou 59215e694f staging: gdm724x: fix line limit coding style issue in gdm_lte.c
This is a patch to fix "WARNING: line over 80 characters" found by
checkpatch.pl in gdm_lte.c.

Signed-off-by: Ning Zhou <zhou.ning.gd@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:57:43 -08:00
Robert Nachlinger 2fc6aa5d74 Staging: gdm724x: fix space before comma coding style issue in gdm_mux.c
This is a patch to the gdm_mux.c file that fixes a space before comma
coding style issue found by the checkpatch.pl tool.

Signed-off-by: Robert Nachlinger <robert.nachlinger@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:56:19 -08:00
Emrys Bayliss 12b79518fb Staging: vt6655: Checkpatch fix: c99 comment headings
This patch fixes some of the following checkpatch.pl errors in mac.h
ERROR: do not use C99 // comments

This patch reformats all single line c99 style comments to the
preferred style.

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:21 -08:00
Emrys Bayliss 0d12e05799 Staging: vt6655: comment headings formatting
This patch makes the formatting of the comments in mac.h more
consistent.

* Where a heading takes up three comment lines it is reduced to one.
* A newline always separates column headings

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:20 -08:00
Emrys Bayliss 19bf265eae Staging: vt6655: Checkpatch fix: lines longer than 80 columns
This patch fixes the following checkpatch.pl errors in mac.h:
WARNING: line over 80 characters

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:20 -08:00
Emrys Bayliss 060b505b83 Staging: vt6655: Checkpatch fix: c99 comments after statements
This patch fixes some c99 errors in mac.h:
ERROR: do not use C99 // comments

All instances where the c99 comment occurs after a statement.

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:20 -08:00
Emrys Bayliss 644848af96 Staging: vt6655: comment after statement formatting
This patch makes the formatting of the comments in mac.h more
consistent.

* Where a comment follows a statement, it is separated by a single
  space.

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:20 -08:00
Emrys Bayliss 818b555760 Staging: vt6655: Checkpatch fix: empty c99 comments
This patch fixes some of the following checkpatch.pl errors in mac.h:
ERROR: do not use C99 // comments

This patch truncates statements which are followed by empty c99
comments.

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:49:35 -08:00
Emrys Bayliss b5aa3f17ef Staging: vt6655: Checkpatch fix: unnecessary whitespace
This patch fixes the following checkpatch.pl errors in mac.h:
ERROR: space prohibited before that ',' (ctx:WxW)

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:49:35 -08:00
Gustavo A. R. Silva 53d484b18f Staging: comedi: kcomedilib: Fixed a typo
Fixed a typo in kcomedilib_main.c file.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:33:24 -08:00
H Hartley Sweeten a7f0ce8e5d staging: comedi: pcl812: use common function to setup dma
The pcl812_ai_setup_dma() and pcl812_ai_setup_next_dma() functions are similar
other than the buffer switch and the inclusion of the "unread_samples" in
pcl818_ai_setup_next_dma() when calculating the dma size.

Merge these two functions by initializing the 'dma->cur_dma' in the callers
and passing '0' for the "unread_samples" when first starting the DMA.

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>
2015-01-17 14:32:56 -08:00
H Hartley Sweeten 92afc2b229 staging: comedi: pcl812: simplify the dma->size calculations
The dma->size calculations are overly complicated in this driver and the
'prealloc_bufsz' sanity checks are unnecessary.

Currently this driver determines the number of DMA "runs" needed and the size
of the "last" DMA transfer in order to perform a command. As long as there are
more "runs" required, the dma->size is set to the buffer maxsize. On the last
"run" the buffer is set to the "last" size.

Refactor the driver to use the comedi core helpers to determine the DMA size
based on the buffer maxsize and the number of samples remaining in the command.

This allows removing the 'dma_runs_to_end' and 'last_dma_run' mamebers 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>
2015-01-17 14:32:56 -08:00
H Hartley Sweeten 93e6045236 staging: comedi: pcl816: use common function to setup dma
THe pcl816_ai_setup_dma() and pcl816_ai_setup_next_dma() functions are similar
other than the buffer switch and the inclusion of the "unread_samples" in
pcl818_ai_setup_next_dma() when calculating the dma size.

Merge these two functions by initializing the 'dma->cur_dma' in the callers
and passing '0' for the "unread_samples" when first starting the DMA.

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>
2015-01-17 14:32:56 -08:00
H Hartley Sweeten fe4a22a009 staging: comedi: pcl816: simplify the dma->size calculations
Currently this driver determines the number of DMA "runs" needed and the size
of the "last" DMA transfer in order to perform a command. As long as there are
more "runs" required, the dma->size is set to the buffer maxsize. On the last
"run" the buffer is set to the "last" size.

Refactor the driver to use the comedi core helpers to determine the DMA size
based on the buffer maxsize and the number of samples remaining in the command.

This allows removing the 'dma_runs_to_end' and 'last_dma_run' mamebers 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>
2015-01-17 14:32:56 -08:00
H Hartley Sweeten 421f1b6832 staging: comedi: pcl818: use common function to setup dma
THe pcl818_ai_setup_dma() and pcl818_ai_setup_next_dma() functions are similar
other than the buffer switch and the inclusion of the "unread_samples" in
pcl818_ai_setup_next_dma() when calculating the dma size.

Merge these two functions by initializing the 'dma->cur_dma' in the callers
and passing '0' for the "unread_samples" when first starting the DMA.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten 296e3f1816 staging: comedi: pcl818: simplify the dma->size calculations
Currently this driver determines the number of DMA "runs" needed and the size
of the "last" DMA transfer in order to perform a command. As long as there are
more "runs" required, the dma->size is set to the buffer maxsize. On the last
"run" the buffer is set to the "last" size.

Refactor the driver to use the comedi core helpers to determine the DMA size
based on the buffer maxsize and the number of samples remaining in the command.

This allows removing the 'dma_runs_to_end' and 'last_dma_run' mamebers from
the private data. Also remove the 'ai_data_len' member which is set but never
used.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten cf0438c9c3 staging: comedi: ni_labpc_isadma: use comedi_isdma module
The labpc driver has already had the depends on ISA_DMA_API limitation removed
by moving all the DMA support code into the labpc_isadma module.

For aesthetics, use the comedi_isadma module to provide the actual ISA DMA
support.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten 1a97f144e3 staging: comedi: ni_at_a2150: remove depends on ISA_DMA_API limitation
Use the new comedi_isadma module to provide the ISA DMA support. This removes
all the ISA_DMA_API code from this driver and allows the driver to be used on
platforms that don't support the ISA_DMA_API.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten 860f7c0919 staging: comedi: dt282x: remove depends on ISA_DMA_API limitation
Use the new comedi_isadma module to provide the ISA DMA support. This removes
all the ISA_DMA_API code from this driver and allows the driver to be used on
platforms that don't support the ISA_DMA_API.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten 99dfc3357e staging: comedi: das1800: remove depends on ISA_DMA_API limitation
Use the new comedi_isadma module to provide the ISA DMA support. This removes
all the ISA_DMA_API code from this driver and allows the driver to be used on
platforms that don't support the ISA_DMA_API.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten 1400964a2b staging: comedi: das16: remove depends on ISA_DMA_API limitation
Use the new comedi_isadma module to provide the ISA DMA support. This removes
all the ISA_DMA_API code from this driver and allows the driver to be used on
platforms that don't support the ISA_DMA_API.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten f3df482a0c staging: comedi: pcl812: remove depends on ISA_DMA_API limitation
Use the new comedi_isadma module to provide the ISA DMA support. This removes
all the ISA_DMA_API code from this driver and allows the driver to be used on
platforms that don't support the ISA_DMA_API.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten bd7ea421e3 staging: comedi: pcl816: remove depends on ISA_DMA_API limitation
Use the new comedi_isadma module to provide the ISA DMA support. This removes
all the ISA_DMA_API code from this driver and allows the driver to be used on
platforms that don't support the ISA_DMA_API.

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>
2015-01-17 14:32:55 -08:00
H Hartley Sweeten dd7c0f0416 staging: comedi: pcl818: remove depends on ISA_DMA_API limitation
Use the new comedi_isadma module to provide the ISA DMA support. This removes
all the ISA_DMA_API code from this driver and allows the driver to be used on
platforms that don't support the ISA_DMA_API.

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>
2015-01-17 14:32:54 -08:00
H Hartley Sweeten 20a1ea7d6b staging: comedi: comedi_isadma: introduce helper module for ISA DMA
Introduce a new helper module to consolidate all the ISA DMA code. This will
allow removing the "depends on ISA_DMA_API" from the legacy drivers that can
use DMA for async command support.

This module is complete based on the various uses of ISA DMA in the comedi
drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:32:54 -08:00
H Hartley Sweeten 5e5a21cf8e staging: comedi: das1800: tidy up das1800_ai_transfer_size()
For aesthetics, pass the fill time 'ns' as a parameter to this function.

Refactor this function to calculate the transfer size in 'samples' instead
of 'bytes'. This removes the need to constantly multiply the values by the
'sample_size'. It also helps avoid any possible integer overflow issues.

Use the comedi_nsamples_left() helper to limit the samples when cmd->stop_src
is TRIG_COUNT.

Use comedi_samples_to_bytes() to return the final DMA size in bytes.

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>
2015-01-17 14:31:31 -08:00
H Hartley Sweeten 620ec185a2 staging: comedi: das1800: remove hard coded 'sample_size'
Use the comedi_bytes_per_sample() helper to remove the hard coded sample_size
in suggest_transfer_size().

The helper function needs to comedi_subdevice pointer. Change the parameters
passed to suggest_transfer_size() and setup_dma() so that this pointer is
available. Rename these functions so they have namespace associated with the
driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:31:31 -08:00
H Hartley Sweeten 0afa6153fb staging: comedi: ni_labpc_isadma: introduce labpc_isadma_program()
Introduce a helper function to program the ISA DMA controller. Program
the ISA DMA as described in Documentation/DMA-ISA-LPC.txt.

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>
2015-01-17 14:31:31 -08:00