* [PATCH 0/6] ipmi: Convert to platform remove callback returning void
@ 2024-03-05 16:26 Uwe Kleine-König
2024-03-05 16:27 ` [PATCH 5/6] ipmi: kcs_bmc_aspeed: " Uwe Kleine-König
2024-04-11 7:15 ` [PATCH 0/6] ipmi: " Uwe Kleine-König
0 siblings, 2 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2024-03-05 16:26 UTC (permalink / raw)
To: linux-aspeed
Hello,
this series converts all drivers below drivers/char/ipmi to struct
platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: Provide a
remove callback that returns no value") for an extended explanation and the
eventual goal.
All conversations are trivial, because their .remove() callbacks
returned zero unconditionally.
There are no interdependencies between these patches, so they could be
picked up individually. But I'd hope that they get picked up all
together by Corey.
Best regards
Uwe
Uwe Kleine-K?nig (6):
ipmi: bt-bmc: Convert to platform remove callback returning void
ipmi: ipmi_powernv: Convert to platform remove callback returning void
ipmi: ipmi_si_platform: Convert to platform remove callback returning void
ipmi: ipmi_ssif: Convert to platform remove callback returning void
ipmi: kcs_bmc_aspeed: Convert to platform remove callback returning void
ipmi: kcs_bmc_npcm7xx: Convert to platform remove callback returning void
drivers/char/ipmi/bt-bmc.c | 5 ++---
drivers/char/ipmi/ipmi_powernv.c | 6 ++----
drivers/char/ipmi/ipmi_si_platform.c | 6 ++----
drivers/char/ipmi/ipmi_ssif.c | 5 ++---
drivers/char/ipmi/kcs_bmc_aspeed.c | 6 ++----
drivers/char/ipmi/kcs_bmc_npcm7xx.c | 6 ++----
6 files changed, 12 insertions(+), 22 deletions(-)
base-commit: 11afac187274a6177a7ac82997f8691c0f469e41
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 5/6] ipmi: kcs_bmc_aspeed: Convert to platform remove callback returning void 2024-03-05 16:26 [PATCH 0/6] ipmi: Convert to platform remove callback returning void Uwe Kleine-König @ 2024-03-05 16:27 ` Uwe Kleine-König 2024-03-06 1:57 ` Andrew Jeffery 2024-04-11 7:15 ` [PATCH 0/6] ipmi: " Uwe Kleine-König 1 sibling, 1 reply; 8+ messages in thread From: Uwe Kleine-König @ 2024-03-05 16:27 UTC (permalink / raw) To: linux-aspeed 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(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> --- drivers/char/ipmi/kcs_bmc_aspeed.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/ipmi/kcs_bmc_aspeed.c b/drivers/char/ipmi/kcs_bmc_aspeed.c index 72640da55380..227bf06c7ca4 100644 --- a/drivers/char/ipmi/kcs_bmc_aspeed.c +++ b/drivers/char/ipmi/kcs_bmc_aspeed.c @@ -641,7 +641,7 @@ static int aspeed_kcs_probe(struct platform_device *pdev) return 0; } -static int aspeed_kcs_remove(struct platform_device *pdev) +static void aspeed_kcs_remove(struct platform_device *pdev) { struct aspeed_kcs_bmc *priv = platform_get_drvdata(pdev); struct kcs_bmc_device *kcs_bmc = &priv->kcs_bmc; @@ -656,8 +656,6 @@ static int aspeed_kcs_remove(struct platform_device *pdev) priv->obe.remove = true; spin_unlock_irq(&priv->obe.lock); del_timer_sync(&priv->obe.timer); - - return 0; } static const struct of_device_id ast_kcs_bmc_match[] = { @@ -674,7 +672,7 @@ static struct platform_driver ast_kcs_bmc_driver = { .of_match_table = ast_kcs_bmc_match, }, .probe = aspeed_kcs_probe, - .remove = aspeed_kcs_remove, + .remove_new = aspeed_kcs_remove, }; module_platform_driver(ast_kcs_bmc_driver); -- 2.43.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/6] ipmi: kcs_bmc_aspeed: Convert to platform remove callback returning void 2024-03-05 16:27 ` [PATCH 5/6] ipmi: kcs_bmc_aspeed: " Uwe Kleine-König @ 2024-03-06 1:57 ` Andrew Jeffery 0 siblings, 0 replies; 8+ messages in thread From: Andrew Jeffery @ 2024-03-06 1:57 UTC (permalink / raw) To: linux-aspeed On Tue, 2024-03-05 at 17:27 +0100, Uwe Kleine-K?nig 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(). > > Trivially convert this driver from always returning zero in the remove > callback to the void returning variant. > > Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de> Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au> Thanks! ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/6] ipmi: Convert to platform remove callback returning void 2024-03-05 16:26 [PATCH 0/6] ipmi: Convert to platform remove callback returning void Uwe Kleine-König 2024-03-05 16:27 ` [PATCH 5/6] ipmi: kcs_bmc_aspeed: " Uwe Kleine-König @ 2024-04-11 7:15 ` Uwe Kleine-König 2024-04-11 15:11 ` Corey Minyard 1 sibling, 1 reply; 8+ messages in thread From: Uwe Kleine-König @ 2024-04-11 7:15 UTC (permalink / raw) To: linux-aspeed Hello, On Tue, Mar 05, 2024 at 05:26:57PM +0100, Uwe Kleine-K?nig wrote: > this series converts all drivers below drivers/char/ipmi to struct > platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: Provide a > remove callback that returns no value") for an extended explanation and the > eventual goal. > > All conversations are trivial, because their .remove() callbacks > returned zero unconditionally. > > There are no interdependencies between these patches, so they could be > picked up individually. But I'd hope that they get picked up all > together by Corey. Apart from a (positive) review reply I didn't get any feedback to this series. My quest to change the prototype of struct platform_driver::remove depends on these patches, so it would be great if they made it in during the next merge window. 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.ozlabs.org/pipermail/linux-aspeed/attachments/20240411/87b1ccd8/attachment.sig> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/6] ipmi: Convert to platform remove callback returning void 2024-04-11 7:15 ` [PATCH 0/6] ipmi: " Uwe Kleine-König @ 2024-04-11 15:11 ` Corey Minyard 2024-05-25 10:10 ` Uwe Kleine-König 0 siblings, 1 reply; 8+ messages in thread From: Corey Minyard @ 2024-04-11 15:11 UTC (permalink / raw) To: linux-aspeed On Thu, Apr 11, 2024 at 09:15:03AM +0200, Uwe Kleine-K?nig wrote: > Hello, > > On Tue, Mar 05, 2024 at 05:26:57PM +0100, Uwe Kleine-K?nig wrote: > > this series converts all drivers below drivers/char/ipmi to struct > > platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: Provide a > > remove callback that returns no value") for an extended explanation and the > > eventual goal. > > > > All conversations are trivial, because their .remove() callbacks > > returned zero unconditionally. > > > > There are no interdependencies between these patches, so they could be > > picked up individually. But I'd hope that they get picked up all > > together by Corey. Yeah, I was kind of waiting for more reviews, but this is pretty straightforward. I've pulled this into my tree. -corey > > Apart from a (positive) review reply I didn't get any feedback to this > series. My quest to change the prototype of struct > platform_driver::remove depends on these patches, so it would be great > if they made it in during the next merge window. > > Best regards > Uwe > > -- > Pengutronix e.K. | Uwe Kleine-K?nig | > Industrial Linux Solutions | https://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/6] ipmi: Convert to platform remove callback returning void 2024-04-11 15:11 ` Corey Minyard @ 2024-05-25 10:10 ` Uwe Kleine-König 2024-05-25 14:39 ` Corey Minyard 0 siblings, 1 reply; 8+ messages in thread From: Uwe Kleine-König @ 2024-05-25 10:10 UTC (permalink / raw) To: linux-aspeed Hello Corey, On Thu, Apr 11, 2024 at 10:11:21AM -0500, Corey Minyard wrote: > On Thu, Apr 11, 2024 at 09:15:03AM +0200, Uwe Kleine-K?nig wrote: > > Hello, > > > > On Tue, Mar 05, 2024 at 05:26:57PM +0100, Uwe Kleine-K?nig wrote: > > > this series converts all drivers below drivers/char/ipmi to struct > > > platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: Provide a > > > remove callback that returns no value") for an extended explanation and the > > > eventual goal. > > > > > > All conversations are trivial, because their .remove() callbacks > > > returned zero unconditionally. > > > > > > There are no interdependencies between these patches, so they could be > > > picked up individually. But I'd hope that they get picked up all > > > together by Corey. > > Yeah, I was kind of waiting for more reviews, but this is pretty > straightforward. I've pulled this into my tree. These changes are in next since a while but didn't land in Linus tree for v6.10-rc1. I intend to send a PR to Greg early next week changing platform_driver::remove to match remove_new. If these commits don't make it in in time, I'll be so bold and just include the commits from your for-next branch in my PR. 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.ozlabs.org/pipermail/linux-aspeed/attachments/20240525/1ac48773/attachment.sig> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/6] ipmi: Convert to platform remove callback returning void 2024-05-25 10:10 ` Uwe Kleine-König @ 2024-05-25 14:39 ` Corey Minyard 2024-05-26 10:24 ` Uwe Kleine-König 0 siblings, 1 reply; 8+ messages in thread From: Corey Minyard @ 2024-05-25 14:39 UTC (permalink / raw) To: linux-aspeed On Sat, May 25, 2024 at 12:10:38PM +0200, Uwe Kleine-K?nig wrote: > Hello Corey, > > On Thu, Apr 11, 2024 at 10:11:21AM -0500, Corey Minyard wrote: > > On Thu, Apr 11, 2024 at 09:15:03AM +0200, Uwe Kleine-K?nig wrote: > > > Hello, > > > > > > On Tue, Mar 05, 2024 at 05:26:57PM +0100, Uwe Kleine-K?nig wrote: > > > > this series converts all drivers below drivers/char/ipmi to struct > > > > platform_driver::remove_new(). See commit 5c5a7680e67b ("platform: Provide a > > > > remove callback that returns no value") for an extended explanation and the > > > > eventual goal. > > > > > > > > All conversations are trivial, because their .remove() callbacks > > > > returned zero unconditionally. > > > > > > > > There are no interdependencies between these patches, so they could be > > > > picked up individually. But I'd hope that they get picked up all > > > > together by Corey. > > > > Yeah, I was kind of waiting for more reviews, but this is pretty > > straightforward. I've pulled this into my tree. > > These changes are in next since a while but didn't land in Linus tree > for v6.10-rc1. I intend to send a PR to Greg early next week changing > platform_driver::remove to match remove_new. If these commits don't make > it in in time, I'll be so bold and just include the commits from your > for-next branch in my PR. I sent them to Linus right after 6.9 dropped, let me resend... -corey > > Best regards > Uwe > > -- > Pengutronix e.K. | Uwe Kleine-K?nig | > Industrial Linux Solutions | https://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/6] ipmi: Convert to platform remove callback returning void 2024-05-25 14:39 ` Corey Minyard @ 2024-05-26 10:24 ` Uwe Kleine-König 0 siblings, 0 replies; 8+ messages in thread From: Uwe Kleine-König @ 2024-05-26 10:24 UTC (permalink / raw) To: linux-aspeed Hello Corey, On Sat, May 25, 2024 at 09:39:36AM -0500, Corey Minyard wrote: > On Sat, May 25, 2024 at 12:10:38PM +0200, Uwe Kleine-K?nig wrote: > > These changes are in next since a while but didn't land in Linus tree > > for v6.10-rc1. I intend to send a PR to Greg early next week changing > > platform_driver::remove to match remove_new. If these commits don't make > > it in in time, I'll be so bold and just include the commits from your > > for-next branch in my PR. > > I sent them to Linus right after 6.9 dropped, let me resend... That worked, they landed now in Linus' tree. Thanks, that makes it a bit less ugly for me. 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.ozlabs.org/pipermail/linux-aspeed/attachments/20240526/4b5c41b1/attachment.sig> ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-05-26 10:24 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-03-05 16:26 [PATCH 0/6] ipmi: Convert to platform remove callback returning void Uwe Kleine-König 2024-03-05 16:27 ` [PATCH 5/6] ipmi: kcs_bmc_aspeed: " Uwe Kleine-König 2024-03-06 1:57 ` Andrew Jeffery 2024-04-11 7:15 ` [PATCH 0/6] ipmi: " Uwe Kleine-König 2024-04-11 15:11 ` Corey Minyard 2024-05-25 10:10 ` Uwe Kleine-König 2024-05-25 14:39 ` Corey Minyard 2024-05-26 10:24 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).