Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292023 > unrolled thread

[patch] mic_virtio: fix a timeout loop

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2015-12-15 11:20 +0100
Last post2015-12-15 11:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [patch] mic_virtio: fix a timeout loop Dan Carpenter <dan.carpenter@oracle.com> - 2015-12-15 11:20 +0100

#1292023 — [patch] mic_virtio: fix a timeout loop

FromDan Carpenter <dan.carpenter@oracle.com>
Date2015-12-15 11:20 +0100
Subject[patch] mic_virtio: fix a timeout loop
Message-ID<qFUS7-2H9-27@gated-at.bofh.it>
After the loop we test "if (!retry)" to see if we timedout.  The problem
is "retry--" is a post-op so retry will be -1 at the end of the loop.  I
have fixed this by changing it to a pre-op instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/misc/mic/card/mic_virtio.c b/drivers/misc/mic/card/mic_virtio.c
index e486a0c..b3ad9c4 100644
--- a/drivers/misc/mic/card/mic_virtio.c
+++ b/drivers/misc/mic/card/mic_virtio.c
@@ -337,7 +337,7 @@ static int mic_find_vqs(struct virtio_device *vdev, unsigned nvqs,
 	 * rings have been re-assigned.
 	 */
 	mic_send_intr(mvdev->mdev, mvdev->c2h_vdev_db);
-	for (retry = 100; retry--;) {
+	for (retry = 100; --retry;) {
 		if (!ioread8(&dc->used_address_updated))
 			break;
 		msleep(100);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web