Commit 4445c4e2 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

VFIO: platform: reset: fix a warning message condition

BugLink: https://bugs.launchpad.net/bugs/1878232

commit 96762882 upstream.

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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 708b3e48
...@@ -110,7 +110,7 @@ int vfio_platform_amdxgbe_reset(struct vfio_platform_device *vdev) ...@@ -110,7 +110,7 @@ int vfio_platform_amdxgbe_reset(struct vfio_platform_device *vdev)
usleep_range(10, 15); usleep_range(10, 15);
count = 2000; count = 2000;
while (count-- && (ioread32(xgmac_regs->ioaddr + DMA_MR) & 1)) while (--count && (ioread32(xgmac_regs->ioaddr + DMA_MR) & 1))
usleep_range(500, 600); usleep_range(500, 600);
if (!count) 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