On Wed, Dec 16, 2015 at 02:07:46PM +0300, Dan Carpenter wrote: > After the loop we test for "if (!retries) " as a failure, but actually > the post-op here will end with retries set to -1. I have fixed this by > using a pre-op instead. > > Fixes: 7ec0effd30bb ('[SCSI] qla2xxx: Add support for ISP8044.') > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > > diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c > index 007192d..66d629e 100644 > --- a/drivers/scsi/qla2xxx/qla_nx2.c > +++ b/drivers/scsi/qla2xxx/qla_nx2.c > @@ -3491,7 +3491,7 @@ qla8044_poll_flash_status_reg(struct scsi_qla_host *vha) > int retries = QLA8044_FLASH_READ_RETRY_COUNT; > int ret_val = QLA_SUCCESS; > > - while (retries--) { > + while (--retries) { > ret_val = qla8044_rd_reg_indirect(vha, QLA8044_FLASH_STATUS, > &flash_status); > if (ret_val) { > -- > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html Good catch. Reviewed-by: Johannes Thumshirn <jthumshirn@xxxxxxx> -- Johannes Thumshirn Storage jthumshirn@xxxxxxx +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html