[PATCH] remove dead code from hdparm

Rob Landley rob at landley.net
Sat Apr 29 16:08:30 UTC 2006


On Friday 28 April 2006 9:40 am, Denis Vlasenko 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.

You have my attention, sir. :)

> 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};

Very nice.

One quibble: Marking stuff static effectively makes it global, and I'm trying 
to keep the globals under control.  I'm leaving it alone for now, but at some 
point in the future when we finally get shared applet global structs, we 
should audit for statics and move the statics into the per-applet global 
structure.

Just sayin'.

Applied.

> 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

I wonder if bb_ioctl() should be in libbb?  The name implies it already is...

Applied.

> hdparm3.patch
>
> Style fixes

Hunk #9 failed, the rest:

Applied.

> hdparm4.patch
>
> * Style fixes
> * Rewrite largish if(), while() and switch() statements so that
>   they are much less indented

Three hunks on this one failed, I'll wait to get a new patch.

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list