lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080422172156.GB28933@cs181133002.pp.htv.fi>
Date:	Tue, 22 Apr 2008 20:21:56 +0300
From:	Adrian Bunk <bunk@...sta.de>
To:	Denys Vlasenko <vda.linux@...glemail.com>
Cc:	David Chinner <dgc@....com>, Eric Sandeen <sandeen@...deen.net>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Shawn Bohrer <shawn.bohrer@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Arjan van de Ven <arjan@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] xfs: #define out unused parameters of
	xfs_bmap_add_free and xfs_btree_read_bufl

On Tue, Apr 22, 2008 at 06:17:03PM +0200, Denys Vlasenko wrote:
> On Tuesday 22 April 2008 16:28, Adrian Bunk wrote:
> > > 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.
> > > 
> > > Code size difference on 32-bit x86:
> > >  393457    2904    2952  399313   617d1 linux-2.6-xfs6-TEST/fs/xfs/xfs.o
> > >  393441    2904    2952  399297   617c1 linux-2.6-xfs7-TEST/fs/xfs/xfs.o
> > >...
> > 
> > Elimination of completely unused parameters makes sense, but IMHO using 
> > such #define hacks for minuscule code size and stack usage advantages is 
> > not worth it.
> 
> In busybox this trick is used extensively.

Busybox does not have more than one million lines changed in
one release.

In the Linux kernel maintainability is much more important than in 
smaller projects.

> I don't know how to eliminate these unused parameters with less
> intervention, but I also don't want to leave it unfixed.
> 
> I want to eventually reach the state with no warnings
> about unused parameters.

The standard kernel pattern in using empty static inline functions (that 
allow type checking).

And I'm not sure whether the number of functions you'd have to change 
for reaching your goal has four, five or six digits.

> vda

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ