Re: [PATCH] xfs: #define out unused parameters of xfs_bmap_add_free and xfs_btree_read_bufl
From: David Chinner
Date: Tue Apr 22 2008 - 18:43:45 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/