Robert P. J. Day wrote: > On Mon, 12 Nov 2007, Jerome Glisse wrote: > >> Robert P. J. Day wrote: >>> just a preliminary post -- i submitted a short patch to add a >>> generic order_base_2() macro to <linux/log2.h>, which would allow the >>> following simplification to drm code. is there anything obviously >>> wrong with what follows? >>> >>> the macro added to log2.h was simply: >>> >>> #define order_base_2(n) ilog2(roundup_pow_of_two(n)) >>> >> This code is shared with bsd, so you better define: >> #define drm_order(n) ilog2(roundup_pow_of_two(n)) in drmP.h >> and remove implementation from drm_bufs.c > > is that drmP.h header file also shared with BSD? because defining > drm_order() that way pretty much requires you to have ilog2() and > roundup_pow_of_two() defined, so you might as well just use this in > drmP.h: > > #include <linux/log2.h> > ... > #define drm_order(n) order_base_2(n) > > wouldn't that work just as well? or did i misunderstand what you were > getting at? > > rday
drmP.h is the drm kernel specific file (so here linux specific) i did just mean that it's useless to define the macro order_base_2 if there is no other user than drm in log2.h and rather wrap drm_order around ilog2 & roundup_pow_of_two but if you feel that order_base_2 might be used by others. Cheers, Jerome Glisse ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
