From patchwork Fri May 8 12:32:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13922C47247 for ; Fri, 8 May 2020 12:43:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0A4124973 for ; Fri, 8 May 2020 12:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941799; bh=GQS6+EQAyU4PQ2E8sPYaUu3YJ+wCBWJ8k/5K90gMOfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Q/gNOzK6SL9/rA/skcoi2s37mFx/lEmqnEXQfr42YjFLh92FQOzsxdJzRvxe8PiTk rukUMkygSs4CvXepMFhG+APO+4sx9pHzJdktO6P/5oddnzCLds5a5aRJXvvDOwU3xx b0e9hUpcvIdHPbmsREIx9kuBh0040hdketq7UvtE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729059AbgEHMnR (ORCPT ); Fri, 8 May 2020 08:43:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:40870 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728620AbgEHMnQ (ORCPT ); Fri, 8 May 2020 08:43:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 34D2B24973; Fri, 8 May 2020 12:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941795; bh=GQS6+EQAyU4PQ2E8sPYaUu3YJ+wCBWJ8k/5K90gMOfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nXPJrs2Hn4Gs1YwI5H9ZGo2eN+AAjffUImrZhJtLm2sDW4ylhzo/6BH7LcOnkeunE Dd8LtAnmfHeXa7E+Xm8fSN4DP/1uYnbpTAaFLu+BW2YKBkAPzRGxQktznoMEoaKFmc In7bw7DZ1t33vV/jZnBlAXeK8Vs078uTFkBBkASY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Eric Auger , Alex Williamson Subject: [PATCH 4.4 174/312] VFIO: platform: reset: fix a warning message condition Date: Fri, 8 May 2020 14:32:45 +0200 Message-Id: <20200508123136.734835774@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Carpenter 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 Reviewed-by: Eric Auger Signed-off-by: Alex Williamson Signed-off-by: Greg Kroah-Hartman --- drivers/vfio/platform/reset/vfio_platform_amdxgbe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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 v 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)