From: Nicholas Mc Guire <der.herr@hofr.at>
To: Hartley Sweeten <HartleyS@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>,
Nicholas Mc Guire <hofrat@osadl.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC] staging: comedi: dt282x: condition with no effect - if identical to else
Date: Wed, 4 Feb 2015 17:40:32 +0100 [thread overview]
Message-ID: <20150204164032.GA22025@opentech.at> (raw)
In-Reply-To: <DC148C5AA1CEBA4E87973D432B1C2D882610260C@P3PWEX4MB008.ex4.secureserver.net>
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@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
prev parent reply other threads:[~2015-02-04 16:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 12:38 [PATCH RFC] staging: comedi: dt282x: condition with no effect - if identical to else Nicholas Mc Guire
2015-02-03 15:12 ` Ian Abbott
2015-02-03 20:04 ` Nicholas Mc Guire
2015-02-04 16:19 ` Hartley Sweeten
2015-02-04 16:40 ` Nicholas Mc Guire [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150204164032.GA22025@opentech.at \
--to=der.herr@hofr.at \
--cc=HartleyS@visionengravers.com \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hofrat@osadl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox