From: Greg KH <gregkh@linuxfoundation.org>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 5/6] staging: comedi: drivers: dt282x: Merge if conditions
Date: Thu, 11 Feb 2016 19:44:55 -0800 [thread overview]
Message-ID: <20160212034455.GD12182@kroah.com> (raw)
In-Reply-To: <20160210085934.GA14640@amitoj-Inspiron-3542>
On Wed, Feb 10, 2016 at 02:29:34PM +0530, Amitoj Kaur Chawla wrote:
> Merge if conditions with the same statements.
>
> Found using Coccinelle. The semantic patch used to find this is as
> follows:
>
> //<smpl>
> @@
> statement S;
> expression e,x;
> @@
>
> * if(e)
> (
> { ... return ...; }
> &
> S
> )
>
> * if(x)
> (
> { ... return ...; }
> &
> S
> )
> //</smpl>
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
> drivers/staging/comedi/drivers/dt282x.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c
> index 5a536a0..ded985e 100644
> --- a/drivers/staging/comedi/drivers/dt282x.c
> +++ b/drivers/staging/comedi/drivers/dt282x.c
> @@ -887,10 +887,7 @@ static int dt282x_ao_inttrig(struct comedi_device *dev,
> if (trig_num != cmd->start_src)
> return -EINVAL;
>
> - if (!dt282x_ao_setup_dma(dev, s, 0))
> - return -EPIPE;
> -
> - if (!dt282x_ao_setup_dma(dev, s, 1))
> + if (!(dt282x_ao_setup_dma(dev, s, 0) && dt282x_ao_setup_dma(dev, s, 1)))
> return -EPIPE;
Still not going to take this, sorry.
greg k-h
prev parent reply other threads:[~2016-02-12 3:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-10 8:59 [PATCH 5/6] staging: comedi: drivers: dt282x: Merge if conditions Amitoj Kaur Chawla
2016-02-12 3:44 ` Greg KH [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=20160212034455.GD12182@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=amitoj1606@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.