[PATCH] modinfo: make two parameters const.

Denys Vlasenko vda.linux at googlemail.com
Tue Feb 15 00:32:27 UTC 2011


On Monday 14 February 2011 19:29, Lauri Kasanen wrote:
> > On Mon, Feb 14, 2011 at 08:07:59PM +0200, Lauri Kasanen wrote:
> > > Neither flag or env is written to in the respective functions.
> > 
> > > -static int display(const char *data, const char *pattern, int flag)
> > > +static int display(const char *data, const char *pattern, const int flag)
> > 
> > Making an integer parameter const doesn't accomplish much because it's passed
> > by value in C.
> > 
> > >>> Dan
> 
> It does enable the compiler to optimize more aggressively, by assuming it is read-only.

Compiler knows that already.

-- 
vda


More information about the busybox mailing list