On Fri, 23 Mar 2018 17:55:54 +0000
Bart Van Assche <bart.vanass...@wdc.com> wrote:

> Comments are not verified at runtime and hence can become outdated if the code
> is modified. assert_spin_locked() and lockdep_assert_held() assertions however
> are verified at runtime with the proper kernel configuration options enabled.
> Hence my preference for assert_spin_locked()/lockdep_assert_held() over source
> code comments.

Asserts are fine, but when the code is static and used close to the
caller, asserts are overkill. A comment at the beginning of a function
should suffice. We do that all over the kernel for functions like that.

The asserts are there when the code can be called from other files, or
in multiple places.

-- Steve

Reply via email to