aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/hdparm.c58
-rw-r--r--miscutils/i2c_tools.c26
2 files changed, 42 insertions, 42 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
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
index 4b26b7bdc..292ff88dd 100644
--- a/miscutils/i2c_tools.c
+++ b/miscutils/i2c_tools.c
@@ -701,7 +701,7 @@ int i2cset_main(int argc, char **argv)
701 } 701 }
702 702
703 if (status < 0) { 703 if (status < 0) {
704 printf("Warning - readback failed\n"); 704 puts("Warning - readback failed");
705 } else 705 } else
706 if (status != val) { 706 if (status != val) {
707 printf("Warning - data mismatch - wrote " 707 printf("Warning - data mismatch - wrote "
@@ -756,8 +756,8 @@ static void dump_data(int bus_fd, int mode, unsigned first,
756{ 756{
757 int i, j, res; 757 int i, j, res;
758 758
759 printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f" 759 puts(" 0 1 2 3 4 5 6 7 8 9 a b c d e f"
760 " 0123456789abcdef\n"); 760 " 0123456789abcdef");
761 761
762 for (i = 0; i < I2CDUMP_NUM_REGS; i += 0x10) { 762 for (i = 0; i < I2CDUMP_NUM_REGS; i += 0x10) {
763 if (mode == I2C_SMBUS_BLOCK_DATA && i >= blen) 763 if (mode == I2C_SMBUS_BLOCK_DATA && i >= blen)
@@ -826,22 +826,22 @@ static void dump_data(int bus_fd, int mode, unsigned first,
826 break; 826 break;
827 /* Skip unwanted registers */ 827 /* Skip unwanted registers */
828 if (i+j < first || i+j > last) { 828 if (i+j < first || i+j > last) {
829 printf(" "); 829 bb_putchar(' ');
830 continue; 830 continue;
831 } 831 }
832 832
833 res = block[i+j]; 833 res = block[i+j];
834 if (res < 0) { 834 if (res < 0) {
835 printf("X"); 835 bb_putchar('X');
836 } else if (res == 0x00 || res == 0xff) { 836 } else if (res == 0x00 || res == 0xff) {
837 printf("."); 837 bb_putchar('.');
838 } else if (res < 32 || res >= 127) { 838 } else if (res < 32 || res >= 127) {
839 printf("?"); 839 bb_putchar('?');
840 } else { 840 } else {
841 printf("%c", res); 841 bb_putchar(res);
842 } 842 }
843 } 843 }
844 printf("\n"); 844 bb_putchar('\n');
845 } 845 }
846} 846}
847 847
@@ -850,7 +850,7 @@ static void dump_word_data(int bus_fd, unsigned first, unsigned last)
850 int i, j, rv; 850 int i, j, rv;
851 851
852 /* Word data. */ 852 /* Word data. */
853 printf(" 0,8 1,9 2,a 3,b 4,c 5,d 6,e 7,f\n"); 853 puts(" 0,8 1,9 2,a 3,b 4,c 5,d 6,e 7,f");
854 for (i = 0; i < 256; i += 8) { 854 for (i = 0; i < 256; i += 8) {
855 if (i/8 < first/8) 855 if (i/8 < first/8)
856 continue; 856 continue;
@@ -871,7 +871,7 @@ static void dump_word_data(int bus_fd, unsigned first, unsigned last)
871 else 871 else
872 printf("%04x ", rv & 0xffff); 872 printf("%04x ", rv & 0xffff);
873 } 873 }
874 printf("\n"); 874 bb_putchar('\n');
875 } 875 }
876} 876}
877 877
@@ -1267,7 +1267,7 @@ int i2cdetect_main(int argc UNUSED_PARAM, char **argv)
1267 if (!(opts & opt_y)) 1267 if (!(opts & opt_y))
1268 confirm_action(-1, -1, -1, 0); 1268 confirm_action(-1, -1, -1, 0);
1269 1269
1270 printf(" 0 1 2 3 4 5 6 7 8 9 a b c d e f\n"); 1270 puts(" 0 1 2 3 4 5 6 7 8 9 a b c d e f");
1271 for (i = 0; i < 128; i += 16) { 1271 for (i = 0; i < 128; i += 16) {
1272 printf("%02x: ", i); 1272 printf("%02x: ", i);
1273 for(j = 0; j < 16; j++) { 1273 for(j = 0; j < 16; j++) {
@@ -1325,7 +1325,7 @@ int i2cdetect_main(int argc UNUSED_PARAM, char **argv)
1325 else 1325 else
1326 printf("%02x ", i+j); 1326 printf("%02x ", i+j);
1327 } 1327 }
1328 printf("\n"); 1328 bb_putchar('\n');
1329 } 1329 }
1330 1330
1331 return 0; 1331 return 0;