From 6ed5ee6865f9552446c694b815d4025305332233 Mon Sep 17 00:00:00 2001 From: bazooka joe Date: Wed, 20 Feb 2019 15:22:40 +0200 Subject: [PATCH] remove check of myoptind >= argc because: [bkueng](/bkueng) Because BATT_SMBUS is using a different structure (the ModuleBase class), and `BATT_SMBUS::task_spawn` is only called for the `start` command. This is the reason why you don't need to check for it in here. --- src/drivers/batt_smbus/batt_smbus.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/drivers/batt_smbus/batt_smbus.cpp b/src/drivers/batt_smbus/batt_smbus.cpp index dd2372af6c..81a77e34f1 100644 --- a/src/drivers/batt_smbus/batt_smbus.cpp +++ b/src/drivers/batt_smbus/batt_smbus.cpp @@ -134,11 +134,6 @@ int BATT_SMBUS::task_spawn(int argc, char *argv[]) } } - if (myoptind >= argc) { - print_usage(); - return PX4_ERROR; - } - for (unsigned i = 0; i < NUM_BUS_OPTIONS; i++) { if (!is_running() && (busid == BATT_SMBUS_BUS_ALL || bus_options[i].busid == busid)) {