From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E39411CBC for ; Fri, 23 Jun 2023 19:29:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B91CFC433CB; Fri, 23 Jun 2023 19:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687548568; bh=JA8JCn/mVtYO9vYTkPzLQY/2LVuvj+iiiUlQqUkXE+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=clw1ShAe/7Kh5nSWZ92UqiO+r2oT9BXnmj4Bc5x7GZvR8u0g2hXxadAwUayvvNSjr nsAOPSliJmxwldMZXOefQKosywi1Vmu1ltHytGrJ3N9lY9CjR7CNau+W58eRVUXrjR DLWFcpg1V4LVFin9CSrxQGwSlbMBUXDe666fsx+bv1H6jerpcXFRMYJ9XRWtXhyGLc QpMToQTKxPeEIaCVUwA8JW4WiNHkqaV+V4ydcXviEtm1hSABMZeKgEK/WA478Z3ZgH JU/eR1jl/+vfzPTdL61c9Nl7ucy1k4athuSfhdITmmnw18A38w7ZcHrQeo44/HqLxM rhl64TprqGUuw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Jiri Pirko , Shay Drory Subject: [net-next V2 14/15] net/mlx5: Remove redundant check from mlx5_esw_query_vport_vhca_id() Date: Fri, 23 Jun 2023 12:29:06 -0700 Message-ID: <20230623192907.39033-15-saeed@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230623192907.39033-1-saeed@kernel.org> References: <20230623192907.39033-1-saeed@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jiri Pirko Since mlx5_esw_query_vport_vhca_id() could be called either from mlx5_esw_vport_enable() or mlx5_esw_vport_disable() where the the check is done, this is always false here. Remove the redundant check. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index cf58295ad7e2..bdfe609cc9ec 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -3961,9 +3961,6 @@ static int mlx5_esw_query_vport_vhca_id(struct mlx5_eswitch *esw, u16 vport_num, int err; *vhca_id = 0; - if (mlx5_esw_is_manager_vport(esw, vport_num) || - !MLX5_CAP_GEN(esw->dev, vhca_resource_manager)) - return -EPERM; query_ctx = kzalloc(query_out_sz, GFP_KERNEL); if (!query_ctx) -- 2.41.0