Skip to content

Commit

Permalink
scsi: qla2xxx: Simplify qlt_send_term_imm_notif()
Browse files Browse the repository at this point in the history
All qlt_send_term_imm_notif() callers pass '1' as second argument to this
function. Hence remove the (broken) code that depends on that second
argument having another value. Add a pr_debug() statement that prints rc to
avoid that the compiler would complain that rc has been set but is not
used.

Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
bvanassche authored and martinkpetersen committed Apr 29, 2019
1 parent d8f945b commit e65449a
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions drivers/scsi/qla2xxx/qla_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3651,33 +3651,11 @@ static int __qlt_send_term_imm_notif(struct scsi_qla_host *vha,
static void qlt_send_term_imm_notif(struct scsi_qla_host *vha,
struct imm_ntfy_from_isp *imm, int ha_locked)
{
unsigned long flags = 0;
int rc;

if (ha_locked) {
rc = __qlt_send_term_imm_notif(vha, imm);

#if 0 /* Todo */
if (rc == -ENOMEM)
qlt_alloc_qfull_cmd(vha, imm, 0, 0);
#else
if (rc) {
}
#endif
goto done;
}

spin_lock_irqsave(&vha->hw->hardware_lock, flags);
WARN_ON_ONCE(!ha_locked);
rc = __qlt_send_term_imm_notif(vha, imm);

#if 0 /* Todo */
if (rc == -ENOMEM)
qlt_alloc_qfull_cmd(vha, imm, 0, 0);
#endif

done:
if (!ha_locked)
spin_unlock_irqrestore(&vha->hw->hardware_lock, flags);
pr_debug("rc = %d\n", rc);
}

/*
Expand Down

0 comments on commit e65449a

Please sign in to comment.