Skip to content

Commit

Permalink
ACPI: OSL: Add missing __acquires/__releases annotations
Browse files Browse the repository at this point in the history
Sparse reports a warnings at acpi_os_acquire_lock() and
acpi_os_release_lock():

warning: context imbalance in acpi_os_acquire_lock() - unexpected unlock

warning: context imbalance in acpi_os_release_lock() - unexpected unlock

which result from missing __acquires/__releases annotations.

Add the annotations as appropriate to get rid of the warnings.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
[ rjw: Two patches merged into one, subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Jules Irenge authored and Rafael J. Wysocki committed Mar 4, 2020
1 parent 98d54f8 commit 2288eba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@ void acpi_os_delete_lock(acpi_spinlock handle)
*/

acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp)
__acquires(lockp)
{
acpi_cpu_flags flags;
spin_lock_irqsave(lockp, flags);
Expand All @@ -1609,6 +1610,7 @@ acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp)
*/

void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags flags)
__releases(lockp)
{
spin_unlock_irqrestore(lockp, flags);
}
Expand Down

0 comments on commit 2288eba

Please sign in to comment.