aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-08-13 14:21:34 -0400
committerMatt Fleming <matt.fleming@intel.com>2014-08-22 03:45:40 -0400
commitaee530cfecf4f3ec83b78406bac618cec35853f8 (patch)
tree612a0735dd8797f3ca0cfe47693f2350bdae7049 /drivers/firmware
parent7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff)
firmware: Do not use WARN_ON(!spin_is_locked())
spin_is_locked() always returns false for uniprocessor configurations in several architectures, so do not use WARN_ON with it. Use lockdep_assert_held() instead to also reduce overhead in non-debug kernels. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: <stable@vger.kernel.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/vars.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c
index f0a43646a2f3..5abe943e3404 100644
--- a/drivers/firmware/efi/vars.c
+++ b/drivers/firmware/efi/vars.c
@@ -481,7 +481,7 @@ EXPORT_SYMBOL_GPL(efivar_entry_remove);
481 */ 481 */
482static void efivar_entry_list_del_unlock(struct efivar_entry *entry) 482static void efivar_entry_list_del_unlock(struct efivar_entry *entry)
483{ 483{
484 WARN_ON(!spin_is_locked(&__efivars->lock)); 484 lockdep_assert_held(&__efivars->lock);
485 485
486 list_del(&entry->list); 486 list_del(&entry->list);
487 spin_unlock_irq(&__efivars->lock); 487 spin_unlock_irq(&__efivars->lock);
@@ -507,7 +507,7 @@ int __efivar_entry_delete(struct efivar_entry *entry)
507 const struct efivar_operations *ops = __efivars->ops; 507 const struct efivar_operations *ops = __efivars->ops;
508 efi_status_t status; 508 efi_status_t status;
509 509
510 WARN_ON(!spin_is_locked(&__efivars->lock)); 510 lockdep_assert_held(&__efivars->lock);
511 511
512 status = ops->set_variable(entry->var.VariableName, 512 status = ops->set_variable(entry->var.VariableName,
513 &entry->var.VendorGuid, 513 &entry->var.VendorGuid,
@@ -667,7 +667,7 @@ struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid,
667 int strsize1, strsize2; 667 int strsize1, strsize2;
668 bool found = false; 668 bool found = false;
669 669
670 WARN_ON(!spin_is_locked(&__efivars->lock)); 670 lockdep_assert_held(&__efivars->lock);
671 671
672 list_for_each_entry_safe(entry, n, head, list) { 672 list_for_each_entry_safe(entry, n, head, list) {
673 strsize1 = ucs2_strsize(name, 1024); 673 strsize1 = ucs2_strsize(name, 1024);
@@ -739,7 +739,7 @@ int __efivar_entry_get(struct efivar_entry *entry, u32 *attributes,
739 const struct efivar_operations *ops = __efivars->ops; 739 const struct efivar_operations *ops = __efivars->ops;
740 efi_status_t status; 740 efi_status_t status;
741 741
742 WARN_ON(!spin_is_locked(&__efivars->lock)); 742 lockdep_assert_held(&__efivars->lock);
743 743
744 status = ops->get_variable(entry->var.VariableName, 744 status = ops->get_variable(entry->var.VariableName,
745 &entry->var.VendorGuid, 745 &entry->var.VendorGuid,