From 2cdd75bed7aaa4737a901bd30d8daad479977756 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 22 Jan 2021 21:24:08 -0800 Subject: [PATCH] cppcheck: remove redundant ASSERTs The ASSERT that the passed pointer isn't NULL appears after the pointer has already been dereferenced. Remove the redundant check. Reviewed-by: Ryan Moeller Signed-off-by: Brian Behlendorf Closes #11508 --- module/avl/avl.c | 3 --- module/os/linux/spl/spl-taskq.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/module/avl/avl.c b/module/avl/avl.c index 48865365d8..d0473d883b 100644 --- a/module/avl/avl.c +++ b/module/avl/avl.c @@ -492,7 +492,6 @@ avl_insert(avl_tree_t *tree, void *new_data, avl_index_t where) int which_child = AVL_INDEX2CHILD(where); size_t off = tree->avl_offset; - ASSERT(tree); #ifdef _LP64 ASSERT(((uintptr_t)new_data & 0x7) == 0); #endif @@ -680,8 +679,6 @@ avl_remove(avl_tree_t *tree, void *data) int which_child; size_t off = tree->avl_offset; - ASSERT(tree); - delete = AVL_DATA2NODE(data, off); /* diff --git a/module/os/linux/spl/spl-taskq.c b/module/os/linux/spl/spl-taskq.c index a63c34748b..61631256c8 100644 --- a/module/os/linux/spl/spl-taskq.c +++ b/module/os/linux/spl/spl-taskq.c @@ -274,8 +274,6 @@ taskq_lowest_id(taskq_t *tq) taskq_ent_t *t; taskq_thread_t *tqt; - ASSERT(tq); - if (!list_empty(&tq->tq_pend_list)) { t = list_entry(tq->tq_pend_list.next, taskq_ent_t, tqent_list); lowest_id = MIN(lowest_id, t->tqent_id);