|
@@ -405,11 +405,10 @@ free_cmd_pool:
|
|
|
goto free_cmgr;
|
|
|
|
|
|
for (i = 0; i < num_possible_cpus() + 1; i++) {
|
|
|
- struct list_head *list;
|
|
|
- struct list_head *tmp;
|
|
|
+ struct bnx2fc_cmd *tmp, *io_req;
|
|
|
|
|
|
- list_for_each_safe(list, tmp, &cmgr->free_list[i]) {
|
|
|
- struct bnx2fc_cmd *io_req = (struct bnx2fc_cmd *)list;
|
|
|
+ list_for_each_entry_safe(io_req, tmp,
|
|
|
+ &cmgr->free_list[i], link) {
|
|
|
list_del(&io_req->link);
|
|
|
kfree(io_req);
|
|
|
}
|
|
@@ -1436,9 +1435,7 @@ static void bnx2fc_lun_reset_cmpl(struct bnx2fc_cmd *io_req)
|
|
|
{
|
|
|
struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
|
|
|
struct bnx2fc_rport *tgt = io_req->tgt;
|
|
|
- struct list_head *list;
|
|
|
- struct list_head *tmp;
|
|
|
- struct bnx2fc_cmd *cmd;
|
|
|
+ struct bnx2fc_cmd *cmd, *tmp;
|
|
|
int tm_lun = sc_cmd->device->lun;
|
|
|
int rc = 0;
|
|
|
int lun;
|
|
@@ -1449,9 +1446,8 @@ static void bnx2fc_lun_reset_cmpl(struct bnx2fc_cmd *io_req)
|
|
|
* Walk thru the active_ios queue and ABORT the IO
|
|
|
* that matches with the LUN that was reset
|
|
|
*/
|
|
|
- list_for_each_safe(list, tmp, &tgt->active_cmd_queue) {
|
|
|
+ list_for_each_entry_safe(cmd, tmp, &tgt->active_cmd_queue, link) {
|
|
|
BNX2FC_TGT_DBG(tgt, "LUN RST cmpl: scan for pending IOs\n");
|
|
|
- cmd = (struct bnx2fc_cmd *)list;
|
|
|
lun = cmd->sc_cmd->device->lun;
|
|
|
if (lun == tm_lun) {
|
|
|
/* Initiate ABTS on this cmd */
|
|
@@ -1476,9 +1472,7 @@ static void bnx2fc_lun_reset_cmpl(struct bnx2fc_cmd *io_req)
|
|
|
static void bnx2fc_tgt_reset_cmpl(struct bnx2fc_cmd *io_req)
|
|
|
{
|
|
|
struct bnx2fc_rport *tgt = io_req->tgt;
|
|
|
- struct list_head *list;
|
|
|
- struct list_head *tmp;
|
|
|
- struct bnx2fc_cmd *cmd;
|
|
|
+ struct bnx2fc_cmd *cmd, *tmp;
|
|
|
int rc = 0;
|
|
|
|
|
|
/* called with tgt_lock held */
|
|
@@ -1487,9 +1481,8 @@ static void bnx2fc_tgt_reset_cmpl(struct bnx2fc_cmd *io_req)
|
|
|
* Walk thru the active_ios queue and ABORT the IO
|
|
|
* that matches with the LUN that was reset
|
|
|
*/
|
|
|
- list_for_each_safe(list, tmp, &tgt->active_cmd_queue) {
|
|
|
+ list_for_each_entry_safe(cmd, tmp, &tgt->active_cmd_queue, link) {
|
|
|
BNX2FC_TGT_DBG(tgt, "TGT RST cmpl: scan for pending IOs\n");
|
|
|
- cmd = (struct bnx2fc_cmd *)list;
|
|
|
/* Initiate ABTS */
|
|
|
if (!test_and_set_bit(BNX2FC_FLAG_ISSUE_ABTS,
|
|
|
&cmd->req_flags)) {
|