lkml.org 
[lkml]   [2024]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/7] hwspinlock: Introduce refcount
From


On 5/17/2024 1:58 AM, Bryan O'Donoghue wrote:
> On 17/05/2024 00:58, Chris Lew wrote:
>> +    unsigned int refcnt;
>
> Why int and not refcount_t ?
>
> Have you an argument for or against use of one over another ?
>

I wanted to avoid the warning if you try to do a refcount_inc on 0. In
this case, 0 means the the hwlock is unused but the hwlock should
persist while waiting for another request. It seemed like refcount_t
expected the associated object to be released once the count hit 0.

Also the count here is serialized by hwspinlock_tree_lock so the need
for the atomicity provided by refcount_t was unneeded. Using unsigned
int here seemed simpler.

> ---
> bod

\
 
 \ /
  Last update: 2024-05-27 18:30    [W:0.147 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site