Skip to contentSkip to conversation

cpuidle: kirkwood: Convert to platform remove callback returning void

PATCH In review Yangtao Li 3 participants 6 messages Jul 12, 2023 – Apr 29, 2024 CPU idle time management framework

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 cpuidle: kirkwood: Convert to platform remove callback returning void

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.

Cc Uwe Kleine-König <[email protected]>
---
 drivers/cpuidle/cpuidle-kirkwood.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/cpuidle/cpuidle-kirkwood.c +2 -3
index 13bf743f885b..602c4dfdd7e2 100644
@@ -59,15 +59,14 @@ static int kirkwood_cpuidle_probe(struct platform_device *pdev)
 	return cpuidle_register(&kirkwood_idle_driver, NULL);
 }
 
-static int kirkwood_cpuidle_remove(struct platform_device *pdev)
+static void kirkwood_cpuidle_remove(struct platform_device *pdev)
 {
 	cpuidle_unregister(&kirkwood_idle_driver);
-	return 0;
 }
 
 static struct platform_driver kirkwood_cpuidle_driver = {
 	.probe = kirkwood_cpuidle_probe,
-	.remove = kirkwood_cpuidle_remove,
+	.remove_new = kirkwood_cpuidle_remove,
 	.driver = {
 		   .name = "kirkwood_cpuidle",
 		   },
Signature · 1 line
2.39.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Yangtao Li

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.

Quoted 5 lines

Trivially convert this driver from always returning zero in the remove callback to the void returning variant.

Cc Uwe Kleine-König <[email protected]>

Can you pick this up?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#2 lore raw

Hello Rafael, hello Daniel,

Quoted 12 lines · Uwe Kleine-König
Quoted 11 lines · Yangtao Li

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.

Quoted 6 lines
Quoted 2 lines
Cc Uwe Kleine-König <[email protected]>

Can you pick this up?

This patch isn't in next yet. Is this still on someone's radar for application? Would be great if this patch made it into the mainline during the upcomming merge window.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#3 lore raw

Hello,

Quoted 16 lines · Uwe Kleine-König
Quoted 15 lines · Uwe Kleine-König
Quoted 13 lines · Yangtao Li

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.

Cc Uwe Kleine-König <[email protected]>
Quoted 7 lines
Quoted 3 lines

Can you pick this up?

This patch isn't in next yet. Is this still on someone's radar for application? Would be great if this patch made it into the mainline during the upcomming merge window.

It didn't made it into the merge window leading to 6.9-rc1. What are the chances to get it into v6.10-rc1?

I just checked, the patch was submitted when Linus's tree was just after v6.5-rc1. So it already missed four merge windows without any maintainer feedback :-\

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#4 lore raw
Quoted 27 lines · Uwe Kleine-König

Hello,

Quoted 16 lines · Uwe Kleine-König
Quoted 15 lines · Uwe Kleine-König
Quoted 13 lines · Yangtao Li

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.

Cc Uwe Kleine-König <[email protected]>
Quoted 7 lines
Quoted 3 lines

Can you pick this up?

This patch isn't in next yet. Is this still on someone's radar for application? Would be great if this patch made it into the mainline during the upcomming merge window.

Quoted 6 lines

It didn't made it into the merge window leading to 6.9-rc1. What are the chances to get it into v6.10-rc1?

I just checked, the patch was submitted when Linus's tree was just after v6.5-rc1. So it already missed four merge windows without any maintainer feedback :-\

Sorry, it is applied now.

Thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#5 lore raw

Hello Daniel,

Quoted 26 lines · Daniel Lezcano
Quoted 25 lines · Uwe Kleine-König
Quoted 23 lines · Uwe Kleine-König
Quoted 12 lines · Uwe Kleine-König
Quoted 11 lines · Yangtao Li

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.

Quoted 6 lines
Quoted 2 lines
Cc Uwe Kleine-König <[email protected]>

Can you pick this up?

This patch isn't in next yet. Is this still on someone's radar for application? Would be great if this patch made it into the mainline during the upcomming merge window.

Quoted 8 lines
Quoted 6 lines

It didn't made it into the merge window leading to 6.9-rc1. What are the chances to get it into v6.10-rc1?

I just checked, the patch was submitted when Linus's tree was just after v6.5-rc1. So it already missed four merge windows without any maintainer feedback :-\

Sorry, it is applied now.

Is it expected that this patch didn't appear in next yet now that you applied it?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |