From: H Hartley Sweeten Date: Thu, 17 Apr 2014 17:07:52 +0000 (-0700) Subject: staging: comedi: adl_pci9118: fix the ai cmd->start_arg validation and use X-Git-Tag: omap-for-v3.16/fixes-against-rc1~39^2~36^2~1334 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01dc2a05f46280f825378be0bee8a2f13ca12c0a;p=pandora-kernel.git staging: comedi: adl_pci9118: fix the ai cmd->start_arg validation and use 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed