[PATCH] hdparm new option parsing

Rob Landley rob at landley.net
Fri May 5 21:16:40 UTC 2006


On Friday 05 May 2006 3:21 pm, Tito wrote:
> Hi,
> this is the first attempt to clean up and shrink hdparm's option parsing.
> It is tested, but may contain more bugs so review is wellcome.....
>
> Size reduction is:
>    text    data     bss     dec     hex filename
>   25236     176     872   26284    66ac hdparm.o.orig
>   23637     176     872   24685    606d hdparm.o
>
> Please apply if you are brave or test it if you are not....

Ummm...

+#define HDPARM_STR_IDENTITY "\256iI"
+#define PARSE_OPTS_IDENT(x,y)          y=(x)
+#else
+#define HDPARM_STR_IDENTITY ""
+#define PARSE_OPTS_IDENT(x,y)
+#endif
+/*-------------------------------------*/
+#if ENABLE_FEATURE_HDPARM_HDIO_GETSET_DMA
+#define HDPARM_STR_DMA "d::"
+#define PARSE_OPTS_DMA         parse_opts
+#else
+#define HDPARM_STR_DMA ""
+#define PARSE_OPTS_DMA(...)
 #endif
+/*-------------------------------------*/
+#ifdef HDIO_DRIVE_CMD
+#define HDPARM_STR_DRIVE_CMD "S::D::P::X::K::A::L::W::CyYzZ"
+#define PARSE_OPTS_CMD         parse_opts
+#define PARSE_OPTS_CMD_V2      parse_opts_v2
+#define PARSE_OPTS_CMD_V3      parse_opts_v3
+#define PARSE_OPTS_REREAD_PARTN(x,y)           y=(x)
+#else

Just confirming: this is the cleaned up version?  It's supposed to look like 
that?

What does the "#define PARSE_OPTS_CMD_V2 parse_opts_v2" accomplish, exactly?

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list