[PATCH] mtd: nand: Convert to platform remove callback returning void

Miquel Raynal miquel.raynal at bootlin.com
Tue Apr 11 01:20:25 PDT 2023


Hi Uwe,

u.kleine-koenig at pengutronix.de wrote on Sat, 8 Apr 2023 20:53:32 +0200:

> 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 (mostly) ignored
> 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.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Acked-by: Nicolas Ferre <nicolas.ferre at microchip.com>
> Reviewed-by: Paul Cercueil <paul at crapouillou.net>
> Reviewed-by: Philippe Mathieu-Daudé <philmd at linaro.org>
> Acked-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
> Reviewed-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
> Acked-by: Roger Quadros <rogerq at kernel.org>
> Reviewed-by: Geert Uytterhoeven <geert+renesas at glider.be>
> Reviewed-by: Heiko Stuebner <heiko at sntech.de>
> Acked-by: Jernej Skrabec <jernej.skrabec at gmail.com>
> Acked-by: Thierry Reding <treding at nvidia.com>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> ---
> 
> Hey Miquel,
> 
> On Fri, Apr 07, 2023 at 10:10:43AM +0200, Miquel Raynal wrote:
> > I've looked at the different patches, they look good to me but as they
> > are all trivial and exactly identical, would you mind sending this
> > again all squashed in a single patch? A subsystem-wide conversion seems
> > appropriate. In all cases I plan to take this for the next merge
> > window.  
> 
> I slightly prefer them separately, because I like small patches and
> because the Acks and Reviews only apply to the individual drivers.
> But I don't mind seriously, so here comes the series squashed into one.

For any non trivial change, I would definitely do that as well.

The thing is, by collecting the tags with b4, you lost all the Acks and
Reviews targets, while we could prevent this, see below.

> While going through the changed, probably the s3c24xx driver (which
> isn't exactly identical to the other changes) could benefit from an
> additional change throwing out the early exit (which---I guess---cannot
> be hit).

Yes, I believe the 'info == NULL' condition is useless, feel free to
drop it in a second patch if you wish.

> BTW, I constructed the lists of acks/reviews myself and found the same
> set. However b4 wailed about each patch claiming:
> 
> 	    ✗ BADSIG: DKIM/infradead.org

No idea what this means, any pointer?

> And it didn't like you producing the tags, saying:
> 
> 	NOTE: some trailers ignored due to from/email mismatches:
> 	    ! Trailer: Acked-by: Roger Quadros <rogerq at kernel.org>
> 	     Msg From: Miquel Raynal <miquel.raynal at bootlin.com>
> 	    [...]

Well, yes, I don't expect b4 to read plain english when I say "I
collected them for you" ^^ But at least my list had a '# <area>' suffix
for each of the Acked and Reviewed changes, which is now missing. I
don't know  how useful they actually are, but it seems to me that the
information was lost between v1 and v2?

Thanks,
Miquèl



More information about the Linux-rockchip mailing list