Kernel-Janitors Archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bingbu Cao <bingbu.cao@intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Daniel Scally <dan.scally@ideasonboard.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] media: ipu-bridge: fix error code in ipu_bridge_init()
Date: Fri, 10 May 2024 18:42:46 +0300	[thread overview]
Message-ID: <57a0dfae-cf1b-4c98-bc54-e70e722adf99@moroto.mountain> (raw)
In-Reply-To: <Zj4_BBsUYuAeiOpr@smile.fi.intel.com>

On Fri, May 10, 2024 at 06:36:36PM +0300, Andy Shevchenko wrote:
> On Fri, May 10, 2024 at 06:27:30PM +0300, Dan Carpenter wrote:
> > On Fri, May 10, 2024 at 06:18:22PM +0300, Andy Shevchenko wrote:
> > > On Fri, May 10, 2024 at 06:10:37PM +0300, Dan Carpenter wrote:
> > > > Return -EINVAL if "bridge->n_sensors == 0".  Don't return success.
> 
> ...
> 
> > > >  	ret = ipu_bridge_connect_sensors(bridge);
> > > > -	if (ret || bridge->n_sensors == 0)
> > > > +	if (ret || bridge->n_sensors == 0) {
> > > > +		ret = ret ?: -EINVAL;
> > > >  		goto err_unregister_ipu;
> > > > +	}
> > > 
> > > I would split:
> > > 
> > > 	ret = ipu_bridge_connect_sensors(bridge);
> > > 	if (ret)
> > > 		goto err_unregister_ipu;
> > > 
> > > 	if (bridge->n_sensors == 0) {
> > > 		ret = -EINVAL;
> > > 		goto err_unregister_ipu;
> > > 	}
> > 
> > It's always hard to know which way to go on these...  I wrote it that
> > way in my first draft.  It's my prefered way as well but not everyone
> > agrees.  I'll resend.
> 
> Is the generated assembly the same?

Yeah, it does.

regards,
dan carpenter



      reply	other threads:[~2024-05-10 15:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 15:10 [PATCH] media: ipu-bridge: fix error code in ipu_bridge_init() Dan Carpenter
2024-05-10 15:18 ` Andy Shevchenko
2024-05-10 15:27   ` Dan Carpenter
2024-05-10 15:36     ` Andy Shevchenko
2024-05-10 15:42       ` Dan Carpenter [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=57a0dfae-cf1b-4c98-bc54-e70e722adf99@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=hdegoede@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).