Message ID | cover.1614355914.git.skhan@linuxfoundation.org |
---|---|
Headers | show |
Series | Add lockdep_assert_not_held() | expand |
On 2/26/21 11:03 AM, Johannes Berg wrote: > >> @@ -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
On 2/26/21 2:07 PM, Peter Zijlstra wrote: > On Fri, Feb 26, 2021 at 10:52:13AM -0700, Shuah Khan wrote: >> + /* avoid false negative lockdep_assert_not_held() >> + * and lockdep_assert_held() >> + */ > > That's a coding style fail. > Checkpatch didn't complain. What's your preference? Does the following work for you? /* * avoid false negative lockdep_assert_not_held() * and lockdep_assert_held() */ thanks, -- Shuah
On Fri, Feb 26, 2021 at 02:16:12PM -0700, Shuah Khan wrote: > On 2/26/21 2:07 PM, Peter Zijlstra wrote: > > On Fri, Feb 26, 2021 at 10:52:13AM -0700, Shuah Khan wrote: > > > + /* avoid false negative lockdep_assert_not_held() > > > + * and lockdep_assert_held() > > > + */ > > > > That's a coding style fail. > > > > Checkpatch didn't complain. Documentation/CodingStyle (or whatever unreadable rst crap it is today :-( ) and: https://lkml.kernel.org/lkml/CA+55aFyQYJerovMsSoSKS7PessZBr4vNp-3QUUwhqk4A4_jcbg@mail.gmail.com/ > What's your preference? Does the following work for you? > > /* > * avoid false negative lockdep_assert_not_held() > * and lockdep_assert_held() > */ Yep (ideally even with a Capital and full stop).