aboutsummaryrefslogtreecommitdiff
path: root/miscutils/hdparm.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-10-07 22:42:45 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-07 22:42:45 +0200
commitd60752f8c9be5689a249ad518deb38061d4bc45e (patch)
tree06df5c7e22be59561cbbcd22eb63ff95344fe321 /miscutils/hdparm.c
parent8c0708a329618b20089eb9cedbe06522dd25d9be (diff)
downloadbusybox-w32-d60752f8c9be5689a249ad518deb38061d4bc45e.tar.gz
busybox-w32-d60752f8c9be5689a249ad518deb38061d4bc45e.tar.bz2
busybox-w32-d60752f8c9be5689a249ad518deb38061d4bc45e.zip
build system: -fno-builtin-printf
Benefits are: drops reference to out-of-line putchar(), fixes a few cases of failed string merge. function old new delta i2cdump_main 1488 1502 +14 sha256_process_block64 423 433 +10 sendmail_main 1183 1185 +2 list_table 1114 1116 +2 i2cdetect_main 1235 1237 +2 fdisk_main 2852 2854 +2 builtin_type 119 121 +2 unicode_conv_to_printable2 325 324 -1 scan_recursive 380 378 -2 mkfs_minix_main 2687 2684 -3 buffer_fill_and_print 178 169 -9 putchar 152 - -152 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 7/4 up/down: 34/-167) Total: -133 bytes text data bss dec hex filename 937788 932 17676 956396 e97ec busybox_old 937564 932 17676 956172 e970c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/hdparm.c')
-rw-r--r--miscutils/hdparm.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index f0e9c9d75..9c486e7aa 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -763,9 +763,9 @@ static void identify(uint16_t *val)
763 ) { 763 ) {
764 like_std = 5; 764 like_std = 5;
765 if ((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==STBY_ID_VAL)) 765 if ((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==STBY_ID_VAL))
766 printf("powers-up in standby; SET FEATURES subcmd spins-up.\n"); 766 puts("powers-up in standby; SET FEATURES subcmd spins-up.");
767 if (((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==PWRD_NID_VAL)) && (val[GEN_CONFIG] & INCOMPLETE)) 767 if (((val[CONFIG]==STBY_NID_VAL) || (val[CONFIG]==PWRD_NID_VAL)) && (val[GEN_CONFIG] & INCOMPLETE))
768 printf("\n\tWARNING: ID response incomplete.\n\tFollowing data may be incorrect.\n\n"); 768 puts("\n\tWARNING: ID response incomplete.\n\tFollowing data may be incorrect.\n");
769 } 769 }
770 770
771 /* output the model and serial numbers and the fw revision */ 771 /* output the model and serial numbers and the fw revision */
@@ -875,7 +875,7 @@ static void identify(uint16_t *val)
875 if (min_std == 0xffff) 875 if (min_std == 0xffff)
876 min_std = like_std > 4 ? like_std - 3 : 1; 876 min_std = like_std > 4 ? like_std - 3 : 1;
877 877
878 printf("Configuration:\n"); 878 puts("Configuration:");
879 /* more info from the general configuration word */ 879 /* more info from the general configuration word */
880 if ((eqpt != CDROM) && (like_std == 1)) { 880 if ((eqpt != CDROM) && (like_std == 1)) {
881 jj = val[GEN_CONFIG] >> 1; 881 jj = val[GEN_CONFIG] >> 1;
@@ -909,7 +909,7 @@ static void identify(uint16_t *val)
909 mm = 0; 909 mm = 0;
910 bbbig = 0; 910 bbbig = 0;
911 if ((ll > 0x00FBFC10) && (!val[LCYLS])) 911 if ((ll > 0x00FBFC10) && (!val[LCYLS]))
912 printf("\tCHS addressing not supported\n"); 912 puts("\tCHS addressing not supported");
913 else { 913 else {
914 jj = val[WHATS_VALID] & OK_W54_58; 914 jj = val[WHATS_VALID] & OK_W54_58;
915 printf("\tLogical\t\tmax\tcurrent\n" 915 printf("\tLogical\t\tmax\tcurrent\n"
@@ -980,7 +980,7 @@ static void identify(uint16_t *val)
980 !(val[CAPAB_0] & IORDY_SUP) ? "(may be)" : "", 980 !(val[CAPAB_0] & IORDY_SUP) ? "(may be)" : "",
981 (val[CAPAB_0] & IORDY_OFF) ? "" :"not"); 981 (val[CAPAB_0] & IORDY_OFF) ? "" :"not");
982 } else 982 } else
983 printf("no IORDY\n"); 983 puts("no IORDY");
984 984
985 if ((like_std == 1) && val[BUF_TYPE]) { 985 if ((like_std == 1) && val[BUF_TYPE]) {
986 printf("\tBuffer type: %04x: %s%s\n", val[BUF_TYPE], 986 printf("\tBuffer type: %04x: %s%s\n", val[BUF_TYPE],
@@ -1012,13 +1012,13 @@ static void identify(uint16_t *val)
1012 } 1012 }
1013 printf("\tR/W multiple sector transfer: "); 1013 printf("\tR/W multiple sector transfer: ");
1014 if ((like_std < 3) && !(val[SECTOR_XFER_MAX] & SECTOR_XFER)) 1014 if ((like_std < 3) && !(val[SECTOR_XFER_MAX] & SECTOR_XFER))
1015 printf("not supported\n"); 1015 puts("not supported");
1016 else { 1016 else {
1017 printf("Max = %u\tCurrent = ", val[SECTOR_XFER_MAX] & SECTOR_XFER); 1017 printf("Max = %u\tCurrent = ", val[SECTOR_XFER_MAX] & SECTOR_XFER);
1018 if (val[SECTOR_XFER_CUR] & MULTIPLE_SETTING_VALID) 1018 if (val[SECTOR_XFER_CUR] & MULTIPLE_SETTING_VALID)
1019 printf("%u\n", val[SECTOR_XFER_CUR] & SECTOR_XFER); 1019 printf("%u\n", val[SECTOR_XFER_CUR] & SECTOR_XFER);
1020 else 1020 else
1021 printf("?\n"); 1021 puts("?");
1022 } 1022 }
1023 if ((like_std > 3) && (val[CMDS_SUPP_1] & 0x0008)) { 1023 if ((like_std > 3) && (val[CMDS_SUPP_1] & 0x0008)) {
1024 /* We print out elsewhere whether the APM feature is enabled or 1024 /* We print out elsewhere whether the APM feature is enabled or
@@ -1040,7 +1040,7 @@ static void identify(uint16_t *val)
1040 } else { 1040 } else {
1041 /* ATAPI */ 1041 /* ATAPI */
1042 if (eqpt != CDROM && (val[CAPAB_0] & SWRST_REQ)) 1042 if (eqpt != CDROM && (val[CAPAB_0] & SWRST_REQ))
1043 printf("\tATA sw reset required\n"); 1043 puts("\tATA sw reset required");
1044 1044
1045 if (val[PKT_REL] || val[SVC_NBSY]) { 1045 if (val[PKT_REL] || val[SVC_NBSY]) {
1046 printf("\tOverlap support:"); 1046 printf("\tOverlap support:");
@@ -1056,7 +1056,7 @@ static void identify(uint16_t *val)
1056 /* DMA stuff. Check that only one DMA mode is selected. */ 1056 /* DMA stuff. Check that only one DMA mode is selected. */
1057 printf("\tDMA: "); 1057 printf("\tDMA: ");
1058 if (!(val[CAPAB_0] & DMA_SUP)) 1058 if (!(val[CAPAB_0] & DMA_SUP))
1059 printf("not supported\n"); 1059 puts("not supported");
1060 else { 1060 else {
1061 if (val[DMA_MODE] && !val[SINGLE_DMA] && !val[MULTI_DMA]) 1061 if (val[DMA_MODE] && !val[SINGLE_DMA] && !val[MULTI_DMA])
1062 printf(" sdma%u\n", (val[DMA_MODE] & MODE) >> 8); 1062 printf(" sdma%u\n", (val[DMA_MODE] & MODE) >> 8);
@@ -1079,7 +1079,7 @@ static void identify(uint16_t *val)
1079 bb_putchar('\n'); 1079 bb_putchar('\n');
1080 1080
1081 if ((dev == ATAPI_DEV) && (eqpt != CDROM) && (val[CAPAB_0] & DMA_IL_SUP)) 1081 if ((dev == ATAPI_DEV) && (eqpt != CDROM) && (val[CAPAB_0] & DMA_IL_SUP))
1082 printf("\t\tInterleaved DMA support\n"); 1082 puts("\t\tInterleaved DMA support");
1083 1083
1084 if ((val[WHATS_VALID] & OK_W64_70) 1084 if ((val[WHATS_VALID] & OK_W64_70)
1085 && (val[DMA_TIME_MIN] || val[DMA_TIME_NORM]) 1085 && (val[DMA_TIME_MIN] || val[DMA_TIME_NORM])
@@ -1121,8 +1121,8 @@ static void identify(uint16_t *val)
1121 } 1121 }
1122 1122
1123 if ((val[CMDS_SUPP_1] & VALID) == VALID_VAL) { 1123 if ((val[CMDS_SUPP_1] & VALID) == VALID_VAL) {
1124 printf("Commands/features:\n" 1124 puts("Commands/features:\n"
1125 "\tEnabled\tSupported:\n"); 1125 "\tEnabled\tSupported:");
1126 jj = val[CMDS_SUPP_0]; 1126 jj = val[CMDS_SUPP_0];
1127 kk = val[CMDS_EN_0]; 1127 kk = val[CMDS_EN_0];
1128 for (ii = 0; ii < NUM_CMD_FEAT_STR; ii++) { 1128 for (ii = 0; ii < NUM_CMD_FEAT_STR; ii++) {
@@ -1150,7 +1150,7 @@ static void identify(uint16_t *val)
1150 if ((eqpt != CDROM) && (like_std > 3) 1150 if ((eqpt != CDROM) && (like_std > 3)
1151 && (val[SECU_STATUS] || val[ERASE_TIME] || val[ENH_ERASE_TIME]) 1151 && (val[SECU_STATUS] || val[ERASE_TIME] || val[ENH_ERASE_TIME])
1152 ) { 1152 ) {
1153 printf("Security:\n"); 1153 puts("Security:");
1154 if (val[PSWD_CODE] && (val[PSWD_CODE] != NOVAL_1)) 1154 if (val[PSWD_CODE] && (val[PSWD_CODE] != NOVAL_1))
1155 printf("\tMaster password revision code = %u\n", val[PSWD_CODE]); 1155 printf("\tMaster password revision code = %u\n", val[PSWD_CODE]);
1156 jj = val[SECU_STATUS]; 1156 jj = val[SECU_STATUS];
@@ -1366,7 +1366,7 @@ static NOINLINE void dump_identity(const struct hd_driveid *id)
1366 } 1366 }
1367 } 1367 }
1368#endif /* __NEW_HD_DRIVE_ID */ 1368#endif /* __NEW_HD_DRIVE_ID */
1369 printf("\n\n * current active mode\n\n"); 1369 puts("\n\n * current active mode\n");
1370} 1370}
1371#endif 1371#endif
1372 1372
@@ -1507,7 +1507,7 @@ static void bus_state_value(unsigned value)
1507 else if (value == BUSSTATE_OFF) 1507 else if (value == BUSSTATE_OFF)
1508 on_off(0); 1508 on_off(0);
1509 else if (value == BUSSTATE_TRISTATE) 1509 else if (value == BUSSTATE_TRISTATE)
1510 printf(" (tristate)\n"); 1510 puts(" (tristate)");
1511 else 1511 else
1512 printf(" (unknown: %u)\n", value); 1512 printf(" (unknown: %u)\n", value);
1513} 1513}
@@ -1531,7 +1531,7 @@ static void interpret_standby(uint8_t standby)
1531 printf("vendor-specific"); 1531 printf("vendor-specific");
1532 if (standby == 254) 1532 if (standby == 254)
1533 printf("reserved"); 1533 printf("reserved");
1534 printf(")\n"); 1534 puts(")");
1535} 1535}
1536 1536
1537static const uint8_t xfermode_val[] ALIGN1 = { 1537static const uint8_t xfermode_val[] ALIGN1 = {
@@ -1582,7 +1582,7 @@ static void interpret_xfermode(unsigned xfermode)
1582 printf("UltraDMA mode%u", xfermode - 64); 1582 printf("UltraDMA mode%u", xfermode - 64);
1583 else 1583 else
1584 printf("unknown"); 1584 printf("unknown");
1585 printf(")\n"); 1585 puts(")");
1586} 1586}
1587#endif /* HDIO_DRIVE_CMD */ 1587#endif /* HDIO_DRIVE_CMD */
1588 1588
@@ -1633,7 +1633,7 @@ static void process_dev(char *devname)
1633 if (noisy_piomode) { 1633 if (noisy_piomode) {
1634 printf(" attempting to "); 1634 printf(" attempting to ");
1635 if (piomode == 255) 1635 if (piomode == 255)
1636 printf("auto-tune PIO mode\n"); 1636 puts("auto-tune PIO mode");
1637 else if (piomode < 100) 1637 else if (piomode < 100)
1638 printf("set PIO mode to %d\n", piomode); 1638 printf("set PIO mode to %d\n", piomode);
1639 else if (piomode < 200) 1639 else if (piomode < 200)
@@ -1762,7 +1762,7 @@ static void process_dev(char *devname)
1762#ifndef WIN_STANDBYNOW2 1762#ifndef WIN_STANDBYNOW2
1763#define WIN_STANDBYNOW2 0x94 1763#define WIN_STANDBYNOW2 0x94
1764#endif 1764#endif
1765 printf(" issuing standby command\n"); 1765 puts(" issuing standby command");
1766 args[0] = WIN_STANDBYNOW1; 1766 args[0] = WIN_STANDBYNOW1;
1767 ioctl_alt_or_warn(HDIO_DRIVE_CMD, args, WIN_STANDBYNOW2); 1767 ioctl_alt_or_warn(HDIO_DRIVE_CMD, args, WIN_STANDBYNOW2);
1768 } 1768 }
@@ -1773,13 +1773,13 @@ static void process_dev(char *devname)
1773#ifndef WIN_SLEEPNOW2 1773#ifndef WIN_SLEEPNOW2
1774#define WIN_SLEEPNOW2 0x99 1774#define WIN_SLEEPNOW2 0x99
1775#endif 1775#endif
1776 printf(" issuing sleep command\n"); 1776 puts(" issuing sleep command");
1777 args[0] = WIN_SLEEPNOW1; 1777 args[0] = WIN_SLEEPNOW1;
1778 ioctl_alt_or_warn(HDIO_DRIVE_CMD, args, WIN_SLEEPNOW2); 1778 ioctl_alt_or_warn(HDIO_DRIVE_CMD, args, WIN_SLEEPNOW2);
1779 } 1779 }
1780 if (set_seagate) { 1780 if (set_seagate) {
1781 args[0] = 0xfb; 1781 args[0] = 0xfb;
1782 printf(" disabling Seagate auto powersaving mode\n"); 1782 puts(" disabling Seagate auto powersaving mode");
1783 ioctl_or_warn(fd, HDIO_DRIVE_CMD, &args); 1783 ioctl_or_warn(fd, HDIO_DRIVE_CMD, &args);
1784 } 1784 }
1785 if (getset_standby == IS_SET) { 1785 if (getset_standby == IS_SET) {
@@ -1815,17 +1815,17 @@ static void process_dev(char *devname)
1815 if (!ioctl_or_warn(fd, HDIO_GET_32BIT, &parm)) { 1815 if (!ioctl_or_warn(fd, HDIO_GET_32BIT, &parm)) {
1816 printf(" IO_support\t=%3ld (", parm); 1816 printf(" IO_support\t=%3ld (", parm);
1817 if (parm == 0) 1817 if (parm == 0)
1818 printf("default 16-bit)\n"); 1818 puts("default 16-bit)");
1819 else if (parm == 2) 1819 else if (parm == 2)
1820 printf("16-bit)\n"); 1820 puts("16-bit)");
1821 else if (parm == 1) 1821 else if (parm == 1)
1822 printf("32-bit)\n"); 1822 puts("32-bit)");
1823 else if (parm == 3) 1823 else if (parm == 3)
1824 printf("32-bit w/sync)\n"); 1824 puts("32-bit w/sync)");
1825 else if (parm == 8) 1825 else if (parm == 8)
1826 printf("Request-Queue-Bypass)\n"); 1826 puts("Request-Queue-Bypass)");
1827 else 1827 else
1828 printf("\?\?\?)\n"); 1828 puts("\?\?\?)");
1829 } 1829 }
1830 } 1830 }
1831 if (getset_unmask) { 1831 if (getset_unmask) {
@@ -1837,7 +1837,7 @@ static void process_dev(char *devname)
1837 if (!ioctl_or_warn(fd, HDIO_GET_DMA, &parm)) { 1837 if (!ioctl_or_warn(fd, HDIO_GET_DMA, &parm)) {
1838 printf(fmt, "using_dma", parm); 1838 printf(fmt, "using_dma", parm);
1839 if (parm == 8) 1839 if (parm == 8)
1840 printf(" (DMA-Assisted-PIO)\n"); 1840 puts(" (DMA-Assisted-PIO)");
1841 else 1841 else
1842 on_off(parm != 0); 1842 on_off(parm != 0);
1843 } 1843 }
@@ -1921,7 +1921,7 @@ static void process_dev(char *devname)
1921 id.multsect_valid &= ~1; 1921 id.multsect_valid &= ~1;
1922 dump_identity(&id); 1922 dump_identity(&id);
1923 } else if (errno == -ENOMSG) 1923 } else if (errno == -ENOMSG)
1924 printf(" no identification info available\n"); 1924 puts(" no identification info available");
1925 else if (ENABLE_IOCTL_HEX2STR_ERROR) /* To be coherent with ioctl_or_warn */ 1925 else if (ENABLE_IOCTL_HEX2STR_ERROR) /* To be coherent with ioctl_or_warn */
1926 bb_perror_msg("HDIO_GET_IDENTITY"); 1926 bb_perror_msg("HDIO_GET_IDENTITY");
1927 else 1927 else