linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers
@ 2022-01-29 11:55 Sergey Shtylyov
  2022-01-29 11:55 ` [PATCH v2 1/2] ravb: ravb_close() always returns 0 Sergey Shtylyov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sergey Shtylyov @ 2022-01-29 11:55 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev; +Cc: linux-renesas-soc

Here are 2 patches against DaveM's 'net-next.git' repo. The Renesas drivers
call their ndo_stop() methods directly and they always return 0, making the
result checks pointless, hence remove them...

Sergey Shtylyov (2):
  ravb: ravb_close() always returns 0
  sh_eth: sh_eth_close() always returns 0

 drivers/net/ethernet/renesas/ravb_main.c | 5 +----
 drivers/net/ethernet/renesas/sh_eth.c    | 4 +---
 2 files changed, 2 insertions(+), 7 deletions(-)

-- 
2.26.3


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

* [PATCH v2 1/2] ravb: ravb_close() always returns 0
  2022-01-29 11:55 [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers Sergey Shtylyov
@ 2022-01-29 11:55 ` Sergey Shtylyov
  2022-02-01  8:55   ` Geert Uytterhoeven
  2022-01-29 11:55 ` [PATCH v2 2/2] sh_eth: sh_eth_close() " Sergey Shtylyov
  2022-01-31 11:50 ` [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers patchwork-bot+netdevbpf
  2 siblings, 1 reply; 7+ messages in thread
From: Sergey Shtylyov @ 2022-01-29 11:55 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev; +Cc: linux-renesas-soc

ravb_close() always returns 0, hence the check in ravb_wol_restore() is
pointless (however, we cannot change the prototype of ravb_close() as it
implements the driver's ndo_stop() method).

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- removed no longer used local variable in ravb_wol_restore().

 drivers/net/ethernet/renesas/ravb_main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index b215cde68e10..9ee246796a77 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2854,7 +2854,6 @@ static int ravb_wol_restore(struct net_device *ndev)
 {
 	struct ravb_private *priv = netdev_priv(ndev);
 	const struct ravb_hw_info *info = priv->info;
-	int ret;
 
 	if (info->nc_queues)
 		napi_enable(&priv->napi[RAVB_NC]);
@@ -2863,9 +2862,7 @@ static int ravb_wol_restore(struct net_device *ndev)
 	/* Disable MagicPacket */
 	ravb_modify(ndev, ECMR, ECMR_MPDE, 0);
 
-	ret = ravb_close(ndev);
-	if (ret < 0)
-		return ret;
+	ravb_close(ndev);
 
 	return disable_irq_wake(priv->emac_irq);
 }
-- 
2.26.3


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

* [PATCH v2 2/2] sh_eth: sh_eth_close() always returns 0
  2022-01-29 11:55 [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers Sergey Shtylyov
  2022-01-29 11:55 ` [PATCH v2 1/2] ravb: ravb_close() always returns 0 Sergey Shtylyov
@ 2022-01-29 11:55 ` Sergey Shtylyov
  2022-02-01  8:58   ` Geert Uytterhoeven
  2022-01-31 11:50 ` [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers patchwork-bot+netdevbpf
  2 siblings, 1 reply; 7+ messages in thread
From: Sergey Shtylyov @ 2022-01-29 11:55 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev; +Cc: linux-renesas-soc

sh_eth_close() always returns 0, hence the check in sh_eth_wol_restore()
is pointless (however we cannot change the prototype of sh_eth_close() as
it implements the driver's ndo_stop() method).

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/net/ethernet/renesas/sh_eth.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index d947a628e166..b21e101b4484 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -3450,9 +3450,7 @@ static int sh_eth_wol_restore(struct net_device *ndev)
 	 * both be reset and all registers restored. This is what
 	 * happens during suspend and resume without WoL enabled.
 	 */
-	ret = sh_eth_close(ndev);
-	if (ret < 0)
-		return ret;
+	sh_eth_close(ndev);
 	ret = sh_eth_open(ndev);
 	if (ret < 0)
 		return ret;
-- 
2.26.3


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

* Re: [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers
  2022-01-29 11:55 [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers Sergey Shtylyov
  2022-01-29 11:55 ` [PATCH v2 1/2] ravb: ravb_close() always returns 0 Sergey Shtylyov
  2022-01-29 11:55 ` [PATCH v2 2/2] sh_eth: sh_eth_close() " Sergey Shtylyov
@ 2022-01-31 11:50 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-31 11:50 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: davem, kuba, netdev, linux-renesas-soc

Hello:

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

On Sat, 29 Jan 2022 14:55:15 +0300 you wrote:
> Here are 2 patches against DaveM's 'net-next.git' repo. The Renesas drivers
> call their ndo_stop() methods directly and they always return 0, making the
> result checks pointless, hence remove them...
> 
> Sergey Shtylyov (2):
>   ravb: ravb_close() always returns 0
>   sh_eth: sh_eth_close() always returns 0
> 
> [...]

Here is the summary with links:
  - [v2,1/2] ravb: ravb_close() always returns 0
    https://git.kernel.org/netdev/net-next/c/be94a51f3e5e
  - [v2,2/2] sh_eth: sh_eth_close() always returns 0
    https://git.kernel.org/netdev/net-next/c/e7d966f9ea52

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

* Re: [PATCH v2 1/2] ravb: ravb_close() always returns 0
  2022-01-29 11:55 ` [PATCH v2 1/2] ravb: ravb_close() always returns 0 Sergey Shtylyov
@ 2022-02-01  8:55   ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2022-02-01  8:55 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: David S. Miller, Jakub Kicinski, netdev, Linux-Renesas

On Tue, Feb 1, 2022 at 3:00 AM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
> ravb_close() always returns 0, hence the check in ravb_wol_restore() is
> pointless (however, we cannot change the prototype of ravb_close() as it
> implements the driver's ndo_stop() method).
>
> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
> analysis tool.
>
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v2 2/2] sh_eth: sh_eth_close() always returns 0
  2022-01-29 11:55 ` [PATCH v2 2/2] sh_eth: sh_eth_close() " Sergey Shtylyov
@ 2022-02-01  8:58   ` Geert Uytterhoeven
  2022-02-02 14:57     ` Sergei Shtylyov
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2022-02-01  8:58 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: David S. Miller, Jakub Kicinski, netdev, Linux-Renesas

Hi Sergei,

On Tue, Feb 1, 2022 at 3:00 AM Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
> sh_eth_close() always returns 0, hence the check in sh_eth_wol_restore()
> is pointless (however we cannot change the prototype of sh_eth_close() as
> it implements the driver's ndo_stop() method).
>
> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
> analysis tool.
>
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Thanks for your patch!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Note that there's a second call in sh_eth_suspend().

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v2 2/2] sh_eth: sh_eth_close() always returns 0
  2022-02-01  8:58   ` Geert Uytterhoeven
@ 2022-02-02 14:57     ` Sergei Shtylyov
  0 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2022-02-02 14:57 UTC (permalink / raw)
  To: Geert Uytterhoeven, Sergey Shtylyov
  Cc: David S. Miller, Jakub Kicinski, netdev, Linux-Renesas

On 01.02.2022 11:58, Geert Uytterhoeven wrote:

[...]
>> sh_eth_close() always returns 0, hence the check in sh_eth_wol_restore()
>> is pointless (however we cannot change the prototype of sh_eth_close() as
>> it implements the driver's ndo_stop() method).
>>
>> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
>> analysis tool.
>>
>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> 
> Thanks for your patch!
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Note that there's a second call in sh_eth_suspend().

   Made no sense to change it. :-)

> Gr{oetje,eeting}s,
> 
>                          Geert

MBR, Sergey

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

end of thread, other threads:[~2022-02-02 14:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 11:55 [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers Sergey Shtylyov
2022-01-29 11:55 ` [PATCH v2 1/2] ravb: ravb_close() always returns 0 Sergey Shtylyov
2022-02-01  8:55   ` Geert Uytterhoeven
2022-01-29 11:55 ` [PATCH v2 2/2] sh_eth: sh_eth_close() " Sergey Shtylyov
2022-02-01  8:58   ` Geert Uytterhoeven
2022-02-02 14:57     ` Sergei Shtylyov
2022-01-31 11:50 ` [PATCH v2 0/2] Remove some dead code in the Renesas Ethernet drivers 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).