diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2015-10-19 20:13:05 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-25 02:17:13 (GMT) |
commit | eb96c7fc24fb89d7e3382260e1b391c05895cfa6 (patch) | |
tree | 405279629145bafad8b318a6832e6a52aa214bc6 /drivers/staging/Makefile | |
parent | 45037a9569183b49a9c9cf9faea294228c3963d2 (diff) | |
download | linux-eb96c7fc24fb89d7e3382260e1b391c05895cfa6.tar.xz |
staging: comedi: adl_pci9118: tidy up pci9118_ai_setup_dma()
For aesthetics, init the dmalen[01] local variables when they are declared.
Use a local variable, 'scan_bytes', for the (devpriv->ai_n_realscanlen << 1)
calculation. For aesthetics and clarification, use comedi_bytes_per_sample()
instead of the '<< 1' shift to calculate the value.
The local variable 'i' is badly named. Remove it and use a local variable
'tmp' where it is used.
When checking the DMA buffer lengths for non-neverending commands the
scan length calculation, (devpriv->ai_n_realscanlen << 1) * cmd->stop_arg,
could overflow. Use and unsigned long long local variable to hold the
calculation and avoid the overflow.
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>
Diffstat (limited to 'drivers/staging/Makefile')
0 files changed, 0 insertions, 0 deletions