On Thu, Aug 05, 2004 at 11:44:48PM +0100, Dave Airlie wrote:
> 
> >        if ( dev->fn_tbl.foo )
> >        def->fn_tbl.foo();
> >
> > I'd rather have drivers init all the functions to some generic, noop function.
> > I think that makes the code a lot cleaner to read.
> 
> I've thought about this and wasn't sure how acceptable adding a load of
> NOP function calls would be.. I'm not sure too many of the current ptrs
> are in any fast paths, my preference was to use a macro which wrap the
> above but that may be the old way of thinking :-),

static inline int
drm_func_foo(*dev, ...)
{
        if (dev->fn_tbl.foo)
                return dev->fn_tbl.foo(dev, ...);
        else
                return 0;
}

error = drm_func_foo(dev);

(Use _func_ or something consistently so it's obvious it's an
indirection)

-J


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
--
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to