hv_balloon: Replace spin_is_locked() with lockdep
authorLance Roy <ldr709@gmail.com>
Wed, 3 Oct 2018 05:38:48 +0000 (22:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Oct 2018 18:54:17 +0000 (20:54 +0200)
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>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/hv_balloon.c

index b1b7880827931b3eab896c80d16865cfa207c746..41631512ae97e3ab20a4d52e2b3614a03eb832a6 100644 (file)
@@ -689,7 +689,7 @@ static void hv_page_online_one(struct hv_hotadd_state *has, struct page *pg)
        __online_page_increment_counters(pg);
        __online_page_free(pg);
 
-       WARN_ON_ONCE(!spin_is_locked(&dm_device.ha_lock));
+       lockdep_assert_held(&dm_device.ha_lock);
        dm_device.num_pages_onlined++;
 }