Commit 68a84a12 authored by Horatiu Vultur's avatar Horatiu Vultur Committed by Jakub Kicinski

net: lan966x: Change lan966x_police_del return type

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: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: default avatarAlvin Šipraga <alsi@bang-olufsen.dk>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230312195155.1492881-1-horatiu.vultur@microchip.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent bcc85868
...@@ -49,8 +49,7 @@ static int lan966x_police_add(struct lan966x_port *port, ...@@ -49,8 +49,7 @@ static int lan966x_police_add(struct lan966x_port *port,
return 0; return 0;
} }
static int lan966x_police_del(struct lan966x_port *port, static void lan966x_police_del(struct lan966x_port *port, u16 pol_idx)
u16 pol_idx)
{ {
struct lan966x *lan966x = port->lan966x; struct lan966x *lan966x = port->lan966x;
...@@ -67,8 +66,6 @@ static int lan966x_police_del(struct lan966x_port *port, ...@@ -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)) | lan_wr(ANA_POL_PIR_CFG_PIR_RATE_SET(GENMASK(14, 0)) |
ANA_POL_PIR_CFG_PIR_BURST_SET(0), ANA_POL_PIR_CFG_PIR_BURST_SET(0),
lan966x, ANA_POL_PIR_CFG(pol_idx)); lan966x, ANA_POL_PIR_CFG(pol_idx));
return 0;
} }
static int lan966x_police_validate(struct lan966x_port *port, static int lan966x_police_validate(struct lan966x_port *port,
...@@ -186,7 +183,6 @@ int lan966x_police_port_del(struct lan966x_port *port, ...@@ -186,7 +183,6 @@ int lan966x_police_port_del(struct lan966x_port *port,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct lan966x *lan966x = port->lan966x; struct lan966x *lan966x = port->lan966x;
int err;
if (port->tc.police_id != police_id) { if (port->tc.police_id != police_id) {
NL_SET_ERR_MSG_MOD(extack, NL_SET_ERR_MSG_MOD(extack,
...@@ -194,12 +190,7 @@ int lan966x_police_port_del(struct lan966x_port *port, ...@@ -194,12 +190,7 @@ int lan966x_police_port_del(struct lan966x_port *port,
return -EINVAL; return -EINVAL;
} }
err = lan966x_police_del(port, POL_IDX_PORT + port->chip_port); 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;
}
lan_rmw(ANA_POL_CFG_PORT_POL_ENA_SET(0) | lan_rmw(ANA_POL_CFG_PORT_POL_ENA_SET(0) |
ANA_POL_CFG_POL_ORDER_SET(POL_ORDER), ANA_POL_CFG_POL_ORDER_SET(POL_ORDER),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment