All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Russell King <linux@armlinux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/4] amba: Make the remove callback return void
Date: Tue, 24 Nov 2020 13:19:43 +0100	[thread overview]
Message-ID: <20201124121943.72etfmpubis6jw3l@pengutronix.de> (raw)
In-Reply-To: <CAK8P3a0xz8Yf37GVntdyP-npKJ5N7jKH16JdcYL-a214KsXaEg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]

On Tue, Nov 24, 2020 at 12:48:05PM +0100, Arnd Bergmann wrote:
> On Tue, Nov 24, 2020 at 11:32 AM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> >
> > Most amba drivers return 0 in their remove callback. Together with the
> > driver core ignoring the return value anyhow, it doesn't make sense to
> > return a value here.
> >
> > So add a warning to the only driver that could return an error code and
> > change the remove prototype to return void, which makes it explicit that
> > returning an error value doesn't work as expected. This simplifies changing
> > the core remove callback to return void, too.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Makes sense, I checked that the vfio driver cannot actually return an error
> either, the 'if (vdev)' check seems to be done out of unnecessary caution,
> as the probe would never have succeeded if that was NULL.

Yes I thought this possible, but didn't tried to wrap my head around the
logic there. IMHO this warrants a cleanup, will address this in v2.

Thanks for your feedback,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Russell King <linux@armlinux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/4] amba: Make the remove callback return void
Date: Tue, 24 Nov 2020 13:19:43 +0100	[thread overview]
Message-ID: <20201124121943.72etfmpubis6jw3l@pengutronix.de> (raw)
In-Reply-To: <CAK8P3a0xz8Yf37GVntdyP-npKJ5N7jKH16JdcYL-a214KsXaEg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1270 bytes --]

On Tue, Nov 24, 2020 at 12:48:05PM +0100, Arnd Bergmann wrote:
> On Tue, Nov 24, 2020 at 11:32 AM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> >
> > Most amba drivers return 0 in their remove callback. Together with the
> > driver core ignoring the return value anyhow, it doesn't make sense to
> > return a value here.
> >
> > So add a warning to the only driver that could return an error code and
> > change the remove prototype to return void, which makes it explicit that
> > returning an error value doesn't work as expected. This simplifies changing
> > the core remove callback to return void, too.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Makes sense, I checked that the vfio driver cannot actually return an error
> either, the 'if (vdev)' check seems to be done out of unnecessary caution,
> as the probe would never have succeeded if that was NULL.

Yes I thought this possible, but didn't tried to wrap my head around the
logic there. IMHO this warrants a cleanup, will address this in v2.

Thanks for your feedback,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-24 12:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24 10:32 [PATCH 1/4] amba: reorder functions Uwe Kleine-König
2020-11-24 10:32 ` Uwe Kleine-König
2020-11-24 10:32 ` [PATCH 2/4] amba: Fix resource leak for drivers without .remove Uwe Kleine-König
2020-11-24 10:32   ` Uwe Kleine-König
2020-11-24 10:56   ` Ulf Hansson
2020-11-24 10:56     ` Ulf Hansson
2020-11-24 10:32 ` [PATCH 3/4] amba: Make the remove callback return void Uwe Kleine-König
2020-11-24 10:32   ` Uwe Kleine-König
2020-11-24 10:56   ` Ulf Hansson
2020-11-24 10:56     ` Ulf Hansson
2020-11-24 11:48   ` Arnd Bergmann
2020-11-24 11:48     ` Arnd Bergmann
2020-11-24 12:19     ` Uwe Kleine-König [this message]
2020-11-24 12:19       ` Uwe Kleine-König
2020-11-24 10:32 ` [PATCH 4/4] amba: Make use of bus_type functions Uwe Kleine-König
2020-11-24 10:32   ` Uwe Kleine-König
2020-11-24 10:56   ` Ulf Hansson
2020-11-24 10:56     ` Ulf Hansson
2020-11-24 10:56 ` [PATCH 1/4] amba: reorder functions Ulf Hansson
2020-11-24 10:56   ` Ulf Hansson
2020-11-24 11:49 ` Arnd Bergmann
2020-11-24 11:49   ` Arnd Bergmann

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=20201124121943.72etfmpubis6jw3l@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=robh@kernel.org \
    --cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.