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

Nicholas Mc Guire der.herr at hofr.at
Wed Feb 4 16:40:32 UTC 2015


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 at osadl.org>
> >> ---
> >>
> >> 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
 


More information about the devel mailing list