LinuxPPC-Dev 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:26 ` [PATCH 2/6] ipmi: ipmi_powernv: " Uwe Kleine-König
  2024-04-11  7:15 ` [PATCH 0/6] ipmi: " Uwe Kleine-König
  0 siblings, 2 replies; 7+ 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,
	Aneesh Kumar K.V, Nancy Yuen, Nicholas Piggin, kernel,
	Naveen N. Rao, openipmi-developer, Andrew Jeffery, 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] 7+ messages in thread

* [PATCH 2/6] ipmi: ipmi_powernv: 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:26 ` Uwe Kleine-König
  2024-04-11  7:15 ` [PATCH 0/6] ipmi: " Uwe Kleine-König
  1 sibling, 0 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2024-03-05 16:26 UTC (permalink / raw
  To: Corey Minyard, Michael Ellerman
  Cc: Aneesh Kumar K.V, Nicholas Piggin, kernel, Naveen N. Rao,
	openipmi-developer, linuxppc-dev

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

diff --git a/drivers/char/ipmi/ipmi_powernv.c b/drivers/char/ipmi/ipmi_powernv.c
index da22a8cbe68e..c59a86eb58c7 100644
--- a/drivers/char/ipmi/ipmi_powernv.c
+++ b/drivers/char/ipmi/ipmi_powernv.c
@@ -281,15 +281,13 @@ static int ipmi_powernv_probe(struct platform_device *pdev)
 	return rc;
 }
 
-static int ipmi_powernv_remove(struct platform_device *pdev)
+static void ipmi_powernv_remove(struct platform_device *pdev)
 {
 	struct ipmi_smi_powernv *smi = dev_get_drvdata(&pdev->dev);
 
 	ipmi_unregister_smi(smi->intf);
 	free_irq(smi->irq, smi);
 	irq_dispose_mapping(smi->irq);
-
-	return 0;
 }
 
 static const struct of_device_id ipmi_powernv_match[] = {
@@ -304,7 +302,7 @@ static struct platform_driver powernv_ipmi_driver = {
 		.of_match_table	= ipmi_powernv_match,
 	},
 	.probe	= ipmi_powernv_probe,
-	.remove	= ipmi_powernv_remove,
+	.remove_new = ipmi_powernv_remove,
 };
 
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ 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:26 ` [PATCH 2/6] ipmi: ipmi_powernv: " Uwe Kleine-König
@ 2024-04-11  7:15 ` Uwe Kleine-König
  2024-04-11 15:11   ` Corey Minyard
  1 sibling, 1 reply; 7+ 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,
	Aneesh Kumar K.V, Nancy Yuen, Nicholas Piggin, kernel,
	Naveen N. Rao, openipmi-developer, Andrew Jeffery, 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] 7+ 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; 7+ 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, openbmc,
	Nicholas Piggin, Tali Perry, Aneesh Kumar K.V, Nancy Yuen,
	Joel Stanley, kernel, Patrick Venture, Naveen N. Rao,
	openipmi-developer, Andrew Jeffery, 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] 7+ 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
  2024-05-25 14:39       ` Corey Minyard
  0 siblings, 1 reply; 7+ 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, openbmc, Tomer Maimon,
	Nicholas Piggin, Tali Perry, Aneesh Kumar K.V, Nancy Yuen, kernel,
	Patrick Venture, Naveen N. Rao, openipmi-developer,
	Andrew Jeffery, 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] 7+ messages in thread

* Re: [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; 7+ messages in thread
From: Corey Minyard @ 2024-05-25 14:39 UTC (permalink / raw
  To: Uwe Kleine-König
  Cc: Corey Minyard, Benjamin Fair, linux-aspeed, Avi Fishman,
	Greg Kroah-Hartman, openbmc, Tomer Maimon, Nicholas Piggin,
	Tali Perry, Aneesh Kumar K.V, Nancy Yuen, Patrick Venture, kernel,
	Naveen N. Rao, openipmi-developer, Andrew Jeffery, linuxppc-dev,
	linux-arm-kernel, Joel Stanley

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

* Re: [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; 7+ 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, Nicholas Piggin,
	Tali Perry, Aneesh Kumar K.V, Nancy Yuen, kernel, Patrick Venture,
	Naveen N. Rao, openipmi-developer, Andrew Jeffery, 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] 7+ messages in thread

end of thread, other threads:[~2024-05-30 22:25 UTC | newest]

Thread overview: 7+ 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:26 ` [PATCH 2/6] ipmi: ipmi_powernv: " 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
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 read-only IMAP folder(s) and NNTP newsgroup(s).