From a4d9f26b009647db14fbf24479245227e712d35d Mon Sep 17 00:00:00 2001 From: Jon Medhurst Date: Thu, 6 Feb 2014 14:13:16 +0000 Subject: Fix assert in bakery_lock_release() bakery_lock_release() expects an mpidr as the first argument however bakery_lock_release() is calling it with the 'entry' argument it has calculated. Rather than fixing this to pass the mpidr value it would be much more efficient to just replace the call with assert(bakery->owner == entry) As this leaves no remaining users of bakery_lock_held(), we might as well delete it. Fixes ARM-software/tf-issues#27 Signed-off-by: Jon Medhurst --- lib/sync/locks/bakery/bakery_lock.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/sync/locks/bakery/bakery_lock.c b/lib/sync/locks/bakery/bakery_lock.c index 96412482..444b6a18 100644 --- a/lib/sync/locks/bakery/bakery_lock.c +++ b/lib/sync/locks/bakery/bakery_lock.c @@ -88,17 +88,8 @@ void bakery_lock_release(unsigned long mpidr, bakery_lock * bakery) unsigned int entry = platform_get_core_pos(mpidr); assert_bakery_entry_valid(entry, bakery); - assert(bakery_lock_held(entry, bakery)); + assert(bakery->owner == entry); bakery->owner = NO_OWNER; bakery->number[entry] = 0; } - -int bakery_lock_held(unsigned long mpidr, const bakery_lock * bakery) -{ - unsigned int entry = platform_get_core_pos(mpidr); - - assert_bakery_entry_valid(entry, bakery); - - return bakery->owner == entry; -} -- cgit