Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)