[PATCH] remove dead code from hdparm

Tito farmatito at tiscali.it
Sat Apr 29 12:41:51 UTC 2006


On Friday 28 April 2006 15:40, you wrote:
> Hi Tito,
> 
> On Friday 28 April 2006 16:20, Tito wrote:
> > Hi,
> > This patch, to be applied on top of the previous (kernel headers patch)
> > removes a chunk of dead code from hdparm.c (i emailed also the
> > hdparm maintainer about this). 
> 
> I'm sorry I didn't notice this thread before.
> 
> There are hdparm*.patch files at http://195.66.192.167/linux/bbox/,
> some of them can shave off a few bytes.
> 
> Each one has small comment at the top:
> 
> hdparm.patch
> 
> Make hdparm smaller:
> * Use combined no_scsi_no_xt()
> * Have common unsigned char args[4] = {WIN_SETFEATURES,0,0,0};
Hi, Denis,
i've inspected patch n° 1.
The no_scsi_no_xt stuff looked promising but by inspecting the latest
hdparm 6.6+ source that its the author emailed me i've seen that this
code was removed completely, so i did the same ;-).
About the common args stuff  i've a question:
it seems to me that this variables are reused multiple times in the same function,
so wouldn't it be necessary to zero them to avoid to use left over values?

Ciao,
Tito

> hdparm2.patch
> 
> Make hdparm smaller:
> * Make bb_ioctl return the status
> * Replace ioctl with bb_ioctl in a few places
> * Add bb_ioctl_alt, use where appropriate (four places)
> * unsigned char args1[4+512] = {WIN_IDENTIFY,0,0,1,};
>   ate 0.5k of rodata, fix that
> 
> hdparm3.patch
> 
> Style fixes
> 
> hdparm4.patch
> 
> * Style fixes
> * Rewrite largish if(), while() and switch() statements so that
>   they are much less indented
> 
> You may want to incorporate some of this into your patches,
> especially that thing about extra 0.5k for
> "unsigned char args1[4+512] = {WIN_IDENTIFY,0,0,1,};"
> --
> vda
> --
> vda
> 



More information about the busybox mailing list