public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: scsi_debug: Drop if with an always false condition
@ 2021-05-06 20:32 Uwe Kleine-König
  2021-05-15  2:41 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2021-05-06 20:32 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel

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(-)

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,

base-commit: 38182162b50aa4e970e5997df0a0c4288147a153
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: scsi_debug: Drop if with an always false condition
  2021-05-06 20:32 [PATCH] scsi: scsi_debug: Drop if with an always false condition Uwe Kleine-König
@ 2021-05-15  2:41 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-05-15  2:41 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi, kernel


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-15  2:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-06 20:32 [PATCH] scsi: scsi_debug: Drop if with an always false condition Uwe Kleine-König
2021-05-15  2:41 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox