Re: [PATCH RFC] staging: comedi: dt282x: condition with no effect - if identical to else

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 04 Feb 2015, Hartley Sweeten wrote:

> On Tuesday, February 03, 2015 8:13 AM, Ian Abbott wrote:
> > On 03/02/15 12:38, Nicholas Mc Guire wrote:
> >> The if and the else branch code are identical - so the condition has no
> >> effect on the effective code - this patch removes the condition and the
> >> duplicated code.
> >>
> >> Signed-off-by: Nicholas Mc Guire <hofrat@xxxxxxxxx>
> >> ---
> >>
> >> The if and else branch are identical code thus the condition has no effect
> >>
> >>      if (cmd->scan_begin_src == TRIG_FOLLOW) {
> >>              /* internal trigger */
> >>              err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
> >>      } else {
> >>              /* external trigger */
> >>              /* should be level/edge, hi/lo specification here */
> >>              err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
> >>      }
> >>
> > I think what that comment means is that it should allow scan_begin_arg 
> > to have various combinations of the CR_EDGE and CR_INVERT bits set. 
> > I.e. it ought to allow whatever combination of CR_EDGE and CR_INVERT 
> > better describes the nature of the external trigger signal, in addition 
> > to allowing the lazy default value 0.
> >
> > I don't know what the nature of the external trigger signal is, as I 
> > haven't seen the manual.  I think Hartley might have seen one.
> 
> According to the manual, the external trigger is not "programmable". It's
> a Schmitt trigger input, enables on TTL logic low, with a 22K pullup.
> 
> Since the 'scan_begin_arg' is not actually used for the analog input async
> command, I think removing the comments completely is fine. Just change
> the check to:
> 
> 	err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
>

thanks for that clarification - will fix it up and resend.

thx!
hofrat
 
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux