[PATCH] ACPI: APEI: GHES: Convert to platform remove callback returning void

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon Dec 18 12:47:10 PST 2023


Hello James,

On Wed, Nov 22, 2023 at 06:49:13PM +0100, Borislav Petkov wrote:
> On Wed, Nov 22, 2023 at 04:25:30PM +0100, Rafael J. Wysocki wrote:
> > On Mon, Nov 20, 2023 at 6:31 PM Uwe Kleine-König
> > <u.kleine-koenig at pengutronix.de> wrote:
> > >
> > > The .remove() callback for a platform driver returns an int which makes
> > > many driver authors wrongly assume it's possible to do error handling by
> > > returning an error code. However the value returned is ignored (apart
> > > from emitting a warning) and this typically results in resource leaks.
> > >
> > > To improve here there is a quest to make the remove callback return
> > > void. In the first step of this quest all drivers are converted to
> > > .remove_new(), which already returns void. Eventually after all drivers
> > > are converted, .remove_new() will be renamed to .remove().
> > >
> > > Instead of returning an error code, emit a better error message than the
> > > core. Apart from the improved error message this patch has no effects
> > > for the driver.
> > >
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> > > ---
> > > Hello,
> > >
> > > I tried to improve this driver before, see
> > >
> > >         https://lore.kernel.org/linux-acpi/CAJZ5v0ifb-wvyp0JRq_4c1L6vTi_qEeXJ6P=Pmmq_56xRL74_A@mail.gmail.com
> > >         https://lore.kernel.org/linux-arm-kernel/20221219221439.1681770-1-u.kleine-koenig@pengutronix.de
> > >         https://lore.kernel.org/linux-arm-kernel/20221220154447.12341-1-u.kleine-koenig@pengutronix.de
> > >
> > > but this didn't result in any patch being applied.
> > >
> > > I think it's inarguable that there is a problem that wants to be fixed.
> > > My tries to fix this problem fixxled out, so here comes a minimal change
> > > that just points out the problem and otherwise makes ghes_remove()
> > > return void without further side effects to allow me to continue my
> > > quest to make platform_driver remove callbacks return no error.
> > 
> > Tony, Boris, any objections against this patch?
> 
> SDEI is James. Moving him to To:

I wonder if you had a chance to look at this patch.

It doesn't change anything for the SDEI driver, the only effect is to
have one driver less using platform_driver's remove function.

Would be great if that patch made it in.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20231218/79814ac8/attachment.sig>


More information about the linux-arm-kernel mailing list