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

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.

         Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
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 12:48:05 +0100	[thread overview]
Message-ID: <CAK8P3a0xz8Yf37GVntdyP-npKJ5N7jKH16JdcYL-a214KsXaEg@mail.gmail.com> (raw)
In-Reply-To: <20201124103242.2971199-3-u.kleine-koenig@pengutronix.de>

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.

         Arnd

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

  parent reply	other threads:[~2020-11-24 11:48 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 [this message]
2020-11-24 11:48     ` Arnd Bergmann
2020-11-24 12:19     ` Uwe Kleine-König
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=CAK8P3a0xz8Yf37GVntdyP-npKJ5N7jKH16JdcYL-a214KsXaEg@mail.gmail.com \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --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=u.kleine-koenig@pengutronix.de \
    --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.