aboutsummaryrefslogtreecommitdiff
path: root/src/systemcmds
diff options
context:
space:
mode:
authorLorenz Meier <lorenz@px4.io>2015-03-28 11:20:55 -0700
committerLorenz Meier <lorenz@px4.io>2015-03-28 11:20:55 -0700
commitb24af0f402ed5512d078c7afc0aa92e7ce1c166b (patch)
tree893833e818d8138360f8fa0bf5554dc6b036f369 /src/systemcmds
parent898bf51047c0331798e6446025de6cdd8f0ae878 (diff)
parent8aae66b893444c74a22ad7beb89e3828e0444108 (diff)
downloadpx4-firmware-b24af0f402ed5512d078c7afc0aa92e7ce1c166b.tar.gz
px4-firmware-b24af0f402ed5512d078c7afc0aa92e7ce1c166b.tar.bz2
px4-firmware-b24af0f402ed5512d078c7afc0aa92e7ce1c166b.zip
Merge pull request #1960 from dagar/format
Trivial code style cleanup round 2
Diffstat (limited to 'src/systemcmds')
-rw-r--r--src/systemcmds/perf/perf.c2
-rw-r--r--src/systemcmds/reboot/reboot.c3
-rw-r--r--src/systemcmds/tests/test_adc.c5
-rw-r--r--src/systemcmds/tests/test_hott_telemetry.c3
-rw-r--r--src/systemcmds/tests/test_uart_baudchange.c3
5 files changed, 11 insertions, 5 deletions
diff --git a/src/systemcmds/perf/perf.c b/src/systemcmds/perf/perf.c
index a788dfc11..4ab92dde6 100644
--- a/src/systemcmds/perf/perf.c
+++ b/src/systemcmds/perf/perf.c
@@ -68,11 +68,13 @@ int perf_main(int argc, char *argv[])
if (strcmp(argv[1], "reset") == 0) {
perf_reset_all();
return 0;
+
} else if (strcmp(argv[1], "latency") == 0) {
perf_print_latency(0 /* stdout */);
fflush(stdout);
return 0;
}
+
printf("Usage: perf [reset | latency]\n");
return -1;
}
diff --git a/src/systemcmds/reboot/reboot.c b/src/systemcmds/reboot/reboot.c
index 91a2c2eb8..d46f96545 100644
--- a/src/systemcmds/reboot/reboot.c
+++ b/src/systemcmds/reboot/reboot.c
@@ -57,9 +57,10 @@ int reboot_main(int argc, char *argv[])
case 'b':
to_bootloader = true;
break;
+
default:
errx(1, "usage: reboot [-b]\n"
- " -b reboot into the bootloader");
+ " -b reboot into the bootloader");
}
}
diff --git a/src/systemcmds/tests/test_adc.c b/src/systemcmds/tests/test_adc.c
index 9f6905239..ef12c9ad2 100644
--- a/src/systemcmds/tests/test_adc.c
+++ b/src/systemcmds/tests/test_adc.c
@@ -71,8 +71,9 @@ int test_adc(int argc, char *argv[])
/* read all channels available */
ssize_t count = read(fd, data, sizeof(data));
- if (count < 0)
+ if (count < 0) {
goto errout_with_dev;
+ }
unsigned channels = count / sizeof(data[0]);
@@ -88,7 +89,7 @@ int test_adc(int argc, char *argv[])
errout_with_dev:
- if (fd != 0) close(fd);
+ if (fd != 0) { close(fd); }
return OK;
}
diff --git a/src/systemcmds/tests/test_hott_telemetry.c b/src/systemcmds/tests/test_hott_telemetry.c
index 270dc3857..ef6173c9e 100644
--- a/src/systemcmds/tests/test_hott_telemetry.c
+++ b/src/systemcmds/tests/test_hott_telemetry.c
@@ -190,7 +190,8 @@ int test_hott_telemetry(int argc, char *argv[])
warnx("PASS: Received %d out of %d valid byte pairs from the HoTT receiver device.", received_count, max_polls);
} else {
- warnx("WARN: Received %d out of %d byte pairs of which %d were valid from the HoTT receiver device.", received_count, max_polls, valid_count);
+ warnx("WARN: Received %d out of %d byte pairs of which %d were valid from the HoTT receiver device.", received_count,
+ max_polls, valid_count);
}
} else {
diff --git a/src/systemcmds/tests/test_uart_baudchange.c b/src/systemcmds/tests/test_uart_baudchange.c
index 609a65c62..cd2e56131 100644
--- a/src/systemcmds/tests/test_uart_baudchange.c
+++ b/src/systemcmds/tests/test_uart_baudchange.c
@@ -146,8 +146,9 @@ int test_uart_baudchange(int argc, char *argv[])
/* uart2 -> */
r = write(uart2, sample_uart2, sizeof(sample_uart2));
- if (r > 0)
+ if (r > 0) {
uart2_nwrite += r;
+ }
}
close(uart2);