Commit 96762882 authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Williamson

VFIO: platform: reset: fix a warning message condition

This loop ends with count set to -1 and not zero so the warning message
isn't printed when it should be.  I've fixed this by change the postop
to a preop.

Fixes: 0990822c ('VFIO: platform: reset: AMD xgbe reset module')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarEric Auger <eric.auger@linaro.org>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 4ef76753
......@@ -110,7 +110,7 @@ int vfio_platform_amdxgbe_reset(struct vfio_platform_device *vdev)
usleep_range(10, 15);
count = 2000;
while (count-- && (ioread32(xgmac_regs->ioaddr + DMA_MR) & 1))
while (--count && (ioread32(xgmac_regs->ioaddr + DMA_MR) & 1))
usleep_range(500, 600);
if (!count)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment