Skip to content

Commit

Permalink
DAOS-6732 coverity: Remove line of code that is not reached (#4797) (#…
Browse files Browse the repository at this point in the history
…4942)

This bug was identified by Coverity

Signed-off-by: Marcela Rosales <marcela.a.rosales.jimenez@intel.com>
  • Loading branch information
marcelarosalesj authored Mar 14, 2021
1 parent 4b39353 commit a87360a
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions src/vos/tests/evt_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static struct evt_desc_cbs ts_evt_desc_nofree_cbs = {
};

static void
ts_open_create(void **state)
ts_open_create(void)
{
bool create;
char *arg;
Expand Down Expand Up @@ -166,7 +166,7 @@ ts_open_create(void **state)
}

static void
ts_close_destroy(void **state)
ts_close_destroy(void)
{
bool destroy;
int rc;
Expand Down Expand Up @@ -321,7 +321,7 @@ bio_strdup(struct utest_context *utx, bio_addr_t *addr, const char *str)
}

static void
ts_add_rect(void **state)
ts_add_rect(void)
{
char *val;
bio_addr_t bio_addr = {0}; /* Fake bio addr */
Expand Down Expand Up @@ -375,7 +375,7 @@ ts_add_rect(void **state)
}

static void
ts_delete_rect(void **state)
ts_delete_rect()
{
char *val;
struct evt_entry ent;
Expand Down Expand Up @@ -421,7 +421,7 @@ ts_delete_rect(void **state)
}

static void
ts_remove_rect(void **state)
ts_remove_rect(void)
{
char *arg;
struct evt_rect rect;
Expand Down Expand Up @@ -458,7 +458,7 @@ ts_remove_rect(void **state)


static void
ts_find_rect(void **state)
ts_find_rect(void)
{
struct evt_entry *ent;
char *val;
Expand Down Expand Up @@ -506,7 +506,7 @@ ts_find_rect(void **state)
}

static void
ts_list_rect(void **state)
ts_list_rect(void)
{
char *val;
daos_anchor_t anchor;
Expand Down Expand Up @@ -651,7 +651,7 @@ ts_list_rect(void **state)
#define TS_VAL_CYCLE 4

static void
ts_many_add(void **state)
ts_many_add(void)
{
char *buf;
char *tmp;
Expand Down Expand Up @@ -757,7 +757,7 @@ ts_many_add(void **state)
}

static void
ts_tree_debug(void **state)
ts_tree_debug(void)
{
int level;
char *arg;
Expand All @@ -768,12 +768,12 @@ ts_tree_debug(void **state)
}

static void
ts_drain(void **state)
ts_drain(void)
{
static int const drain_creds = 256;
int rc;

ts_many_add(state);
ts_many_add();
while (1) {
bool destroyed = false;
int creds = drain_creds;
Expand Down Expand Up @@ -2279,50 +2279,49 @@ static int
ts_cmd_run(char opc, char *args)
{
int rc = 0;
void **st = NULL;

tst_fn_val.optval = args;
tst_fn_val.input = true;

switch (opc) {
case 'C':
ts_open_create(st);
ts_open_create();
break;
case 'D':
ts_close_destroy(st);
ts_close_destroy();
break;
case 'o':
tst_fn_val.input = false;
tst_fn_val.optval = NULL;
ts_open_create(st);
ts_open_create();
break;
case 'c':
tst_fn_val.input = false;
ts_close_destroy(st);
ts_close_destroy();
break;
case 'a':
ts_add_rect(st);
ts_add_rect();
break;
case 'm':
ts_many_add(st);
ts_many_add();
break;
case 'e':
ts_drain(st);
ts_drain();
break;
case 'f':
ts_find_rect(st);
ts_find_rect();
break;
case 'l':
ts_list_rect(st);
ts_list_rect();
break;
case 'd':
ts_delete_rect(st);
ts_delete_rect();
break;
case 'r':
ts_remove_rect(st);
ts_remove_rect();
break;
case 'b':
ts_tree_debug(st);
ts_tree_debug();
break;
case 't':
break;
Expand All @@ -2337,8 +2336,6 @@ ts_cmd_run(char opc, char *args)
rc = 0;
break;
}
if (st != NULL)
rc = -1;

return rc;
}
Expand Down

0 comments on commit a87360a

Please sign in to comment.