Fix some compiler warnings emitted by gcc-4.8.0
[oweals/busybox.git] / miscutils / hdparm.c
index 7608408dd172607b6f3da9ec336d85f34456f983..69726ae7293636a93868ac1395bf42f2e864096e 100644 (file)
@@ -15,8 +15,7 @@
 //usage:#define hdparm_trivial_usage
 //usage:       "[OPTIONS] [DEVICE]"
 //usage:#define hdparm_full_usage "\n\n"
-//usage:       "Options:"
-//usage:     "\n       -a      Get/set fs readahead"
+//usage:       "       -a      Get/set fs readahead"
 //usage:     "\n       -A      Set drive read-lookahead flag (0/1)"
 //usage:     "\n       -b      Get/set bus state (0 == off, 1 == on, 2 == tristate)"
 //usage:     "\n       -B      Set Advanced Power Management setting (1-255)"
@@ -434,6 +433,7 @@ struct BUG_G_too_big {
 #define hwif_data          (G.hwif_data              )
 #define hwif_ctrl          (G.hwif_ctrl              )
 #define hwif_irq           (G.hwif_irq               )
+#define INIT_G() do { } while (0)
 
 
 /* Busybox messages and functions */
@@ -1022,8 +1022,8 @@ static void identify(uint16_t *val)
                }
                if ((like_std > 3) && (val[CMDS_SUPP_1] & 0x0008)) {
                        /* We print out elsewhere whether the APM feature is enabled or
-                          not.  If it's not enabled, let's not repeat the info; just print
-                          nothing here. */
+                        * not.  If it's not enabled, let's not repeat the info; just print
+                        * nothing here. */
                        printf("\tAdvancedPM level: ");
                        if ((val[ADV_PWR] & 0xFF00) == 0x4000) {
                                uint8_t apm_level = val[ADV_PWR] & 0x00FF;
@@ -1038,7 +1038,7 @@ static void identify(uint16_t *val)
                                val[ACOUSTIC] & 0x00ff);
                }
        } else {
-                /* ATAPI */
+               /* ATAPI */
                if (eqpt != CDROM && (val[CAPAB_0] & SWRST_REQ))
                        printf("\tATA sw reset required\n");
 
@@ -2060,6 +2060,8 @@ int hdparm_main(int argc, char **argv)
        int c;
        int flagcount = 0;
 
+       INIT_G();
+
        while ((c = getopt(argc, argv, hdparm_options)) >= 0) {
                flagcount++;
                IF_FEATURE_HDPARM_GET_IDENTITY(get_IDentity |= (c == 'I'));