[PATCH] hdparm size reduction

Rob Landley rob at landley.net
Tue May 2 13:43:26 UTC 2006


On Tuesday 02 May 2006 2:07 am, Tito wrote:
> On Monday 1 May 2006 21:19, you wrote:
> > On Saturday 29 April 2006 3:14 pm, Tito wrote:
> > > Hi,
> > > this patch applies on top of the last applied patches of Denis
> > > and removes some dead code in identify(),
> > > some obsolete  code in process_dev() and some obsolete functions
> > > (no_scsi(), no_xt(), no_scsi_no_xt()) as in latest hdparm6.6.
> > >
> > > Please apply.
> >
> > The first two hunks were rejected.
> >
> > What's the deal with chksum?  In the previous code, it was never being
> > set (it was only set in the dead code that was never reached), and now
> > it's tested in one place where they only care that' it's zero.  There's
> > another place that we print it and say it's correct, but we never
> > actually _test_ it so how do we know...?
>
> Maybe here (in the rejected hunks)?
>
> 	/* calculate checksum over all bytes */
> 	for(ii = GEN_CONFIG; ii<=INTEGRITY; ii++) {
> 		chksum += val[ii] + (val[ii] >> 8);
> 	}

I checked in the non-rejected bits, with one manual fixup.  It didn't seem to 
make anything worse. :)

> BTW: identify() could be a candidate for an ATTRIBUTE_NORETURN?

Could be.  Want to send a new patch with a respin of the rejected hunks plus 
this?

> Ciao,
> Tito

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list