diff options
Diffstat (limited to 'miscutils/i2c_tools.c')
-rw-r--r-- | miscutils/i2c_tools.c | 26 |
1 files changed, 13 insertions, 13 deletions
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; |