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>
This commit is contained in:
@@ -1798,7 +1798,7 @@ retry:
|
||||
switch (rval) {
|
||||
case QLA_SUCCESS:
|
||||
break;
|
||||
case EAGAIN:
|
||||
case -EAGAIN:
|
||||
msleep(EDIF_MSLEEP_INTERVAL);
|
||||
cnt++;
|
||||
if (cnt < EDIF_RETRY_COUNT)
|
||||
@@ -3649,7 +3649,7 @@ retry:
|
||||
p->e.extra_rx_xchg_address, p->e.extra_control_flags,
|
||||
sp->handle, sp->remap.req.len, bsg_job);
|
||||
break;
|
||||
case EAGAIN:
|
||||
case -EAGAIN:
|
||||
msleep(EDIF_MSLEEP_INTERVAL);
|
||||
cnt++;
|
||||
if (cnt < EDIF_RETRY_COUNT)
|
||||
|
||||
@@ -2059,11 +2059,11 @@ static void qla_marker_sp_done(srb_t *sp, int res)
|
||||
int cnt = 5; \
|
||||
do { \
|
||||
if (_chip_gen != sp->vha->hw->chip_reset || _login_gen != sp->fcport->login_gen) {\
|
||||
_rval = EINVAL; \
|
||||
_rval = -EINVAL; \
|
||||
break; \
|
||||
} \
|
||||
_rval = qla2x00_start_sp(_sp); \
|
||||
if (_rval == EAGAIN) \
|
||||
if (_rval == -EAGAIN) \
|
||||
msleep(1); \
|
||||
else \
|
||||
break; \
|
||||
|
||||
@@ -419,7 +419,7 @@ retry:
|
||||
switch (rval) {
|
||||
case QLA_SUCCESS:
|
||||
break;
|
||||
case EAGAIN:
|
||||
case -EAGAIN:
|
||||
msleep(PURLS_MSLEEP_INTERVAL);
|
||||
cnt++;
|
||||
if (cnt < PURLS_RETRY_COUNT)
|
||||
|
||||
Reference in New Issue
Block a user