diff mbox

crypto: qat - fix some timeout tests

Message ID 20151215100515.GB20848@mwanda (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show

Commit Message

Dan Carpenter Dec. 15, 2015, 10:05 a.m. UTC
We do an "if (!times)" test later to see if we ran the loop too many
times, but because it is a postop negate that means times is -1 when we
exit that way.  I have fixed this by changing it from a post op to a
preop.

Fixes: b3416fb8a2f5 ('crypto: qat - Intel(R) QAT accelengine part of fw loader')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This means we only loop 9999 times instead of 10000 like before but I
figure it probably doesn't matter.

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c
index 45c1739..2b078a6 100644
--- a/drivers/crypto/qat/qat_common/qat_hal.c
+++ b/drivers/crypto/qat/qat_common/qat_hal.c
@@ -171,7 +171,7 @@  static int qat_hal_wait_cycles(struct icp_qat_fw_loader_handle *handle,
 
 	qat_hal_rd_ae_csr(handle, ae, PROFILE_COUNT, &base_cnt);
 	base_cnt &= 0xffff;
-	while ((int)cycles > elapsed_cycles && times--) {
+	while ((int)cycles > elapsed_cycles && --times) {
 		if (chk_inactive)
 			qat_hal_rd_ae_csr(handle, ae, ACTIVE_CTX_STATUS, &csr);