lkml.org 
[lkml]   [2019]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] locking/refcount: add sparse annotations to dec-and-lock functions
On Thu, Dec 26, 2019 at 09:29:22AM -0600, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> Wrap refcount_dec_and_lock() and refcount_dec_and_lock_irqsave() with
> macros using __cond_lock() so that 'sparse' doesn't report warnings
> about unbalanced locking when using them.
>
> This is the same thing that's done for their atomic_t equivalents.
>
> Don't annotate refcount_dec_and_mutex_lock(), because mutexes don't
> currently have sparse annotations.

I so f'ing hate that __cond_lock() crap. Previously I've suggested
fixing sparse instead of making such an atrocious trainwreck of the
code.

\
 
 \ /
  Last update: 2019-12-28 12:50    [W:0.052 / U:2.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site