Skip to content

Commit d125deb

Browse files
Merge patch series "scsi: qla2xxx: Fix incorrect sign of error code"
Qianfeng Rong <rongqianfeng@vivo.com> says: qla2x00_start_sp() returns only negative error codes or QLA_SUCCESS. Therefore, comparing its return value with positive error codes (e.g., if (_rval == EAGAIN)) causes logical errors. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2 parents fb1f456 + 9877c00 commit d125deb

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/scsi/qla2xxx/qla_edif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ qla24xx_sadb_update(struct bsg_job *bsg_job)
17981798
switch (rval) {
17991799
case QLA_SUCCESS:
18001800
break;
1801-
case EAGAIN:
1801+
case -EAGAIN:
18021802
msleep(EDIF_MSLEEP_INTERVAL);
18031803
cnt++;
18041804
if (cnt < EDIF_RETRY_COUNT)
@@ -3649,7 +3649,7 @@ int qla_edif_process_els(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
36493649
p->e.extra_rx_xchg_address, p->e.extra_control_flags,
36503650
sp->handle, sp->remap.req.len, bsg_job);
36513651
break;
3652-
case EAGAIN:
3652+
case -EAGAIN:
36533653
msleep(EDIF_MSLEEP_INTERVAL);
36543654
cnt++;
36553655
if (cnt < EDIF_RETRY_COUNT)

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,11 +2059,11 @@ static void qla_marker_sp_done(srb_t *sp, int res)
20592059
int cnt = 5; \
20602060
do { \
20612061
if (_chip_gen != sp->vha->hw->chip_reset || _login_gen != sp->fcport->login_gen) {\
2062-
_rval = EINVAL; \
2062+
_rval = -EINVAL; \
20632063
break; \
20642064
} \
20652065
_rval = qla2x00_start_sp(_sp); \
2066-
if (_rval == EAGAIN) \
2066+
if (_rval == -EAGAIN) \
20672067
msleep(1); \
20682068
else \
20692069
break; \

drivers/scsi/qla2xxx/qla_nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static int qla_nvme_xmt_ls_rsp(struct nvme_fc_local_port *lport,
419419
switch (rval) {
420420
case QLA_SUCCESS:
421421
break;
422-
case EAGAIN:
422+
case -EAGAIN:
423423
msleep(PURLS_MSLEEP_INTERVAL);
424424
cnt++;
425425
if (cnt < PURLS_RETRY_COUNT)

0 commit comments

Comments
 (0)