Messages in this thread | | | Date | Wed, 23 Apr 2008 08:43:09 +1000 | From | David Chinner <> | Subject | Re: [PATCH] xfs: #define out unused parameters of xfs_bmap_add_free and xfs_btree_read_bufl |
| |
On Tue, Apr 22, 2008 at 01:20:54PM +0200, Denys Vlasenko wrote: > Hi David, > > xfs_bmap_add_free and xfs_btree_read_bufl functions > use some of their parameters only in some cases > (e.g. if DEBUG is defined, or on non-Linux OS :) > > This patch removes these parameters using #define hack > which makes them "disappear" without the need of uglifying > every callsite with #ifdefs.
We don't use pre-processor hacks to hide function variables for different config options. The XFS header files are messy enough without adding additional redefinitions of function types to them.
w.r.t xfs_bmap_add_free(), the correct thing to do is to factor the debug code out into a different function that is only compiled on debug kernels and remove all the debug checks from xfs_bmap_add_free().
As it is, I don't think that the change is worth the maintenance cost for a few bytes of stack space in non-critical paths.
Cheers,
Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group
| |