Skip to content

Commit

Permalink
VFIO: platform: reset: fix a warning message condition
Browse files Browse the repository at this point in the history
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: 0990822 ('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>
  • Loading branch information
Dan Carpenter authored and Alex Williamson committed Dec 21, 2015
1 parent 4ef7675 commit 9676288
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9676288

Please sign in to comment.