Re: [PATCH v2 2/3] lockdep: add lockdep lock state defines

2 messages, 2 authors, 2021-02-26 · open the first message on its own page

Re: [PATCH v2 2/3] lockdep: add lockdep lock state defines

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2021-02-26 18:05:16

quoted hunk
@@ -5475,7 +5476,7 @@ noinstr int lock_is_held_type(const struct lockdep_map *lock, int read)
 		/* avoid false negative lockdep_assert_not_held()
 		 * and lockdep_assert_held()
 		 */
-		return -1;
+		return LOCK_STATE_UNKNOWN;
I'd argue that then the other two return places here should also be
changed.

johannes

Re: [PATCH v2 2/3] lockdep: add lockdep lock state defines

From: Shuah Khan <skhan@linuxfoundation.org>
Date: 2021-02-26 18:17:50

On 2/26/21 11:03 AM, Johannes Berg wrote:
quoted
@@ -5475,7 +5476,7 @@ noinstr int lock_is_held_type(const struct lockdep_map *lock, int read)
  		/* avoid false negative lockdep_assert_not_held()
  		 * and lockdep_assert_held()
  		 */
-		return -1;
+		return LOCK_STATE_UNKNOWN;
I'd argue that then the other two return places here should also be
changed.
Makes sense.

Since lock_is_held_type() simply returns what  __lock_is_held() for the
other cases, __lock_is_held() is the one that needs changes to use these 
defines.

thanks,
-- Shuah



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help