From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [patch] VFIO: platform: reset: fix a warning message condition Date: Tue, 22 Dec 2015 13:09:00 -0700 Message-ID: <1450814940.2950.3.camel@redhat.com> References: <20151217122707.GA4267@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Arnd Bergmann , kvm@vger.kernel.org, kernel-janitors@vger.kernel.org To: Dan Carpenter , Baptiste Reynal , Eric Auger Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933716AbbLVUJB (ORCPT ); Tue, 22 Dec 2015 15:09:01 -0500 In-Reply-To: <20151217122707.GA4267@mwanda> Sender: kvm-owner@vger.kernel.org List-ID: 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.=C2=A0=C2=A0I've fixed this by change= the > postop > to a preop. >=20 > Fixes: 0990822c9866 ('VFIO: platform: reset: AMD xgbe reset module') > Signed-off-by: Dan Carpenter Applied to next for v4.5 with Eric's Reviewed-by. =C2=A0Thanks! 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) > =C2=A0 usleep_range(10, 15); > =C2=A0 > =C2=A0 count =3D 2000; > - while (count-- && (ioread32(xgmac_regs->ioaddr + DMA_MR) & > 1)) > + while (--count && (ioread32(xgmac_regs->ioaddr + DMA_MR) & > 1)) > =C2=A0 usleep_range(500, 600); > =C2=A0 > =C2=A0 if (!count)