]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: ni_tiocmd: tidy up ni_tio_input_cmd()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 28 Jul 2014 17:27:03 +0000 (10:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jul 2014 23:51:01 +0000 (16:51 -0700)
commit0a297dbe83c31d4c08be4a3a43c1f44a15acf452
treeb8d91a8b1b5b16b54821521d92f268c5a8f4620e
parent18b734e6dbbfa1f66c10e7b207b6345dcfe31cf0
staging: comedi: ni_tiocmd: tidy up ni_tio_input_cmd()

The cmd->start_src is validated in the (*do_cmdtest) before this
function is called. All valid trigger sources are handled so the
default BUG() case can never occure.

For aesthetics, refactor the switch into if/else tests and remove
the BUG().

For aesthetics, rename the local variable 'retval' to simply 'ret'.

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>
drivers/staging/comedi/drivers/ni_tiocmd.c