From 6f1f5e0325437f04283083ffede7cc40d08f589e Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sun, 27 Oct 2019 20:21:45 -0400 Subject: [PATCH] clang-tidy: partially fix readability-redundant-declaration --- .clang-tidy | 2 +- platforms/common/work_queue/queue.c | 3 --- platforms/posix/src/px4/common/drv_hrt.cpp | 7 ------- src/examples/fixedwing_control/main.cpp | 7 ------- src/modules/load_mon/load_mon.cpp | 2 -- src/modules/mavlink/mavlink_main.cpp | 2 -- 6 files changed, 1 insertion(+), 22 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index ebf3c3faec..48135ea197 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -93,8 +93,8 @@ Checks: '*, -readability-inconsistent-declaration-parameter-name, -readability-named-parameter, -readability-non-const-parameter, - -readability-redundant-control-flow, -readability-redundant-declaration, + -readability-redundant-control-flow, -readability-static-accessed-through-instance, -readability-static-definition-in-anonymous-namespace, ' diff --git a/platforms/common/work_queue/queue.c b/platforms/common/work_queue/queue.c index 339e517a12..b81315381e 100644 --- a/platforms/common/work_queue/queue.c +++ b/platforms/common/work_queue/queue.c @@ -38,8 +38,6 @@ #include #include -__EXPORT void sq_rem(sq_entry_t *node, sq_queue_t *queue); -sq_entry_t *sq_remafter(sq_entry_t *node, sq_queue_t *queue); void sq_rem(sq_entry_t *node, sq_queue_t *queue) { if (queue->head && node) { @@ -83,7 +81,6 @@ sq_entry_t *sq_remafter(sq_entry_t *node, sq_queue_t *queue) return ret; } -__EXPORT void sq_addfirst(sq_entry_t *node, sq_queue_t *queue); void sq_addfirst(sq_entry_t *node, sq_queue_t *queue) { node->flink = queue->head; diff --git a/platforms/posix/src/px4/common/drv_hrt.cpp b/platforms/posix/src/px4/common/drv_hrt.cpp index d602da4485..13c6ae6a3f 100644 --- a/platforms/posix/src/px4/common/drv_hrt.cpp +++ b/platforms/posix/src/px4/common/drv_hrt.cpp @@ -72,10 +72,8 @@ static LockstepScheduler *lockstep_scheduler = new LockstepScheduler(); #endif -hrt_abstime hrt_absolute_time_offset(); static void hrt_call_reschedule(); static void hrt_call_invoke(); -__EXPORT hrt_abstime hrt_reset(); hrt_abstime hrt_absolute_time_offset() { @@ -463,11 +461,6 @@ void hrt_call_at(struct hrt_call *entry, hrt_abstime calltime, hrt_callout callo hrt_call_internal(entry, calltime, 0, callout, arg); } -/* - * Convert absolute time to a timespec. - */ -void abstime_to_ts(struct timespec *ts, hrt_abstime abstime); - static void hrt_call_invoke() { diff --git a/src/examples/fixedwing_control/main.cpp b/src/examples/fixedwing_control/main.cpp index aa4258639f..dc6606e5f3 100644 --- a/src/examples/fixedwing_control/main.cpp +++ b/src/examples/fixedwing_control/main.cpp @@ -102,13 +102,6 @@ int fixedwing_control_thread_main(int argc, char *argv[]); */ static void usage(const char *reason); -int parameters_init(struct param_handles *h); - -/** - * Update all parameters - * - */ -int parameters_update(const struct param_handles *h, struct params *p); /** * Control roll and pitch angle. diff --git a/src/modules/load_mon/load_mon.cpp b/src/modules/load_mon/load_mon.cpp index a8670a8398..c6228c9960 100644 --- a/src/modules/load_mon/load_mon.cpp +++ b/src/modules/load_mon/load_mon.cpp @@ -56,8 +56,6 @@ # error load_mon support requires CONFIG_SCHED_INSTRUMENTATION #endif -extern struct system_load_s system_load; - #define STACK_LOW_WARNING_THRESHOLD 300 ///< if free stack space falls below this, print a warning #define FDS_LOW_WARNING_THRESHOLD 3 ///< if free file descriptors fall below this, print a warning diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index c11f89936f..b065b38e05 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -85,8 +85,6 @@ static Mavlink *_mavlink_instances = nullptr; */ extern "C" __EXPORT int mavlink_main(int argc, char *argv[]); -extern mavlink_system_t mavlink_system; - void mavlink_send_uart_bytes(mavlink_channel_t chan, const uint8_t *ch, int length) { Mavlink *m = Mavlink::get_instance(chan);