[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZcYvycJ9wXfKIGYg@smile.fi.intel.com>
Date: Fri, 9 Feb 2024 15:59:37 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Kent Gibson <warthog618@...il.com>, Alex Elder <elder@...aro.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
"Paul E . McKenney" <paulmck@...nel.org>,
Wolfram Sang <wsa@...-dreams.de>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v3 19/24] gpio: remove unnecessary checks from
gpiod_to_chip()
On Thu, Feb 08, 2024 at 08:34:56PM +0100, Bartosz Golaszewski wrote:
> On Thu, Feb 8, 2024 at 8:24 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> > On Thu, Feb 08, 2024 at 08:17:14PM +0100, Bartosz Golaszewski wrote:
> > > On Thu, Feb 8, 2024 at 6:39 PM Andy Shevchenko
> > > <andriy.shevchenko@...ux.intel.com> wrote:
> > > > On Thu, Feb 08, 2024 at 10:59:15AM +0100, Bartosz Golaszewski wrote:
..
> > > > > - if (!desc || IS_ERR(desc) || !desc->gdev || !desc->gdev->chip)
> > > > > + if (!desc || IS_ERR(desc))
> > > >
> > > > IS_ERR_OR_NULL()
> > >
> > > Ah, good point. It's a small nit though so I'll fix it when applying
> > > barring some major objections for the rest.
> > >
> > > > > return -EINVAL;
> >
> > thinking more about it, shouldn't we return an actual error to the caller which
> > is in desc?
> >
> > if (!desc)
> > return -EINVAL;
> > if (IS_ERR(desc))
> > return PTR_ERR(desc);
> >
> > ?
>
> Hmm... maybe but that's out of the scope of this series.
Yeah, but just think about it.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists