* [patch] VFIO: platform: reset: fix a warning message condition
@ 2015-12-17 12:27 Dan Carpenter
2015-12-17 12:45 ` Eric Auger
2015-12-22 20:09 ` Alex Williamson
0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-12-17 12:27 UTC (permalink / raw)
To: Baptiste Reynal, Eric Auger
Cc: Alex Williamson, Arnd Bergmann, kvm, kernel-janitors
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>
diff --git a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
index da5356f..d4030d0 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)
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [patch] VFIO: platform: reset: fix a warning message condition
2015-12-17 12:27 [patch] VFIO: platform: reset: fix a warning message condition Dan Carpenter
@ 2015-12-17 12:45 ` Eric Auger
2015-12-17 13:13 ` Dan Carpenter
2015-12-22 20:09 ` Alex Williamson
1 sibling, 1 reply; 4+ messages in thread
From: Eric Auger @ 2015-12-17 12:45 UTC (permalink / raw)
To: Dan Carpenter, Baptiste Reynal
Cc: Alex Williamson, Arnd Bergmann, kvm, kernel-janitors,
Lendacky, Thomas
Hi Dan,
thanks for pointing this out.
Reviewed-by: Eric Auger <eric.auger@linaro.org>
I add Thomas in CC since the bug also exists in the native driver I
think (drivers/net/ethernet/amd/xgbe/drivers/net/ethernet/amd/xgbe
/xgbe-dev.c, xgbe_exit function).
Best Regards
Eric
On 12/17/2015 01:27 PM, Dan Carpenter wrote:
> 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>
>
> diff --git a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
> index da5356f..d4030d0 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)
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] VFIO: platform: reset: fix a warning message condition
2015-12-17 12:45 ` Eric Auger
@ 2015-12-17 13:13 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-12-17 13:13 UTC (permalink / raw)
To: Eric Auger
Cc: Baptiste Reynal, Alex Williamson, Arnd Bergmann, kvm,
kernel-janitors, Lendacky, Thomas
On Thu, Dec 17, 2015 at 01:45:52PM +0100, Eric Auger wrote:
> I add Thomas in CC since the bug also exists in the native driver I
> think (drivers/net/ethernet/amd/xgbe/drivers/net/ethernet/amd/xgbe
> /xgbe-dev.c, xgbe_exit function).
>
Thanks, but I sent a patch for that one already. (These are static
checker fixes).
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] VFIO: platform: reset: fix a warning message condition
2015-12-17 12:27 [patch] VFIO: platform: reset: fix a warning message condition Dan Carpenter
2015-12-17 12:45 ` Eric Auger
@ 2015-12-22 20:09 ` Alex Williamson
1 sibling, 0 replies; 4+ messages in thread
From: Alex Williamson @ 2015-12-22 20:09 UTC (permalink / raw)
To: Dan Carpenter, Baptiste Reynal, Eric Auger
Cc: Arnd Bergmann, kvm, kernel-janitors
On Thu, 2015-12-17 at 15:27 +0300, Dan Carpenter wrote:
> 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>
Applied to next for v4.5 with Eric's Reviewed-by. Thanks!
Alex
> diff --git a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
> b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
> index da5356f..d4030d0 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)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-12-22 20:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-17 12:27 [patch] VFIO: platform: reset: fix a warning message condition Dan Carpenter
2015-12-17 12:45 ` Eric Auger
2015-12-17 13:13 ` Dan Carpenter
2015-12-22 20:09 ` Alex Williamson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).