public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCHv2] adp1653: check error code of adp1653_init_controls
Date: Fri, 29 Jul 2011 10:10:03 +0300	[thread overview]
Message-ID: <1311923232.3903.45.camel@smile> (raw)
In-Reply-To: <201107281634.24288.laurent.pinchart@ideasonboard.com>

On Thu, 2011-07-28 at 16:34 +0200, Laurent Pinchart wrote: 
> > -	adp1653_init_controls(flash);
> > +	ret = adp1653_init_controls(flash);
> > +	if (ret)
> > +		goto free_and_quit;
> > 
> >  	ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0);
> >  	if (ret < 0)
> > -		kfree(flash);
> > +		goto free_and_quit;
> > 
> > +	return 0;
> > +
> > +free_and_quit:
> > +	v4l2_ctrl_handler_free(&flash->ctrls);
> > +	kfree(flash);
> >  	return ret;

> What about
>         ret = adp1653_init_controls(flash);
>         if (ret)
>                 goto done;
> 
>         ret = media_entity_init(&flash->subdev.entity, 0, NULL, 0);
> 
> done:
>         if (ret < 0) {
>                 v4l2_ctrl_handler_free(&flash->ctrls);
>                 kfree(flash);
>         }
> 
>         return ret;
There is no difference at first glance. However, your variant is less
straight to understand for my opinion.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

      reply	other threads:[~2011-07-29  7:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27  7:58 [PATCH] adp1653: check error code of adp1653_init_controls Andy Shevchenko
2011-07-27  8:15 ` Sakari Ailus
2011-07-28  7:55   ` Andy Shevchenko
2011-07-28  7:59   ` [PATCHv2] " Andy Shevchenko
2011-07-28 14:34     ` Laurent Pinchart
2011-07-29  7:10       ` Andy Shevchenko [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=1311923232.3903.45.camel@smile \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=laurent.pinchart@ideasonboard.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox