[PATCH] more hdparm size reduction & clean up

Rob Landley rob at landley.net
Thu May 25 18:54:39 UTC 2006


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?

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list