From: Jiri Pirko Date: Thu, 1 Jun 2023 07:17:17 +0000 (+0200) Subject: net/mlx5: Remove pointless vport lookup from mlx5_esw_check_port_type() X-Git-Tag: v6.6.7~2536^2~12^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29e4c95faee52a9b7a4f1293cb92cd17a0b5fd91;p=platform%2Fkernel%2Flinux-starfive.git net/mlx5: Remove pointless vport lookup from mlx5_esw_check_port_type() As xa_get_mark() returns false in case the entry is not present, no need to redundantly check if vport is present. Remove the lookup. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index b4e4658..faec7d7 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1908,12 +1908,6 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, static bool mlx5_esw_check_port_type(struct mlx5_eswitch *esw, u16 vport_num, xa_mark_t mark) { - struct mlx5_vport *vport; - - vport = mlx5_eswitch_get_vport(esw, vport_num); - if (IS_ERR(vport)) - return false; - return xa_get_mark(&esw->vports, vport_num, mark); }