diff mbox series

scsi: scsi_debug: Drop if with an always false condition

Message ID 20210506203206.254258-1-u.kleine-koenig@pengutronix.de
State New
Headers show
Series scsi: scsi_debug: Drop if with an always false condition | expand

Commit Message

Uwe Kleine-König May 6, 2021, 8:32 p.m. UTC
to_sdebug_host() is a container_of operation, so it never returns NULL.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/scsi/scsi_debug.c | 5 -----
 1 file changed, 5 deletions(-)


base-commit: 38182162b50aa4e970e5997df0a0c4288147a153

Comments

Martin K. Petersen May 15, 2021, 2:41 a.m. UTC | #1
Uwe,

> to_sdebug_host() is a container_of operation, so it never returns NULL.


Applied to 5.14/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 70165be10f00..71ad30172ded 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -7676,11 +7676,6 @@  static int sdebug_driver_remove(struct device *dev)
 
 	sdbg_host = to_sdebug_host(dev);
 
-	if (!sdbg_host) {
-		pr_err("Unable to locate host info\n");
-		return -ENODEV;
-	}
-
 	scsi_remove_host(sdbg_host->shost);
 
 	list_for_each_entry_safe(sdbg_devinfo, tmp, &sdbg_host->dev_info_list,