openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [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 6/6] ipmi: kcs_bmc_npcm7xx: " Uwe Kleine-König
  2024-04-11  7:15 ` [PATCH 0/6] ipmi: " Uwe Kleine-König
  0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2024-03-05 16:26 UTC (permalink / raw)
  To: Corey Minyard, Michael Ellerman, Joel Stanley, Avi Fishman,
	Tomer Maimon, Tali Perry
  Cc: Benjamin Fair, linux-aspeed, Patrick Venture, openbmc,
	Christophe Leroy, Aneesh Kumar K.V, Nicholas Piggin, kernel,
	Naveen N. Rao, openipmi-developer, linuxppc-dev,
	linux-arm-kernel

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] 6+ messages in thread

* [PATCH 6/6] ipmi: kcs_bmc_npcm7xx: 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-04-11  7:15 ` [PATCH 0/6] ipmi: " Uwe Kleine-König
  1 sibling, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2024-03-05 16:27 UTC (permalink / raw)
  To: Avi Fishman, Tomer Maimon, Tali Perry, Corey Minyard
  Cc: Benjamin Fair, Patrick Venture, openbmc, kernel, openipmi-developer

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_npcm7xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/char/ipmi/kcs_bmc_npcm7xx.c b/drivers/char/ipmi/kcs_bmc_npcm7xx.c
index 7961fec56476..07710198233a 100644
--- a/drivers/char/ipmi/kcs_bmc_npcm7xx.c
+++ b/drivers/char/ipmi/kcs_bmc_npcm7xx.c
@@ -218,7 +218,7 @@ static int npcm7xx_kcs_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int npcm7xx_kcs_remove(struct platform_device *pdev)
+static void npcm7xx_kcs_remove(struct platform_device *pdev)
 {
 	struct npcm7xx_kcs_bmc *priv = platform_get_drvdata(pdev);
 	struct kcs_bmc_device *kcs_bmc = &priv->kcs_bmc;
@@ -227,8 +227,6 @@ static int npcm7xx_kcs_remove(struct platform_device *pdev)
 
 	npcm7xx_kcs_enable_channel(kcs_bmc, false);
 	npcm7xx_kcs_irq_mask_update(kcs_bmc, (KCS_BMC_EVENT_TYPE_IBF | KCS_BMC_EVENT_TYPE_OBE), 0);
-
-	return 0;
 }
 
 static const struct of_device_id npcm_kcs_bmc_match[] = {
@@ -243,7 +241,7 @@ static struct platform_driver npcm_kcs_bmc_driver = {
 		.of_match_table	= npcm_kcs_bmc_match,
 	},
 	.probe	= npcm7xx_kcs_probe,
-	.remove	= npcm7xx_kcs_remove,
+	.remove_new = npcm7xx_kcs_remove,
 };
 module_platform_driver(npcm_kcs_bmc_driver);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [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 6/6] ipmi: kcs_bmc_npcm7xx: " Uwe Kleine-König
@ 2024-04-11  7:15 ` Uwe Kleine-König
  2024-04-11 15:11   ` Corey Minyard
  1 sibling, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2024-04-11  7:15 UTC (permalink / raw)
  To: Corey Minyard, Michael Ellerman, Joel Stanley, Avi Fishman,
	Tomer Maimon, Tali Perry
  Cc: Benjamin Fair, linux-aspeed, Patrick Venture, openbmc,
	Christophe Leroy, Aneesh Kumar K.V, Nicholas Piggin, kernel,
	Naveen N. Rao, openipmi-developer, linuxppc-dev,
	linux-arm-kernel

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

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/ |

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [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; 6+ messages in thread
From: Corey Minyard @ 2024-04-11 15:11 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Benjamin Fair, linux-aspeed, Avi Fishman, Michael Ellerman,
	openbmc, Nicholas Piggin, Christophe Leroy, Tali Perry,
	Aneesh Kumar K.V, Joel Stanley, kernel, Patrick Venture,
	Naveen N. Rao, openipmi-developer, linuxppc-dev,
	linux-arm-kernel, Tomer Maimon

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] 6+ messages in thread

* Re: [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
       [not found]       ` <ZlH4KFZ3MYzelzZK@mail.minyard.net>
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2024-05-25 10:10 UTC (permalink / raw)
  To: Corey Minyard, Greg Kroah-Hartman
  Cc: Benjamin Fair, linux-aspeed, Avi Fishman, Michael Ellerman,
	openbmc, Tomer Maimon, Nicholas Piggin, Tali Perry,
	Aneesh Kumar K.V, Christophe Leroy, kernel, Patrick Venture,
	Naveen N. Rao, openipmi-developer, linuxppc-dev,
	linux-arm-kernel, Joel Stanley

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

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/ |

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/6] ipmi: Convert to platform remove callback returning void
       [not found]       ` <ZlH4KFZ3MYzelzZK@mail.minyard.net>
@ 2024-05-26 10:24         ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2024-05-26 10:24 UTC (permalink / raw)
  To: Corey Minyard
  Cc: Corey Minyard, Benjamin Fair, linux-aspeed, Avi Fishman,
	Greg Kroah-Hartman, openbmc, Joel Stanley, Michael Ellerman,
	Nicholas Piggin, Tali Perry, Aneesh Kumar K.V, Christophe Leroy,
	kernel, Patrick Venture, Naveen N. Rao, openipmi-developer,
	linuxppc-dev, linux-arm-kernel, Tomer Maimon

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

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/ |

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-26 10:31 UTC | newest]

Thread overview: 6+ 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 6/6] ipmi: kcs_bmc_npcm7xx: " Uwe Kleine-König
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
     [not found]       ` <ZlH4KFZ3MYzelzZK@mail.minyard.net>
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).