summaryrefslogtreecommitdiff
path: root/drivers/vfio/platform
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-12-17 15:27:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-10 10:26:12 +0200
commit50e3059e6e542b1d43090b41cd46ddd97c07bdce (patch)
treeac8a2ef9816c6fea007e51a0400c75b844efbfc7 /drivers/vfio/platform
parent12e4db13ea5c4baf83950dbb74663ad5fb0ac820 (diff)
VFIO: platform: reset: fix a warning message condition
commit 967628827f404b3063016c138ccc7b06c54350f8 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: 0990822c9866 ('VFIO: platform: reset: AMD xgbe reset module') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Eric Auger <eric.auger@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vfio/platform')
-rw-r--r--drivers/vfio/platform/reset/vfio_platform_amdxgbe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
index da5356f48d0b..d4030d0c38e9 100644
--- a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
+++ b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
@@ -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)