* [PATCH net-next] net: lan966x: Change lan966x_police_del return type
@ 2023-03-12 19:51 Horatiu Vultur
2023-03-12 20:29 ` Alvin Šipraga
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Horatiu Vultur @ 2023-03-12 19:51 UTC (permalink / raw)
To: netdev, linux-kernel; +Cc: davem, edumazet, kuba, pabeni, Horatiu Vultur
As the function always returns 0 change the return type to be
void instead of int. In this way also remove a wrong message
in case of error which would never happen.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
.../net/ethernet/microchip/lan966x/lan966x_police.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_police.c b/drivers/net/ethernet/microchip/lan966x/lan966x_police.c
index 7d66fe75cd3bf..7302df2300fd2 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_police.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_police.c
@@ -49,8 +49,7 @@ static int lan966x_police_add(struct lan966x_port *port,
return 0;
}
-static int lan966x_police_del(struct lan966x_port *port,
- u16 pol_idx)
+static void lan966x_police_del(struct lan966x_port *port, u16 pol_idx)
{
struct lan966x *lan966x = port->lan966x;
@@ -67,8 +66,6 @@ static int lan966x_police_del(struct lan966x_port *port,
lan_wr(ANA_POL_PIR_CFG_PIR_RATE_SET(GENMASK(14, 0)) |
ANA_POL_PIR_CFG_PIR_BURST_SET(0),
lan966x, ANA_POL_PIR_CFG(pol_idx));
-
- return 0;
}
static int lan966x_police_validate(struct lan966x_port *port,
@@ -186,7 +183,6 @@ int lan966x_police_port_del(struct lan966x_port *port,
struct netlink_ext_ack *extack)
{
struct lan966x *lan966x = port->lan966x;
- int err;
if (port->tc.police_id != police_id) {
NL_SET_ERR_MSG_MOD(extack,
@@ -194,12 +190,7 @@ int lan966x_police_port_del(struct lan966x_port *port,
return -EINVAL;
}
- err = lan966x_police_del(port, POL_IDX_PORT + port->chip_port);
- if (err) {
- NL_SET_ERR_MSG_MOD(extack,
- "Failed to add policer to port");
- return err;
- }
+ lan966x_police_del(port, POL_IDX_PORT + port->chip_port);
lan_rmw(ANA_POL_CFG_PORT_POL_ENA_SET(0) |
ANA_POL_CFG_POL_ORDER_SET(POL_ORDER),
--
2.38.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: lan966x: Change lan966x_police_del return type
2023-03-12 19:51 [PATCH net-next] net: lan966x: Change lan966x_police_del return type Horatiu Vultur
@ 2023-03-12 20:29 ` Alvin Šipraga
2023-03-13 19:01 ` Simon Horman
2023-03-15 7:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Alvin Šipraga @ 2023-03-12 20:29 UTC (permalink / raw)
To: Horatiu Vultur; +Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni
On Sun, Mar 12, 2023 at 08:51:55PM +0100, Horatiu Vultur wrote:
> As the function always returns 0 change the return type to be
> void instead of int. In this way also remove a wrong message
> in case of error which would never happen.
>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: lan966x: Change lan966x_police_del return type
2023-03-12 19:51 [PATCH net-next] net: lan966x: Change lan966x_police_del return type Horatiu Vultur
2023-03-12 20:29 ` Alvin Šipraga
@ 2023-03-13 19:01 ` Simon Horman
2023-03-15 7:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-03-13 19:01 UTC (permalink / raw)
To: Horatiu Vultur; +Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni
On Sun, Mar 12, 2023 at 08:51:55PM +0100, Horatiu Vultur wrote:
> As the function always returns 0 change the return type to be
> void instead of int. In this way also remove a wrong message
> in case of error which would never happen.
>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: lan966x: Change lan966x_police_del return type
2023-03-12 19:51 [PATCH net-next] net: lan966x: Change lan966x_police_del return type Horatiu Vultur
2023-03-12 20:29 ` Alvin Šipraga
2023-03-13 19:01 ` Simon Horman
@ 2023-03-15 7:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-15 7:30 UTC (permalink / raw)
To: Horatiu Vultur; +Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sun, 12 Mar 2023 20:51:55 +0100 you wrote:
> As the function always returns 0 change the return type to be
> void instead of int. In this way also remove a wrong message
> in case of error which would never happen.
>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
> .../net/ethernet/microchip/lan966x/lan966x_police.c | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
Here is the summary with links:
- [net-next] net: lan966x: Change lan966x_police_del return type
https://git.kernel.org/netdev/net-next/c/68a84a127bb0
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] 4+ messages in thread
end of thread, other threads:[~2023-03-15 7:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-12 19:51 [PATCH net-next] net: lan966x: Change lan966x_police_del return type Horatiu Vultur
2023-03-12 20:29 ` Alvin Šipraga
2023-03-13 19:01 ` Simon Horman
2023-03-15 7:30 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.