sfc: Replace spin_is_locked() with lockdep
authorLance Roy <ldr709@gmail.com>
Fri, 5 Oct 2018 06:45:41 +0000 (23:45 -0700)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Mon, 12 Nov 2018 17:06:22 +0000 (09:06 -0800)
lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
Cc: Bert Kenward <bkenward@solarflare.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
Acked-by: Edward Cree <ecree@solarflare.com>
drivers/net/ethernet/sfc/efx.c

index 98fe7e762e173324b180a2e67660cc8c3978ec13..3643015a55cf201888f4247e509c4cae96fa0991 100644 (file)
@@ -3167,7 +3167,7 @@ struct hlist_head *efx_rps_hash_bucket(struct efx_nic *efx,
 {
        u32 hash = efx_filter_spec_hash(spec);
 
-       WARN_ON(!spin_is_locked(&efx->rps_hash_lock));
+       lockdep_assert_held(&efx->rps_hash_lock);
        if (!efx->rps_hash_table)
                return NULL;
        return &efx->rps_hash_table[hash % EFX_ARFS_HASH_TABLE_SIZE];