svn commit: trunk/busybox/miscutils
landley at busybox.net
landley at busybox.net
Wed May 3 20:00:03 UTC 2006
Author: landley
Date: 2006-05-03 13:00:00 -0700 (Wed, 03 May 2006)
New Revision: 14983
Log:
Remove HDIO_GETGEO_BIG which is dead (removed from 2.6) and was pointless back
in 2.4 (it fetched the same hd_geometry struct only with uint cylinders instead
of ushort cylinders: nothing that big has ever accurately reported gemoetry,
it's all LBA.
Also stop declaring the hd_geometry struct static: it's two chars, a short, and
a long for a grand total of 8 bytes. That can go on the stack.
Modified:
trunk/busybox/miscutils/hdparm.c
Changeset:
Modified: trunk/busybox/miscutils/hdparm.c
===================================================================
--- trunk/busybox/miscutils/hdparm.c 2006-05-03 18:28:06 UTC (rev 14982)
+++ trunk/busybox/miscutils/hdparm.c 2006-05-03 20:00:00 UTC (rev 14983)
@@ -2143,21 +2143,13 @@
}
if (verbose || get_geom)
{
- static const char msg[] = " geometry = %u/%u/%u, sectors = %ld, start = %ld\n";
- static struct hd_geometry g;
-#ifdef HDIO_GETGEO_BIG
- static struct hd_big_geometry bg;
-#endif
-
if (!bb_ioctl(fd, BLKGETSIZE, &parm, "BLKGETSIZE"))
{
-#ifdef HDIO_GETGEO_BIG
- if (!bb_ioctl(fd, HDIO_GETGEO_BIG, &bg, "HDIO_GETGEO_BIG"))
- printf(msg, bg.cylinders, bg.heads, bg.sectors, parm, bg.start);
- else
-#endif
+ struct hd_geometry g;
+
if (!bb_ioctl(fd, HDIO_GETGEO, &g, "HDIO_GETGEO"))
- printf(msg, g.cylinders, g.heads, g.sectors, parm, g.start);
+ printf(" geometry = %u/%u/%u, sectors = %ld, start = %ld\n",
+ g.cylinders, g.heads, g.sectors, parm, g.start);
}
}
#ifdef HDIO_DRIVE_CMD
More information about the busybox-cvs
mailing list