netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void
@ 2023-05-10 20:02 Uwe Kleine-König
  2023-05-11 10:17 ` Simon Horman
  2023-05-12  8:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-05-10 20:02 UTC (permalink / raw)
  To: Byungho An, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: netdev, kernel

sxgbe_drv_remove() returned zero unconditionally, so it can be converted
to return void without losing anything. The upside is that it becomes
more obvious in its callers that there is no error to handle.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h   | 2 +-
 drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c     | 4 +---
 drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 5 +++--
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h b/drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h
index 0f45107db8dd..d14e0cfc3a6b 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h
@@ -511,7 +511,7 @@ struct sxgbe_priv_data {
 struct sxgbe_priv_data *sxgbe_drv_probe(struct device *device,
 					struct sxgbe_plat_data *plat_dat,
 					void __iomem *addr);
-int sxgbe_drv_remove(struct net_device *ndev);
+void sxgbe_drv_remove(struct net_device *ndev);
 void sxgbe_set_ethtool_ops(struct net_device *netdev);
 int sxgbe_mdio_unregister(struct net_device *ndev);
 int sxgbe_mdio_register(struct net_device *ndev);
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
index 9664f029fa16..71439825ea4e 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
@@ -2203,7 +2203,7 @@ struct sxgbe_priv_data *sxgbe_drv_probe(struct device *device,
  * Description: this function resets the TX/RX processes, disables the MAC RX/TX
  * changes the link status, releases the DMA descriptor rings.
  */
-int sxgbe_drv_remove(struct net_device *ndev)
+void sxgbe_drv_remove(struct net_device *ndev)
 {
 	struct sxgbe_priv_data *priv = netdev_priv(ndev);
 	u8 queue_num;
@@ -2231,8 +2231,6 @@ int sxgbe_drv_remove(struct net_device *ndev)
 	kfree(priv->hw);
 
 	free_netdev(ndev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
index 4e5526303f07..fb59ff94509a 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
@@ -172,9 +172,10 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
 static int sxgbe_platform_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
-	int ret = sxgbe_drv_remove(ndev);
 
-	return ret;
+	sxgbe_drv_remove(ndev);
+
+	return 0;
 }
 
 #ifdef CONFIG_PM

base-commit: ac9a78681b921877518763ba0e89202254349d1b
-- 
2.39.2


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

* Re: [PATCH net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void
  2023-05-10 20:02 [PATCH net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void Uwe Kleine-König
@ 2023-05-11 10:17 ` Simon Horman
  2023-05-11 10:28   ` Simon Horman
  2023-05-12  8:00 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Horman @ 2023-05-11 10:17 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Byungho An, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, kernel

On Wed, May 10, 2023 at 10:02:47PM +0200, Uwe Kleine-König wrote:
> sxgbe_drv_remove() returned zero unconditionally, so it can be converted
> to return void without losing anything. The upside is that it becomes
> more obvious in its callers that there is no error to handle.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Simon Horman <simon.horman@corigine.com>


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

* Re: [PATCH net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void
  2023-05-11 10:17 ` Simon Horman
@ 2023-05-11 10:28   ` Simon Horman
  2023-05-11 10:45     ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2023-05-11 10:28 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Byungho An, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, kernel

On Thu, May 11, 2023 at 12:17:40PM +0200, Simon Horman wrote:
> On Wed, May 10, 2023 at 10:02:47PM +0200, Uwe Kleine-König wrote:
> > sxgbe_drv_remove() returned zero unconditionally, so it can be converted
> > to return void without losing anything. The upside is that it becomes
> > more obvious in its callers that there is no error to handle.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Reviewed-by: Simon Horman <simon.horman@corigine.com>

Sorry, minor nit.
Perhaps the subject prefix should be 'net: sxgbe: ', for consistency.
Or 'sxgbe: ' because the 'net: ' part is largely meaningless.

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

* Re: [PATCH net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void
  2023-05-11 10:28   ` Simon Horman
@ 2023-05-11 10:45     ` Uwe Kleine-König
  2023-05-11 10:51       ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2023-05-11 10:45 UTC (permalink / raw)
  To: Simon Horman
  Cc: Byungho An, netdev, Eric Dumazet, kernel, Jakub Kicinski,
	Paolo Abeni, David S. Miller

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

On Thu, May 11, 2023 at 12:28:54PM +0200, Simon Horman wrote:
> On Thu, May 11, 2023 at 12:17:40PM +0200, Simon Horman wrote:
> > On Wed, May 10, 2023 at 10:02:47PM +0200, Uwe Kleine-König wrote:
> > > sxgbe_drv_remove() returned zero unconditionally, so it can be converted
> > > to return void without losing anything. The upside is that it becomes
> > > more obvious in its callers that there is no error to handle.
> > > 
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > 
> > Reviewed-by: Simon Horman <simon.horman@corigine.com>
> 
> Sorry, minor nit.
> Perhaps the subject prefix should be 'net: sxgbe: ', for consistency.
> Or 'sxgbe: ' because the 'net: ' part is largely meaningless.

I'd not drop "net:". Looking at the output of

	git log --format=%s next/master -- drivers/net/ethernet/samsung/sxgbe/ | sed 's/:[^:]*$//' | sort | uniq -c | sort -n

the clear winner is "net: sxgbe: ".

If and when I will resend this patch, I'll adapt accordingly. If it's
taken as is (or the committer adapts the subject line) that's fine for
me, too.

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 net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void
  2023-05-11 10:45     ` Uwe Kleine-König
@ 2023-05-11 10:51       ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2023-05-11 10:51 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Byungho An, netdev, Eric Dumazet, kernel, Jakub Kicinski,
	Paolo Abeni, David S. Miller

On Thu, May 11, 2023 at 12:45:09PM +0200, Uwe Kleine-König wrote:
> On Thu, May 11, 2023 at 12:28:54PM +0200, Simon Horman wrote:
> > On Thu, May 11, 2023 at 12:17:40PM +0200, Simon Horman wrote:
> > > On Wed, May 10, 2023 at 10:02:47PM +0200, Uwe Kleine-König wrote:
> > > > sxgbe_drv_remove() returned zero unconditionally, so it can be converted
> > > > to return void without losing anything. The upside is that it becomes
> > > > more obvious in its callers that there is no error to handle.
> > > > 
> > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > 
> > > Reviewed-by: Simon Horman <simon.horman@corigine.com>
> > 
> > Sorry, minor nit.
> > Perhaps the subject prefix should be 'net: sxgbe: ', for consistency.
> > Or 'sxgbe: ' because the 'net: ' part is largely meaningless.
> 
> I'd not drop "net:". Looking at the output of
> 
> 	git log --format=%s next/master -- drivers/net/ethernet/samsung/sxgbe/ | sed 's/:[^:]*$//' | sort | uniq -c | sort -n
> 
> the clear winner is "net: sxgbe: ".
> 
> If and when I will resend this patch, I'll adapt accordingly. If it's
> taken as is (or the committer adapts the subject line) that's fine for
> me, too.

Thanks, that's good for me on all counts.


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

* Re: [PATCH net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void
  2023-05-10 20:02 [PATCH net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void Uwe Kleine-König
  2023-05-11 10:17 ` Simon Horman
@ 2023-05-12  8:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-12  8:00 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
  Cc: bh74.an, davem, edumazet, kuba, pabeni, netdev, kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Wed, 10 May 2023 22:02:47 +0200 you wrote:
> sxgbe_drv_remove() returned zero unconditionally, so it can be converted
> to return void without losing anything. The upside is that it becomes
> more obvious in its callers that there is no error to handle.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h   | 2 +-
>  drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c     | 4 +---
>  drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 5 +++--
>  3 files changed, 5 insertions(+), 6 deletions(-)
> 
> [...]

Here is the summary with links:
  - [net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void
    https://git.kernel.org/netdev/net-next/c/7f88efc8162c

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10 20:02 [PATCH net-next] net: samsung: sxgbe: Make sxgbe_drv_remove() return void Uwe Kleine-König
2023-05-11 10:17 ` Simon Horman
2023-05-11 10:28   ` Simon Horman
2023-05-11 10:45     ` Uwe Kleine-König
2023-05-11 10:51       ` Simon Horman
2023-05-12  8: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).