On Mon, 8 Feb 2010 12:02:01 +0100 Maarten Maathuis <[email protected]> wrote:
> Thanks for pointing that out, is it preferred to use goto style > failure or just stick the spin unlock everywhere where you return? In this particular case, just add the unlock where it is needed. But, keep in mind what might happen, if something else accesses the things protected by the lock just between you releasing it and the cleanup function acquiring it. I believe the goto-style is the preferred way of doing it, but that would mean rewriting a lot of code, since IMO the calls to nouveau_channel_free() in the case of nouveau_channel_alloc() are already non-goto-style. And the functions are very long to begin with, this would only make them even longer. Not worth to rewrite it all, unless you find yourself contemplating on adding parameters like 'bool is_already_locked' to cleanup functions. Cheers. -- Pekka Paalanen http://www.iki.fi/pq/ _______________________________________________ Nouveau mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/nouveau
