aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/bin
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-09-27 09:56:24 -0400
committerMark Brown <broonie@linaro.org>2013-09-27 09:56:24 -0400
commit267666ea3bd6e804c2c8bbafbe628026be963d06 (patch)
tree44f81dcbc20774d67819d8a57985fec290eb489a /tools/perf/scripts/python/bin
parent8516e6483bc870dfa76184657c3ddf5a8906e6db (diff)
parentf8d7b13e14357ed19d2ca2799539600418dc3939 (diff)
Merge remote-tracking branch 'asoc/fix/max98095' into asoc-linus
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
** * kref_init - initialize object. * @kref: object in question. */ void kref_init(struct kref *kref) { kref_set(kref, 1); } /** * kref_get - increment refcount for object. * @kref: object. */ void kref_get(struct kref *kref) { WARN_ON(!atomic_read(&kref->refcount)); atomic_inc(&kref->refcount); smp_mb__after_atomic_inc(); } /** * kref_put - decrement refcount for object. * @kref: object. * @release: pointer to the function that will clean up the object when the * last reference to the object is released. * This pointer is required, and it is not acceptable to pass kfree * in as this function. * * Decrement the refcount, and if 0, call release(). * Return 1 if the object was removed, otherwise return 0. Beware, if this * function returns 0, you still can not count on the kref from remaining in * memory. Only use the return value if you want to see if the kref is now * gone, not present. */ int kref_put(struct kref *kref, void (*release)(struct kref *kref)) { WARN_ON(release == NULL); WARN_ON(release == (void (*)(struct kref *))kfree); if (atomic_dec_and_test(&kref->refcount)) { release(kref); return 1; } return 0; } EXPORT_SYMBOL(kref_set); EXPORT_SYMBOL(kref_init); EXPORT_SYMBOL(kref_get); EXPORT_SYMBOL(kref_put);