mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Nicholas Mc Guire <hofrat@osadl.org>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: comedi: dt282x: condition with no effect - if identical to else
Date: Wed, 04 Feb 2015 17:48:28 +0000	[thread overview]
Message-ID: <54D25B6C.6050406@mev.co.uk> (raw)
In-Reply-To: <1423069354-12689-1-git-send-email-hofrat@osadl.org>

On 04/02/15 17:02, 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>
> ---
>
> v2: Review notes from Ian Abbott <abbotti@mev.co.uk> and Hartley Sweeten
>      <HartleyS@visionengravers.com> confirm that the condition is not
>      needed and, as suggested, the misleading comment is completely removed.
>
> Patch was only compile tested for x86_64_defconfig + CONFIG_STAGING=y
> CONFIG_COMEDI=m, COMEDI_ISA_DRIVERS=y, CONFIG_COMEDI_DT282X=m
>
> Patch is against 3.19.0-rc7 (localversion = -next-20150204)
>
>   drivers/staging/comedi/drivers/dt282x.c |    9 +--------
>   1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c
> index 051dfb2..db21d21 100644
> --- a/drivers/staging/comedi/drivers/dt282x.c
> +++ b/drivers/staging/comedi/drivers/dt282x.c
> @@ -685,14 +685,7 @@ static int dt282x_ai_cmdtest(struct comedi_device *dev,
>
>   	err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
>
> -	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);
> -	}
> +	err |= cfc_check_trigger_arg_is(&cmd->scan_begin_arg, 0);
>
>   	err |= cfc_check_trigger_arg_min(&cmd->convert_arg, 4000);
>
>

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

      reply	other threads:[~2015-02-04 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 17:02 Nicholas Mc Guire
2015-02-04 17:48 ` Ian Abbott [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=54D25B6C.6050406@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hofrat@osadl.org \
    --cc=hsweeten@visionengravers.com \
    --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

all inboxes | Powered by JetHome®