This patch avoids that sparse complains about a missing declaration when building with CONFIG_MLX5_ESWITCH=n. Cc: Bodong Wang <bodong@xxxxxxxxxxxx> Cc: Mark Bloch <markb@xxxxxxxxxxxx> Cc: Saeed Mahameed <saeedm@xxxxxxxxxxxx> Fixes: f0666f1f22b5 ("IB/mlx5: Use unified register/load function for uplink and VF vports") # v5.1-rc1. Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- drivers/infiniband/hw/mlx5/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 994c19d01211..bfecb75059ae 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -6476,6 +6476,7 @@ static const struct mlx5_ib_profile pf_profile = { mlx5_ib_stage_delay_drop_cleanup), }; +#ifdef CONFIG_MLX5_ESWITCH const struct mlx5_ib_profile uplink_rep_profile = { STAGE_CREATE(MLX5_IB_STAGE_INIT, mlx5_ib_stage_init_init, @@ -6520,6 +6521,7 @@ const struct mlx5_ib_profile uplink_rep_profile = { mlx5_ib_stage_post_ib_reg_umr_init, NULL), }; +#endif static void *mlx5_ib_add_slave_port(struct mlx5_core_dev *mdev) { -- 2.21.0.155.ge902e9bcae20