summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
index d73668dcc6b6..82d5138f149e 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
@@ -551,12 +551,16 @@ static int sparx5_tc_add_rule_link(struct vcap_control *vctrl,
struct vcap_admin *to_admin = vcap_find_admin(vctrl, to_cid);
int diff, err = 0;
- diff = vcap_chain_offset(vctrl, from_cid, to_cid);
- if (!(to_admin && diff > 0)) {
+ if (!to_admin) {
pr_err("%s:%d: unsupported chain direction: %d\n",
__func__, __LINE__, to_cid);
return -EINVAL;
}
+
+ diff = vcap_chain_offset(vctrl, from_cid, to_cid);
+ if (!diff)
+ return 0;
+
if (admin->vtype == VCAP_TYPE_IS0 &&
to_admin->vtype == VCAP_TYPE_IS0) {
/* Between IS0 instances the G_IDX value is used */