[PATCH] more hdparm size reduction & clean up

Tito farmatito at tiscali.it
Wed May 24 20:24:11 UTC 2006


Hi,
this patch reduces size of hdparm.o

add/remove: 1/5 grow/shrink: 2/5 up/down: 124/-572 (-448)
function                                     old     new   delta
parse_xfermode                                 -     109    +109
identify                                    4374    4386     +12
hdparm_main                                 1326    1329      +3
verbose                                       25      21      -4
quiet                                         12       8      -4
noisy                                          4       -      -4
flagcount                                      4       -      -4
print_timing                                  75      63     -12
if_strcat                                     14       -     -14
parse_opts                                    66      51     -15
parse_opts_v2                                 28       -     -28
parse_opts_v3                                120       -    -120
process_dev                                 5486    5119    -367


Changes are:
Remove -v verbose -V version -q quiet flags
Remove parse_opt_v2();
Rename parse_opt_v3() to parse_xfermode()
Remove if_strcat()
Rearrange code in  dump_identity() to reduce size
Modify some strings so that they could be optimized by the compiler
Minor code clean up
Remove unneeded #define <shm.h>

#if BB_BIG_ENDIAN && !defined(__USE_XOPEN)
# define __USE_XOPEN
#endif    
Must be before #include <unistd.h> and #include "busybox.h"
(noticed by Bernhard Fischer <rep.nop at aon.at>)

Remove duplicate code in do_time()

The patch is tested and works at least for me.
Please apply.

Ciao,
Tito
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hdparm12.patch
Type: text/x-diff
Size: 19565 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060524/2b6135b7/attachment.bin 


More information about the busybox mailing list