mirror of
https://github.com/SCST-project/scst.git
synced 2026-09-20 23:14:18 +00:00
scst_local: Remove two superfluous tests
The to_scst_lcl_sess() macro is based on container_of() and hence never returns NULL. Hence remove the two tests that compare the result of that macro against NULL. Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5385 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1657,11 +1657,6 @@ static int scst_local_driver_remove(struct device *dev)
|
|||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
sess = to_scst_lcl_sess(dev);
|
sess = to_scst_lcl_sess(dev);
|
||||||
if (!sess) {
|
|
||||||
PRINT_ERROR("%s", "Unable to locate sess info");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
scsi_remove_host(sess->shost);
|
scsi_remove_host(sess->shost);
|
||||||
scsi_host_put(sess->shost);
|
scsi_host_put(sess->shost);
|
||||||
|
|
||||||
@@ -1726,8 +1721,6 @@ static void scst_local_release_adapter(struct device *dev)
|
|||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
sess = to_scst_lcl_sess(dev);
|
sess = to_scst_lcl_sess(dev);
|
||||||
if (sess == NULL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* At this point the SCSI device is almost gone because the SCSI
|
* At this point the SCSI device is almost gone because the SCSI
|
||||||
@@ -1760,7 +1753,6 @@ static void scst_local_release_adapter(struct device *dev)
|
|||||||
|
|
||||||
scst_unregister_session(sess->scst_sess, false, scst_local_free_sess);
|
scst_unregister_session(sess->scst_sess, false, scst_local_free_sess);
|
||||||
|
|
||||||
out:
|
|
||||||
TRACE_EXIT();
|
TRACE_EXIT();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user