diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-03 21:00:06 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-03 21:00:06 +0000 |
commit | 67b23e6043d8e2b30b0bf3bc105b8583c2a26db5 (patch) | |
tree | edb58560b444979051b42ab7f0c0c718f7459754 /miscutils/hdparm.c | |
parent | 40920825d59874cf285390434486e88c8498d2d8 (diff) | |
download | busybox-w32-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.tar.gz busybox-w32-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.tar.bz2 busybox-w32-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.zip |
getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
Diffstat (limited to 'miscutils/hdparm.c')
-rw-r--r-- | miscutils/hdparm.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index b90142362..6c46f6a92 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c | |||
@@ -575,18 +575,18 @@ static void identify(uint16_t *id_supplied) | |||
575 | 575 | ||
576 | /* check if we recognise the device type */ | 576 | /* check if we recognise the device type */ |
577 | printf("\n"); | 577 | printf("\n"); |
578 | if(!(val[GEN_CONFIG] & NOT_ATA)) | 578 | if (!(val[GEN_CONFIG] & NOT_ATA)) |
579 | { | 579 | { |
580 | dev = ATA_DEV; | 580 | dev = ATA_DEV; |
581 | printf("ATA device, with "); | 581 | printf("ATA device, with "); |
582 | } | 582 | } |
583 | else if(val[GEN_CONFIG]==CFA_SUPPORT_VAL) | 583 | else if (val[GEN_CONFIG]==CFA_SUPPORT_VAL) |
584 | { | 584 | { |
585 | dev = ATA_DEV; | 585 | dev = ATA_DEV; |
586 | like_std = 4; | 586 | like_std = 4; |
587 | printf("CompactFlash ATA device, with "); | 587 | printf("CompactFlash ATA device, with "); |
588 | } | 588 | } |
589 | else if(!(val[GEN_CONFIG] & NOT_ATAPI)) | 589 | else if (!(val[GEN_CONFIG] & NOT_ATAPI)) |
590 | { | 590 | { |
591 | dev = ATAPI_DEV; | 591 | dev = ATAPI_DEV; |
592 | eqpt = (val[GEN_CONFIG] & EQPT_TYPE) >> SHIFT_EQPT; | 592 | eqpt = (val[GEN_CONFIG] & EQPT_TYPE) >> SHIFT_EQPT; |
@@ -609,9 +609,9 @@ static void identify(uint16_t *id_supplied) | |||
609 | (val[CONFIG]==PWRD_NID_VAL) || (val[CONFIG]==PWRD_ID_VAL) ) | 609 | (val[CONFIG]==PWRD_NID_VAL) || (val[CONFIG]==PWRD_ID_VAL) ) |
610 | { | 610 | { |
611 | like_std = 5; | 611 | like_std = 5; |
612 | if((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==STBY_ID_VAL)) | 612 | if ((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==STBY_ID_VAL)) |
613 | printf("powers-up in standby; SET FEATURES subcmd spins-up.\n"); | 613 | printf("powers-up in standby; SET FEATURES subcmd spins-up.\n"); |
614 | if(((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==PWRD_NID_VAL)) && (val[GEN_CONFIG] & INCOMPLETE)) | 614 | if (((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==PWRD_NID_VAL)) && (val[GEN_CONFIG] & INCOMPLETE)) |
615 | printf("\n\tWARNING: ID response incomplete.\n\tFollowing data may be incorrect.\n\n"); | 615 | printf("\n\tWARNING: ID response incomplete.\n\tFollowing data may be incorrect.\n\n"); |
616 | } | 616 | } |
617 | 617 | ||
@@ -629,9 +629,9 @@ static void identify(uint16_t *id_supplied) | |||
629 | { | 629 | { |
630 | if (val[MINOR] && (val[MINOR] <= MINOR_MAX)) | 630 | if (val[MINOR] && (val[MINOR] <= MINOR_MAX)) |
631 | { | 631 | { |
632 | if(like_std < 3) like_std = 3; | 632 | if (like_std < 3) like_std = 3; |
633 | std = actual_ver[val[MINOR]]; | 633 | std = actual_ver[val[MINOR]]; |
634 | if(std) printf("\n\tUsed: %s ",minor_str[val[MINOR]]); | 634 | if (std) printf("\n\tUsed: %s ",minor_str[val[MINOR]]); |
635 | 635 | ||
636 | } | 636 | } |
637 | /* looks like when they up-issue the std, they obsolete one; | 637 | /* looks like when they up-issue the std, they obsolete one; |
@@ -652,17 +652,17 @@ static void identify(uint16_t *id_supplied) | |||
652 | like_std = ii; | 652 | like_std = ii; |
653 | kk = like_std >4 ? like_std-4: 0; | 653 | kk = like_std >4 ? like_std-4: 0; |
654 | } | 654 | } |
655 | if(min_std > ii) min_std = ii; | 655 | if (min_std > ii) min_std = ii; |
656 | } | 656 | } |
657 | jj <<= 1; | 657 | jj <<= 1; |
658 | } | 658 | } |
659 | if(like_std < 3) like_std = 3; | 659 | if (like_std < 3) like_std = 3; |
660 | } | 660 | } |
661 | /* Figure out what standard the device is using if it hasn't told | 661 | /* Figure out what standard the device is using if it hasn't told |
662 | * us. If we know the std, check if the device is using any of | 662 | * us. If we know the std, check if the device is using any of |
663 | * the words from the next level up. It happens. | 663 | * the words from the next level up. It happens. |
664 | */ | 664 | */ |
665 | if(like_std < std) like_std = std; | 665 | if (like_std < std) like_std = std; |
666 | 666 | ||
667 | if (((std == 5) || (!std && (like_std < 6))) && | 667 | if (((std == 5) || (!std && (like_std < 6))) && |
668 | ((((val[CMDS_SUPP_1] & VALID) == VALID_VAL) && | 668 | ((((val[CMDS_SUPP_1] & VALID) == VALID_VAL) && |
@@ -724,7 +724,7 @@ static void identify(uint16_t *id_supplied) | |||
724 | jj = val[CDR_MAJOR] >> 1; | 724 | jj = val[CDR_MAJOR] >> 1; |
725 | for (ii = 1; ii <15; ii++) | 725 | for (ii = 1; ii <15; ii++) |
726 | { | 726 | { |
727 | if(jj & 0x0001) printf("-%u ", ii); | 727 | if (jj & 0x0001) printf("-%u ", ii); |
728 | jj >>= 1; | 728 | jj >>= 1; |
729 | } | 729 | } |
730 | } | 730 | } |
@@ -743,7 +743,7 @@ static void identify(uint16_t *id_supplied) | |||
743 | jj = val[GEN_CONFIG] >> 1; | 743 | jj = val[GEN_CONFIG] >> 1; |
744 | for (ii = 1; ii < 15; ii++) | 744 | for (ii = 1; ii < 15; ii++) |
745 | { | 745 | { |
746 | if(jj & 0x0001) printf("\t%s\n",ata1_cfg_str[ii]); | 746 | if (jj & 0x0001) printf("\t%s\n",ata1_cfg_str[ii]); |
747 | jj >>=1; | 747 | jj >>=1; |
748 | } | 748 | } |
749 | } | 749 | } |
@@ -1018,7 +1018,7 @@ static void identify(uint16_t *id_supplied) | |||
1018 | } | 1018 | } |
1019 | } | 1019 | } |
1020 | /* Removable Media Status Notification feature set */ | 1020 | /* Removable Media Status Notification feature set */ |
1021 | if((val[RM_STAT] & RM_STAT_BITS) == RM_STAT_SUP) | 1021 | if ((val[RM_STAT] & RM_STAT_BITS) == RM_STAT_SUP) |
1022 | printf("\t%s supported\n", cmd_feat_str[27]); | 1022 | printf("\t%s supported\n", cmd_feat_str[27]); |
1023 | 1023 | ||
1024 | 1024 | ||
@@ -1196,7 +1196,7 @@ static void dump_identity(const struct hd_driveid *id) | |||
1196 | } | 1196 | } |
1197 | printf("\n"); | 1197 | printf("\n"); |
1198 | 1198 | ||
1199 | if(!(id->field_valid&1)) | 1199 | if (!(id->field_valid&1)) |
1200 | printf(" (maybe):"); | 1200 | printf(" (maybe):"); |
1201 | 1201 | ||
1202 | printf(" CurCHS=%u/%u/%u, CurSects=%lu, LBA=%s",id->cur_cyls, id->cur_heads, | 1202 | printf(" CurCHS=%u/%u/%u, CurSects=%lu, LBA=%s",id->cur_cyls, id->cur_heads, |
@@ -1589,7 +1589,7 @@ static void interpret_xfermode(unsigned int xfermode) | |||
1589 | 1589 | ||
1590 | static void print_flag(unsigned long flag, char *s, unsigned long value) | 1590 | static void print_flag(unsigned long flag, char *s, unsigned long value) |
1591 | { | 1591 | { |
1592 | if(flag) | 1592 | if (flag) |
1593 | printf(" setting %s to %ld\n", s, value); | 1593 | printf(" setting %s to %ld\n", s, value); |
1594 | } | 1594 | } |
1595 | 1595 | ||
@@ -2078,18 +2078,18 @@ static void parse_xfermode(int flag, unsigned long *get, unsigned long *set, int | |||
2078 | } | 2078 | } |
2079 | 2079 | ||
2080 | /*------- getopt short options --------*/ | 2080 | /*------- getopt short options --------*/ |
2081 | static const char hdparm_options[]= "gfu::n::p:r::m::c::k::a::B:tTh"\ | 2081 | static const char hdparm_options[] = "gfu::n::p:r::m::c::k::a::B:tTh" |
2082 | USE_FEATURE_HDPARM_GET_IDENTITY("iI") | 2082 | USE_FEATURE_HDPARM_GET_IDENTITY("iI") |
2083 | USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::") | 2083 | USE_FEATURE_HDPARM_HDIO_GETSET_DMA("d::") |
2084 | #ifdef HDIO_DRIVE_CMD | 2084 | #ifdef HDIO_DRIVE_CMD |
2085 | "S:D:P:X:K:A:L:W:CyYzZ" | 2085 | "S:D:P:X:K:A:L:W:CyYzZ" |
2086 | #endif | 2086 | #endif |
2087 | USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF("U:") | 2087 | USE_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF("U:") |
2088 | #ifdef HDIO_GET_QDMA | 2088 | #ifdef HDIO_GET_QDMA |
2089 | #ifdef HDIO_SET_QDMA | 2089 | #ifdef HDIO_SET_QDMA |
2090 | "Q:" | 2090 | "Q:" |
2091 | #else | 2091 | #else |
2092 | "Q" | 2092 | "Q" |
2093 | #endif | 2093 | #endif |
2094 | #endif | 2094 | #endif |
2095 | USE_FEATURE_HDPARM_HDIO_DRIVE_RESET("w") | 2095 | USE_FEATURE_HDPARM_HDIO_DRIVE_RESET("w") |
@@ -2154,8 +2154,8 @@ int hdparm_main(int argc, char **argv) | |||
2154 | #if ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF | 2154 | #if ENABLE_FEATURE_HDPARM_HDIO_SCAN_HWIF |
2155 | if (c == 'R') { | 2155 | if (c == 'R') { |
2156 | parse_opts(NULL, &scan_hwif, &hwif_data, 0, INT_MAX); | 2156 | parse_opts(NULL, &scan_hwif, &hwif_data, 0, INT_MAX); |
2157 | hwif_ctrl = bb_xgetlarg((argv[optind]) ? argv[optind] : "", 10, 0, INT_MAX); | 2157 | hwif_ctrl = bb_xgetlarg((argv[optind]) ? argv[optind] : "", 10, 0, INT_MAX); |
2158 | hwif_irq = bb_xgetlarg((argv[optind+1]) ? argv[optind+1] : "", 10, 0, INT_MAX); | 2158 | hwif_irq = bb_xgetlarg((argv[optind+1]) ? argv[optind+1] : "", 10, 0, INT_MAX); |
2159 | /* Move past the 2 additional arguments */ | 2159 | /* Move past the 2 additional arguments */ |
2160 | argv += 2; | 2160 | argv += 2; |
2161 | argc -= 2; | 2161 | argc -= 2; |
@@ -2163,7 +2163,7 @@ int hdparm_main(int argc, char **argv) | |||
2163 | #endif | 2163 | #endif |
2164 | } | 2164 | } |
2165 | /* When no flags are given (flagcount = 0), -acdgkmnru is assumed. */ | 2165 | /* When no flags are given (flagcount = 0), -acdgkmnru is assumed. */ |
2166 | if (!flagcount){ | 2166 | if (!flagcount) { |
2167 | get_mult = get_io32bit = get_unmask = get_keep = get_readonly = get_readahead = get_geom = 1; | 2167 | get_mult = get_io32bit = get_unmask = get_keep = get_readonly = get_readahead = get_geom = 1; |
2168 | USE_FEATURE_HDPARM_HDIO_GETSET_DMA(get_dma = 1); | 2168 | USE_FEATURE_HDPARM_HDIO_GETSET_DMA(get_dma = 1); |
2169 | } | 2169 | } |