linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void
@ 2023-12-04 18:30 Uwe Kleine-König
  2023-12-04 18:30 ` [PATCH net-next v2 8/9] ieee802154: fakelb: " Uwe Kleine-König
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2023-12-04 18:30 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Alex Elder, netdev, kernel, Marc Kleine-Budde, Nick Child,
	Christian Marangi, Clément Léger, Andrew Lunn,
	Heiner Kallweit, Russell King, linux-renesas-soc, Zhao Qiang,
	linuxppc-dev, Linus Walleij, Imre Kaloz, linux-arm-kernel,
	Stephan Gerhold, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Loic Poulain, Sergey Ryazanov, Johannes Berg, linux-arm-msm,
	Alexander Aring, Stefan Schmidt, Miquel Raynal, linux-wpan

Hello,

(implicit) v1 of this series can be found at
https://lore.kernel.org/netdev/20231117095922.876489-1-u.kleine-koenig@pengutronix.de.
Changes since then:

 - Dropped patch #1 as Alex objected. Patch #1 (was #2 before) now
   converts ipa to remove_new() and introduces an error message in the
   error path that failed before.

 - Rebased to today's next

 - Add the tags received in the previous round.

Uwe Kleine-König (9):
  net: ipa: Convert to platform remove callback returning void
  net: fjes: Convert to platform remove callback returning void
  net: pcs: rzn1-miic: Convert to platform remove callback returning
    void
  net: sfp: Convert to platform remove callback returning void
  net: wan/fsl_ucc_hdlc: Convert to platform remove callback returning
    void
  net: wan/ixp4xx_hss: Convert to platform remove callback returning
    void
  net: wwan: qcom_bam_dmux: Convert to platform remove callback
    returning void
  ieee802154: fakelb: Convert to platform remove callback returning void
  ieee802154: hwsim: Convert to platform remove callback returning void

 drivers/net/fjes/fjes_main.c             |  6 ++---
 drivers/net/ieee802154/fakelb.c          |  5 ++--
 drivers/net/ieee802154/mac802154_hwsim.c |  6 ++---
 drivers/net/ipa/ipa_main.c               | 29 +++++++++++-------------
 drivers/net/pcs/pcs-rzn1-miic.c          |  6 ++---
 drivers/net/phy/sfp.c                    |  6 ++---
 drivers/net/wan/fsl_ucc_hdlc.c           |  6 ++---
 drivers/net/wan/ixp4xx_hss.c             |  5 ++--
 drivers/net/wwan/qcom_bam_dmux.c         |  6 ++---
 9 files changed, 29 insertions(+), 46 deletions(-)


base-commit: 629a3b49f3f957e975253c54846090b8d5ed2e9b
-- 
2.42.0


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

* [PATCH net-next v2 8/9] ieee802154: fakelb: Convert to platform remove callback returning void
  2023-12-04 18:30 [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-12-04 18:30 ` Uwe Kleine-König
  2023-12-04 18:30 ` [PATCH net-next v2 9/9] ieee802154: hwsim: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2023-12-04 18:30 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Alexander Aring, Stefan Schmidt, Miquel Raynal, linux-wpan,
	netdev, kernel

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.

Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Link: https://lore.kernel.org/r/20231117095922.876489-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/ieee802154/fakelb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 523d13ee02bf..35e55f198e05 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -221,7 +221,7 @@ static int fakelb_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int fakelb_remove(struct platform_device *pdev)
+static void fakelb_remove(struct platform_device *pdev)
 {
 	struct fakelb_phy *phy, *tmp;
 
@@ -229,14 +229,13 @@ static int fakelb_remove(struct platform_device *pdev)
 	list_for_each_entry_safe(phy, tmp, &fakelb_phys, list)
 		fakelb_del(phy);
 	mutex_unlock(&fakelb_phys_lock);
-	return 0;
 }
 
 static struct platform_device *ieee802154fake_dev;
 
 static struct platform_driver ieee802154fake_driver = {
 	.probe = fakelb_probe,
-	.remove = fakelb_remove,
+	.remove_new = fakelb_remove,
 	.driver = {
 			.name = "ieee802154fakelb",
 	},
-- 
2.42.0


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

* [PATCH net-next v2 9/9] ieee802154: hwsim: Convert to platform remove callback returning void
  2023-12-04 18:30 [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void Uwe Kleine-König
  2023-12-04 18:30 ` [PATCH net-next v2 8/9] ieee802154: fakelb: " Uwe Kleine-König
@ 2023-12-04 18:30 ` Uwe Kleine-König
  2023-12-05  6:51 ` [PATCH net-next v2 0/9] net*: " Miquel Raynal
  2023-12-06  4:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König @ 2023-12-04 18:30 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Alexander Aring, Stefan Schmidt, Miquel Raynal, linux-wpan,
	netdev, kernel

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.

Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Link: https://lore.kernel.org/r/20231117095922.876489-11-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/ieee802154/mac802154_hwsim.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c
index 31cba9aa7636..2c2483bbe780 100644
--- a/drivers/net/ieee802154/mac802154_hwsim.c
+++ b/drivers/net/ieee802154/mac802154_hwsim.c
@@ -1035,7 +1035,7 @@ static int hwsim_probe(struct platform_device *pdev)
 	return err;
 }
 
-static int hwsim_remove(struct platform_device *pdev)
+static void hwsim_remove(struct platform_device *pdev)
 {
 	struct hwsim_phy *phy, *tmp;
 
@@ -1043,13 +1043,11 @@ static int hwsim_remove(struct platform_device *pdev)
 	list_for_each_entry_safe(phy, tmp, &hwsim_phys, list)
 		hwsim_del(phy);
 	mutex_unlock(&hwsim_phys_lock);
-
-	return 0;
 }
 
 static struct platform_driver mac802154hwsim_driver = {
 	.probe = hwsim_probe,
-	.remove = hwsim_remove,
+	.remove_new = hwsim_remove,
 	.driver = {
 			.name = "mac802154_hwsim",
 	},
-- 
2.42.0


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

* Re: [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void
  2023-12-04 18:30 [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void Uwe Kleine-König
  2023-12-04 18:30 ` [PATCH net-next v2 8/9] ieee802154: fakelb: " Uwe Kleine-König
  2023-12-04 18:30 ` [PATCH net-next v2 9/9] ieee802154: hwsim: " Uwe Kleine-König
@ 2023-12-05  6:51 ` Miquel Raynal
  2023-12-05  7:39   ` Uwe Kleine-König
  2023-12-06  4:00 ` patchwork-bot+netdevbpf
  3 siblings, 1 reply; 7+ messages in thread
From: Miquel Raynal @ 2023-12-05  6:51 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Alex Elder, netdev, kernel, Marc Kleine-Budde, Nick Child,
	Christian Marangi, Clément Léger, Andrew Lunn,
	Heiner Kallweit, Russell King, linux-renesas-soc, Zhao Qiang,
	linuxppc-dev, Linus Walleij, Imre Kaloz, linux-arm-kernel,
	Stephan Gerhold, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Loic Poulain, Sergey Ryazanov, Johannes Berg, linux-arm-msm,
	Alexander Aring, Stefan Schmidt, linux-wpan

Hi Uwe,

u.kleine-koenig@pengutronix.de wrote on Mon,  4 Dec 2023 19:30:40 +0100:

> Hello,
> 
> (implicit) v1 of this series can be found at
> https://lore.kernel.org/netdev/20231117095922.876489-1-u.kleine-koenig@pengutronix.de.
> Changes since then:
> 
>  - Dropped patch #1 as Alex objected. Patch #1 (was #2 before) now
>    converts ipa to remove_new() and introduces an error message in the
>    error path that failed before.
> 
>  - Rebased to today's next
> 
>  - Add the tags received in the previous round.
> 
> Uwe Kleine-König (9):
>   net: ipa: Convert to platform remove callback returning void
>   net: fjes: Convert to platform remove callback returning void
>   net: pcs: rzn1-miic: Convert to platform remove callback returning
>     void
>   net: sfp: Convert to platform remove callback returning void
>   net: wan/fsl_ucc_hdlc: Convert to platform remove callback returning
>     void
>   net: wan/ixp4xx_hss: Convert to platform remove callback returning
>     void
>   net: wwan: qcom_bam_dmux: Convert to platform remove callback
>     returning void
>   ieee802154: fakelb: Convert to platform remove callback returning void
>   ieee802154: hwsim: Convert to platform remove callback returning void

FYI, I plan on taking patches 8 and 9 through wpan-next.

Thanks,
Miquèl

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

* Re: [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void
  2023-12-05  6:51 ` [PATCH net-next v2 0/9] net*: " Miquel Raynal
@ 2023-12-05  7:39   ` Uwe Kleine-König
  2023-12-05  7:50     ` Miquel Raynal
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Kleine-König @ 2023-12-05  7:39 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Andrew Lunn, Alexander Aring, Sergey Ryazanov, Eric Dumazet,
	Stefan Schmidt, Zhao Qiang, Bjorn Andersson, Konrad Dybcio,
	Russell King, linux-wpan, Andy Gross, Jakub Kicinski,
	Paolo Abeni, Clément Léger, Christian Marangi,
	Nick Child, Stephan Gerhold, linux-arm-msm, Loic Poulain,
	Marc Kleine-Budde, linux-arm-kernel, Alex Elder, netdev,
	Linus Walleij, linux-renesas-soc, kernel, Johannes Berg,
	Imre Kaloz, linuxppc-dev, David S. Miller, Heiner Kallweit

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

Hello Miquel,

On Tue, Dec 05, 2023 at 07:51:10AM +0100, Miquel Raynal wrote:
> u.kleine-koenig@pengutronix.de wrote on Mon,  4 Dec 2023 19:30:40 +0100:
> > (implicit) v1 of this series can be found at
> > https://lore.kernel.org/netdev/20231117095922.876489-1-u.kleine-koenig@pengutronix.de.
> > Changes since then:
> > 
> >  - Dropped patch #1 as Alex objected. Patch #1 (was #2 before) now
> >    converts ipa to remove_new() and introduces an error message in the
> >    error path that failed before.
> > 
> >  - Rebased to today's next
> > 
> >  - Add the tags received in the previous round.
> > 
> > Uwe Kleine-König (9):
> >   net: ipa: Convert to platform remove callback returning void
> >   net: fjes: Convert to platform remove callback returning void
> >   net: pcs: rzn1-miic: Convert to platform remove callback returning
> >     void
> >   net: sfp: Convert to platform remove callback returning void
> >   net: wan/fsl_ucc_hdlc: Convert to platform remove callback returning
> >     void
> >   net: wan/ixp4xx_hss: Convert to platform remove callback returning
> >     void
> >   net: wwan: qcom_bam_dmux: Convert to platform remove callback
> >     returning void
> >   ieee802154: fakelb: Convert to platform remove callback returning void
> >   ieee802154: hwsim: Convert to platform remove callback returning void
> 
> FYI, I plan on taking patches 8 and 9 through wpan-next.

I forgot to mention explicitly that there are no interdependencies in
this series. So each maintainer picking up up their patches is fine.

Thanks
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 net-next v2 0/9] net*: Convert to platform remove callback returning void
  2023-12-05  7:39   ` Uwe Kleine-König
@ 2023-12-05  7:50     ` Miquel Raynal
  0 siblings, 0 replies; 7+ messages in thread
From: Miquel Raynal @ 2023-12-05  7:50 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andrew Lunn, Alexander Aring, Sergey Ryazanov, Eric Dumazet,
	Stefan Schmidt, Zhao Qiang, Bjorn Andersson, Konrad Dybcio,
	Russell King, linux-wpan, Andy Gross, Jakub Kicinski,
	Paolo Abeni, Clément Léger, Christian Marangi,
	Nick Child, Stephan Gerhold, linux-arm-msm, Loic Poulain,
	Marc Kleine-Budde, linux-arm-kernel, Alex Elder, netdev,
	Linus Walleij, linux-renesas-soc, kernel, Johannes Berg,
	Imre Kaloz, linuxppc-dev, David S. Miller, Heiner Kallweit

Hello Uwe,

u.kleine-koenig@pengutronix.de wrote on Tue, 5 Dec 2023 08:39:11 +0100:

> Hello Miquel,
> 
> On Tue, Dec 05, 2023 at 07:51:10AM +0100, Miquel Raynal wrote:
> > u.kleine-koenig@pengutronix.de wrote on Mon,  4 Dec 2023 19:30:40 +0100:  
> > > (implicit) v1 of this series can be found at
> > > https://lore.kernel.org/netdev/20231117095922.876489-1-u.kleine-koenig@pengutronix.de.
> > > Changes since then:
> > > 
> > >  - Dropped patch #1 as Alex objected. Patch #1 (was #2 before) now
> > >    converts ipa to remove_new() and introduces an error message in the
> > >    error path that failed before.
> > > 
> > >  - Rebased to today's next
> > > 
> > >  - Add the tags received in the previous round.
> > > 
> > > Uwe Kleine-König (9):
> > >   net: ipa: Convert to platform remove callback returning void
> > >   net: fjes: Convert to platform remove callback returning void
> > >   net: pcs: rzn1-miic: Convert to platform remove callback returning
> > >     void
> > >   net: sfp: Convert to platform remove callback returning void
> > >   net: wan/fsl_ucc_hdlc: Convert to platform remove callback returning
> > >     void
> > >   net: wan/ixp4xx_hss: Convert to platform remove callback returning
> > >     void
> > >   net: wwan: qcom_bam_dmux: Convert to platform remove callback
> > >     returning void
> > >   ieee802154: fakelb: Convert to platform remove callback returning void
> > >   ieee802154: hwsim: Convert to platform remove callback returning void  
> > 
> > FYI, I plan on taking patches 8 and 9 through wpan-next.  
> 
> I forgot to mention explicitly that there are no interdependencies in
> this series. So each maintainer picking up up their patches is fine.

Yes, no problem, it was quick to figure out.

Thanks,
Miquèl

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

* Re: [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void
  2023-12-04 18:30 [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-12-05  6:51 ` [PATCH net-next v2 0/9] net*: " Miquel Raynal
@ 2023-12-06  4:00 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-06  4:00 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
  Cc: davem, edumazet, kuba, pabeni, elder, netdev, kernel, mkl,
	nnac123, ansuelsmth, clement.leger, andrew, hkallweit1, linux,
	linux-renesas-soc, qiang.zhao, linuxppc-dev, linusw, kaloz,
	linux-arm-kernel, stephan, agross, andersson, konrad.dybcio,
	loic.poulain, ryazanov.s.a, johannes, linux-arm-msm, alex.aring,
	stefan, miquel.raynal, linux-wpan

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  4 Dec 2023 19:30:40 +0100 you wrote:
> Hello,
> 
> (implicit) v1 of this series can be found at
> https://lore.kernel.org/netdev/20231117095922.876489-1-u.kleine-koenig@pengutronix.de.
> Changes since then:
> 
>  - Dropped patch #1 as Alex objected. Patch #1 (was #2 before) now
>    converts ipa to remove_new() and introduces an error message in the
>    error path that failed before.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/9] net: ipa: Convert to platform remove callback returning void
    https://git.kernel.org/netdev/net-next/c/a92dbb9cdf04
  - [net-next,v2,2/9] net: fjes: Convert to platform remove callback returning void
    https://git.kernel.org/netdev/net-next/c/2ce19934a4dc
  - [net-next,v2,3/9] net: pcs: rzn1-miic: Convert to platform remove callback returning void
    https://git.kernel.org/netdev/net-next/c/e36dc85c245f
  - [net-next,v2,4/9] net: sfp: Convert to platform remove callback returning void
    https://git.kernel.org/netdev/net-next/c/bb1afee98466
  - [net-next,v2,5/9] net: wan/fsl_ucc_hdlc: Convert to platform remove callback returning void
    https://git.kernel.org/netdev/net-next/c/2d0c06fd39be
  - [net-next,v2,6/9] net: wan/ixp4xx_hss: Convert to platform remove callback returning void
    https://git.kernel.org/netdev/net-next/c/2d8590858753
  - [net-next,v2,7/9] net: wwan: qcom_bam_dmux: Convert to platform remove callback returning void
    https://git.kernel.org/netdev/net-next/c/a06041e2f4ae
  - [net-next,v2,8/9] ieee802154: fakelb: Convert to platform remove callback returning void
    (no matching commit)
  - [net-next,v2,9/9] ieee802154: hwsim: Convert to platform remove callback returning void
    (no matching commit)

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-12-06  4:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04 18:30 [PATCH net-next v2 0/9] net*: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-04 18:30 ` [PATCH net-next v2 8/9] ieee802154: fakelb: " Uwe Kleine-König
2023-12-04 18:30 ` [PATCH net-next v2 9/9] ieee802154: hwsim: " Uwe Kleine-König
2023-12-05  6:51 ` [PATCH net-next v2 0/9] net*: " Miquel Raynal
2023-12-05  7:39   ` Uwe Kleine-König
2023-12-05  7:50     ` Miquel Raynal
2023-12-06  4:00 ` patchwork-bot+netdevbpf

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).