Re: [PATCH 1/7] hwspinlock: Introduce refcount

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux