net/mlx5: Remove redundant SF supported check from mlx5_sf_hw_table_init()
authorJiri Pirko <jiri@nvidia.com>
Fri, 30 Jun 2023 07:32:14 +0000 (09:32 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 14 Aug 2023 21:40:21 +0000 (14:40 -0700)
Since mlx5_sf_supported() check is done as a first thing in
mlx5_sf_max_functions(), remove the redundant check.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c

index c4daeaa..1f61332 100644 (file)
@@ -275,15 +275,14 @@ int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev)
        struct mlx5_sf_hw_table *table;
        u16 max_ext_fn = 0;
        u16 ext_base_id = 0;
-       u16 max_fn = 0;
        u16 base_id;
+       u16 max_fn;
        int err;
 
        if (!mlx5_vhca_event_supported(dev))
                return 0;
 
-       if (mlx5_sf_supported(dev))
-               max_fn = mlx5_sf_max_functions(dev);
+       max_fn = mlx5_sf_max_functions(dev);
 
        err = mlx5_esw_sf_max_hpf_functions(dev, &max_ext_fn, &ext_base_id);
        if (err)