From 4efcfc7bfde6fd40e96cc89ccd283e5a21a423ca Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 16 Jun 2015 23:43:31 +0000 Subject: [PATCH] scst: Remove dead code from scst_assign_dev_handler() The BUG_ON(handler == NULL) statement at the start of this function guarantees that handler != NULL. Hence remove the remaining tests of the 'handler' pointer. Detected by Coverity. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6341 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 63e7b7ab8..34f921728 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -2103,10 +2103,6 @@ int scst_assign_dev_handler(struct scst_device *dev, assign: dev->handler = handler; - - if (handler == NULL) - goto out; - dev->threads_num = handler->threads_num; dev->threads_pool_type = handler->threads_pool_type; dev->max_write_same_len = 256 * 1024 * 1024; /* 256 MB */ @@ -2152,7 +2148,7 @@ out: return res; out_err_detach_tgt: - if (handler && handler->detach_tgt) { + if (handler->detach_tgt) { list_for_each_entry(tgt_dev, &attached_tgt_devs, extra_tgt_dev_list_entry) { TRACE_DBG("Calling handler's detach_tgt(%p)", @@ -2165,7 +2161,7 @@ out_err_detach_tgt: scst_devt_dev_sysfs_del(dev); out_detach: - if (handler && handler->detach) { + if (handler->detach) { TRACE_DBG("%s", "Calling handler's detach()"); handler->detach(dev); TRACE_DBG("%s", "Handler's detach() returned");