[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z_PXDjfVBBvZKf5i@smile.fi.intel.com>
Date: Mon, 7 Apr 2025 16:45:50 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH v1 1/1] gpiolib: Make gpiod_put() error pointer aware
On Mon, Apr 07, 2025 at 02:49:27PM +0200, Bartosz Golaszewski wrote:
> On Thu, Apr 3, 2025 at 3:22 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
...
> I explained why I believe this change is wrong and I will allow myself
> to not accept it unless Linus is very positively in favor.
I am on the opposite site. With all burden on the users' shoulders...
And your _any deinit_ function example is wrong. This is not a deinit case,
this is resource allocation / reservation / etc and freeing it. Freeing
invalid resource is bad, freeing an optional resource, or resource which
has never been allocated — is okay. It makes device driver developer's life
easier. And many kernel APIs are written in that form. Since you again
pointed out that gpiod_get() is annotated, there is very unlikely somebody
deliberately will ignore those errors.
P.S.
I will continue insisting that this is an inconvenience (or bug) in gpiod_put().
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists