igbvf: Replace spin_is_locked() with lockdep

lockdep_assert_held() is better suited to checking locking requirements,
since it won't get confused when someone else holds the lock. This is
also a step towards possibly removing spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
Lance Roy 2018-10-02 22:38:51 -07:00 коммит произвёл Jeff Kirsher
Родитель 7c588c7468
Коммит b86077207d
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -241,7 +241,7 @@ static s32 e1000_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size)
s32 err; s32 err;
u16 i; u16 i;
WARN_ON_ONCE(!spin_is_locked(&hw->mbx_lock)); lockdep_assert_held(&hw->mbx_lock);
/* lock the mailbox to prevent pf/vf race condition */ /* lock the mailbox to prevent pf/vf race condition */
err = e1000_obtain_mbx_lock_vf(hw); err = e1000_obtain_mbx_lock_vf(hw);
@ -279,7 +279,7 @@ static s32 e1000_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size)
s32 err; s32 err;
u16 i; u16 i;
WARN_ON_ONCE(!spin_is_locked(&hw->mbx_lock)); lockdep_assert_held(&hw->mbx_lock);
/* lock the mailbox to prevent pf/vf race condition */ /* lock the mailbox to prevent pf/vf race condition */
err = e1000_obtain_mbx_lock_vf(hw); err = e1000_obtain_mbx_lock_vf(hw);