mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
locking/atomic, kref: Add kref_read()
Since we need to change the implementation, stop exposing internals. Provide kref_read() to read the current reference count; typically used for debug messages. Kills two anti-patterns: atomic_read(&kref->refcount) kref->refcount.counter Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
1e24edca05
commit
2c935bc572
56 changed files with 121 additions and 117 deletions
|
|
@ -1396,7 +1396,7 @@ int genwqe_device_remove(struct genwqe_dev *cd)
|
|||
* application which will decrease this reference from
|
||||
* 1/unused to 0/illegal and not from 2/used 1/empty.
|
||||
*/
|
||||
rc = atomic_read(&cd->cdev_genwqe.kobj.kref.refcount);
|
||||
rc = kref_read(&cd->cdev_genwqe.kobj.kref);
|
||||
if (rc != 1) {
|
||||
dev_err(&pci_dev->dev,
|
||||
"[%s] err: cdev_genwqe...refcount=%d\n", __func__, rc);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ static ssize_t mei_dbgfs_read_meclients(struct file *fp, char __user *ubuf,
|
|||
me_cl->props.max_number_of_connections,
|
||||
me_cl->props.max_msg_length,
|
||||
me_cl->props.single_recv_buf,
|
||||
atomic_read(&me_cl->refcnt.refcount));
|
||||
kref_read(&me_cl->refcnt));
|
||||
|
||||
mei_me_cl_put(me_cl);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue