Messages in this thread | | | Date | Sat, 13 Mar 2004 16:34:51 -0800 | From | Andrew Morton <> | Subject | Re: [RFC] kref, a tiny, sane, reference count object |
| |
Greg KH <greg@kroah.com> wrote: > > For all of those people, this patch is for you.
It does rather neatly capture a common idiom.
> +struct kref * kref_get(struct kref *kref) > +{ > + if (kref) { > + WARN_ON(!atomic_read(&kref->refcount)); > + atomic_inc(&kref->refcount); > + } > + return kref; > +}
Why is a NULL arg permitted here?
> +void kref_cleanup(struct kref *kref) > +{ > + if (!kref) > + return;
and here? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |