netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Dan Carpenter <dan.carpenter@oracle.com>
Subject: [net-next 02/15] net/mlx5: delete dead code in mlx5_esw_unlock()
Date: Wed, 29 Jun 2022 17:59:52 -0700	[thread overview]
Message-ID: <20220630010005.145775-3-saeed@kernel.org> (raw)
In-Reply-To: <20220630010005.145775-1-saeed@kernel.org>

From: Dan Carpenter <dan.carpenter@oracle.com>

Smatch complains about this function:

    drivers/net/ethernet/mellanox/mlx5/core/eswitch.c:2000 mlx5_esw_unlock()
    warn: inconsistent returns '&esw->mode_lock'.

Before commit ec2fa47d7b98 ("net/mlx5: Lag, use lag lock") there
used to be a matching mlx5_esw_lock() function and the lock and
unlock functions were symmetric.  But now we take the lock
unconditionally and must unlock unconditionally as well.

As near as I can tell this is dead code and can just be deleted.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 719ef26d23c0..3e662e389be4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1995,8 +1995,6 @@ int mlx5_esw_try_lock(struct mlx5_eswitch *esw)
  */
 void mlx5_esw_unlock(struct mlx5_eswitch *esw)
 {
-	if (!mlx5_esw_allowed(esw))
-		return;
 	up_write(&esw->mode_lock);
 }
 
-- 
2.36.1


  parent reply	other threads:[~2022-06-30  1:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30  0:59 [pull request][net-next 00/15] mlx5 updates 2022-06-29 Saeed Mahameed
2022-06-30  0:59 ` [net-next 01/15] net/mlx5: Delete ipsec_fs header file as not used Saeed Mahameed
2022-06-30  0:59 ` Saeed Mahameed [this message]
2022-06-30  0:59 ` [net-next 03/15] net/mlx5: E-switch, Introduce flag to indicate if vport acl namespace is created Saeed Mahameed
2022-06-30  0:59 ` [net-next 04/15] net/mlx5: E-switch, Introduce flag to indicate if fdb table " Saeed Mahameed
2022-06-30  0:59 ` [net-next 05/15] net/mlx5: E-switch, Remove dependency between sriov and eswitch mode Saeed Mahameed
2022-06-30  0:59 ` [net-next 06/15] net/mlx5: E-switch: Change eswitch mode only via devlink command Saeed Mahameed
2022-06-30  0:59 ` [net-next 07/15] net/mlx5: Add support to create SQ and CQ for ASO Saeed Mahameed
2022-06-30  0:59 ` [net-next 08/15] net/mlx5: Implement interfaces to control ASO SQ and CQ Saeed Mahameed
2022-06-30  0:59 ` [net-next 09/15] net/mlx5e: Prepare for flow meter offload if hardware supports it Saeed Mahameed
2022-07-01  3:09   ` Jakub Kicinski
2022-06-30  1:00 ` [net-next 10/15] net/mlx5e: Add support to modify hardware flow meter parameters Saeed Mahameed
2022-06-30  1:00 ` [net-next 11/15] net/mlx5e: Get or put meter by the index of tc police action Saeed Mahameed
2022-06-30  1:00 ` [net-next 12/15] net/mlx5e: Add generic macros to use metadata register mapping Saeed Mahameed
2022-06-30  1:00 ` [net-next 13/15] net/mlx5e: Add post meter table for flow metering Saeed Mahameed
2022-06-30  1:00 ` [net-next 14/15] net/mlx5e: Add flow_action to parse state Saeed Mahameed
2022-06-30  1:00 ` [net-next 15/15] net/mlx5e: TC, Support offloading police action Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220630010005.145775-3-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).