[PATCH RESEND] clean up bb_pwd.c

Denys Vlasenko vda.linux at googlemail.com
Wed Dec 3 10:32:10 UTC 2008


On Wednesday 03 December 2008 09:02, Tito wrote:
> On Wednesday 03 December 2008 08:50:11 Tito wrote:
> > On Tuesday 02 December 2008 23:57:34 you wrote:
> > > On Monday 24 November 2008 14:48, Tito wrote:
> Hi Denys,
> just out of curiosity, I noticed you changed 
> 
> 	/* Parse any options */
> 	getopt32(argv, "p:st:", &str_p, &str_t);
> 
> 	if (option_mask32 & 0x2) /* -s */
> 
> to:
> 
> 	/* Parse any options */
> 	opt = getopt32(argv, "p:st:", &str_p, &str_t);
> 
> 	if (opt & 0x2) /* -s */
> 
> in logger.c. I'm just wondering why?
> Is there a reason to revert it?
> I'm asking because i've changed
> strings.c to use option_mask32 some time ago.

The result of getopt32() is in a CPU register.
Since we use it basically right away, it's far easier
to access it from there than from a global variable.

If accesses are far away, getopt32() result
gets spilled on stack, and accesses are no longer
so cheap (strings.c case), using global option_mask32
may be cheaper.
--
vda



More information about the busybox mailing list