[PATCH] more hdparm size reduction & clean up
Tito
farmatito at tiscali.it
Thu May 25 19:16:25 UTC 2006
On Thursday 25 May 2006 20:54, Rob Landley wrote:
> On Wednesday 24 May 2006 4:24 pm, Tito wrote:
> > Hi,
> > this patch reduces size of hdparm.o
>
> I can't take it anymore, I'm going to review some of the busybox patch
> backlog. (Sheesh, it's like I'm a junkie or something...)
>
> I noticed this bit:
>
> - if (jj) printf("%umin for SECURITY ERASE UNIT. ",
> jj==ERASE_BITS ? 508 : jj<<1);
> - if (kk) printf("%umin for ENHANCED SECURITY ERASE
> UNIT.", kk==ERASE_BITS ? 508 : kk<<1);
> + if (jj) printf("%umin for %sSECURITY ERASE UNIT. ",
> jj==ERASE_BITS ? 508 : jj<<1, "");
> + if (kk) printf("%umin for %sSECURITY ERASE UNIT. ",
> kk==ERASE_BITS ? 508 : kk<<1, "ENHANCED ");
>
> That's a bit awkward. I read the first new line with the %s substituting in
> "" and went "huh?", although I figured out you're going for common strings
> that the compiler can hopefully merge. Still, is there any way to make that
> sucker an inline function or something? (Or make it a small static function
> and see if the compiler inlines it for you?) Just trying to avoid future
> people having the desire to clean out the %s substituting ""... :)
>
> Not a big issue.
>
> Applied.
>
> Out of curiosity, any plans to turn any of the big if() lists into loops?
Hi,
I've tried, but was not able to do it without size increasing.
Maybe someone more experienced......
Ciao,
Tito
> Rob
More information about the busybox
mailing list