public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v1 1/1] gpiolib: Make gpiod_put() error pointer aware
Date: Mon, 7 Apr 2025 16:45:50 +0300	[thread overview]
Message-ID: <Z_PXDjfVBBvZKf5i@smile.fi.intel.com> (raw)
In-Reply-To: <CAMRc=Md0gD=XPEkb=C6JJcRvDpBbcJb5Xv8fE-v94iT=COHw7A@mail.gmail.com>

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@linux.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



  reply	other threads:[~2025-04-07 13:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02 15:20 [PATCH v1 1/1] gpiolib: Make gpiod_put() error pointer aware Andy Shevchenko
2025-04-03  6:58 ` Bartosz Golaszewski
2025-04-03  8:04   ` Andy Shevchenko
2025-04-03  8:20     ` Bartosz Golaszewski
2025-04-03 11:16       ` Andy Shevchenko
2025-04-03 12:23         ` Bartosz Golaszewski
2025-04-03 13:22           ` Andy Shevchenko
2025-04-07 12:49             ` Bartosz Golaszewski
2025-04-07 13:45               ` Andy Shevchenko [this message]
2025-04-15  9:32               ` Linus Walleij

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=Z_PXDjfVBBvZKf5i@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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