All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Varsha Rao <rvarsha016@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	outreachy-kernel@googlegroups.com
Subject: Re: [PATCH] staging: comedi: Compress return logic into one line.
Date: Sun, 12 Mar 2017 14:55:43 +0100	[thread overview]
Message-ID: <20170312135543.GA1209@kroah.com> (raw)
In-Reply-To: <58c53fae.4737620a.4ce3e.692c@mx.google.com>

On Sun, Mar 12, 2017 at 06:01:35PM +0530, Varsha Rao wrote:
> Simplify function return by merging assignment and return into a single
> line. The following coccinelle script is used to fix this issue.
> 
> @@
> expression e,ret;
> @@
> 
> -ret = e;
> -return ret;
> +return e;
> 
> Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
> ---
>  drivers/staging/comedi/drivers.c             | 3 +--
>  drivers/staging/comedi/drivers/cb_pcidas64.c | 8 ++------
>  2 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
> index a5bf2cc..76e399c 100644
> --- a/drivers/staging/comedi/drivers.c
> +++ b/drivers/staging/comedi/drivers.c
> @@ -86,8 +86,7 @@ static void comedi_clear_hw_dev(struct comedi_device *dev)
>   */
>  void *comedi_alloc_devpriv(struct comedi_device *dev, size_t size)
>  {
> -	dev->private = kzalloc(size, GFP_KERNEL);
> -	return dev->private;
> +	return kzalloc(size, GFP_KERNEL);

That broke the driver :(

Please be more careful in your review.

thanks,

greg k-h


  parent reply	other threads:[~2017-03-12 13:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12 12:31 [PATCH] staging: comedi: Compress return logic into one line Varsha Rao
2017-03-12 12:35 ` [Outreachy kernel] " Julia Lawall
2017-03-12 13:53   ` Varsha Rao
2017-03-12 13:55 ` Greg Kroah-Hartman [this message]
2017-03-12 14:07   ` Varsha Rao
2017-03-12 14:35     ` [Outreachy kernel] " Greg KH
2017-03-12 14:35     ` Greg KH

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=20170312135543.GA1209@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=abbotti@mev.co.uk \
    --cc=hsweeten@visionengravers.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=rvarsha016@gmail.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.