From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Auger Subject: Re: [patch] VFIO: platform: reset: fix a warning message condition Date: Thu, 17 Dec 2015 13:45:52 +0100 Message-ID: <5672AE80.3010806@linaro.org> References: <20151217122707.GA4267@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Alex Williamson , Arnd Bergmann , kvm@vger.kernel.org, kernel-janitors@vger.kernel.org, "Lendacky, Thomas" To: Dan Carpenter , Baptiste Reynal Return-path: Received: from mail-wm0-f53.google.com ([74.125.82.53]:33723 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964961AbbLQMqe (ORCPT ); Thu, 17 Dec 2015 07:46:34 -0500 Received: by mail-wm0-f53.google.com with SMTP id p187so21627288wmp.0 for ; Thu, 17 Dec 2015 04:46:33 -0800 (PST) In-Reply-To: <20151217122707.GA4267@mwanda> Sender: kvm-owner@vger.kernel.org List-ID: Hi Dan, thanks for pointing this out. Reviewed-by: Eric Auger 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 > > 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) >