Private
Public Access
2
0

mraa-uart.c: Remove impossible condition with a fprintf

Thanks to @pylbert for the spot

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2017-05-31 12:12:15 +02:00
parent ecb53c8501
commit 8133de0cc0

View File

@@ -156,20 +156,15 @@ main(int argc, const char** argv) {
} else { } else {
for (i=1; i<argc; i++) { for (i=1; i<argc; i++) {
if (!strcmp(argv[i], "dev")) { if (!strcmp(argv[i], "dev")) {
if (argc <= 1) { uart = uarttool_find(argv[i+1]);
fprintf(stderr, "%s : dev needs uart device as argument\n", argv[0]); if (uart == NULL) {
fprintf(stderr, "%s : cannot find uart %s\n", argv[0], argv[i+1]);
break; break;
} else { }
uart = uarttool_find(argv[i+1]); dev = mraa_uart_get_dev_path(uart);
if (uart == NULL) { mraa_result_t res = mraa_uart_settings(-1, &dev, &name, &baudrate, &databits, &stopbits, &parity, &ctsrts, &xonxoff);
fprintf(stderr, "%s : cannot find uart %s\n", argv[0], argv[i+1]); if (res != MRAA_SUCCESS) {
break; fprintf(stderr, "warning: problems accessing uart settings, attempting to continue\n");
}
dev = mraa_uart_get_dev_path(uart);
mraa_result_t res = mraa_uart_settings(-1, &dev, &name, &baudrate, &databits, &stopbits, &parity, &ctsrts, &xonxoff);
if (res != MRAA_SUCCESS) {
fprintf(stderr, "warning: problems accessing uart settings, attempting to continue\n");
}
} }
} else } else