[PATCH] remove kernel headers from hdparm
Tito
farmatito at tiscali.it
Sat Apr 29 13:07:01 UTC 2006
On Friday 28 April 2006 21:17, Rob Landley wrote:
> On Friday 28 April 2006 8:35 am, Tito wrote:
> > In the meanwhile here is the patch.
> > It contains also a minor fix to the code
> > (for buggy logic)
> > and reduces the size as the elements
> > in linux/hdreg.h are defined only
> > when needed
> >
> > text data bss dec hex filename
> > 27422 176 904 28502 6f56 hdparm.o.orig
> > 27294 176 888 28358 6ec6 hdparm.o
> >
> > This is tested and safe.
>
> Reducing the size is definitely attractive. Do you know what's responsible
> for that?
>
> > Please apply.
> >
> > PS: just take a look at this:
> >
> > #if BB_BIG_ENDIAN && !defined(__USE_XOPEN)
> > # define __USE_XOPEN
> > /* From /linux/byteorder/big_endian.h */
> > #define __le16_to_cpus(x) __swab16s((x))
> > #else
> > /* From /linux/byteorder/little_endian.h */
> > #define __le16_to_cpus(x) do {} while (0)
> > #endif
> >
> > as this is tested only for little endian and maybe
> > should be moved to platform.h?
>
> That looks outright disgusting. I note also that it's only used in two
> places.
I reworked a little this patch to try to be less disgusting ;-)
I also backported some code cleanups and fixes
from a devel version of hdparm that its author sent me.
The no_scsi() and no_xt() functions were removed so size now is:
26320 176 880 27376 6af0 miscutils/hdparm.o
Please apply.
Ciao,
Tito
> Wasn't there a proposal recently for something like TO_BIG_ENDIAN(value),
> FROM_BIG_ENDIAN(value), TO_LITTLE_ENDIAN(value), and
> FROM_LITTLE_ENDIAN(value)?
>
> I'd like to disguise this in platform.h, yes. But I'd also like to try to
> find a more generic solution to whatever problem it's trying to solve.
>
> Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hdparm_05.patch
Type: text/x-diff
Size: 27616 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060429/73cbd6a2/attachment.bin
More information about the busybox
mailing list