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]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux