Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4984529ybe; Tue, 17 Sep 2019 00:09:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfYeYyQc2+npx6RCiEn3M/v1s2ljafQpaN3N611+DAd62rvSv+3Th+/RboyngOA+5F7r7n X-Received: by 2002:aa7:d2c4:: with SMTP id k4mr2994754edr.169.1568704151172; Tue, 17 Sep 2019 00:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568704151; cv=none; d=google.com; s=arc-20160816; b=G6ixT5DrHjU5Kz/+rIW/7nHYDdK8glhpJSLSoWoZB9oOYLbxKNJm9N8XJV0UqLBNSP rDT8nIqKnjmrkcxQ5cqp+J4iLvZjVDzp8bPKdlXA7gjkhiHou8GYqr52yflOFRKIuBz3 7Q2fdWy4WRLU4NaR8SFSQqmX5tI575Hm0aBLGNnIcLCuJPz3dKhjnEW/btXini+TSq5g /Q62KK2YdlOJFSrZ8am8XpqxpocLlt9DRctu5zZnIQ/cI3ObB3TacDrU0KscaQ4IXnH0 1C7AnAusPnPPsGuWRu3rYkpeRS9D9JhfLljvZqQuGjP31g/kxQ6GT1onUl6s1WDBN4QR qEyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ClDwwNU7E7yVLshOYSMVtt4b9UbBrgClZoV7wecu9U4=; b=GxWcHqeHUEiexVsJtuCcJAZrhUh4OYUM3umxaT7RPKAzpLKqW425Sdk35MZseMVoXR jYFcwxSQMbOTo4SJtJC/7sB6T4jWvZGNjvx6H/D2L5b2MuBBXWRrrisg8wDEEui7EPsJ kjSJ8VAgF7JAD3OEWIflL5LbMTzZbkx64Tk3CtNJhtoScy91DLCqii+o2GFLbh/NYOYr x1195YZRBObYBJyRsgz23XWIq+uhuN26FzxJMQ37o3tB7cvt3aEkEcFs5LeXXQY+x8w6 Z7M/WIbhRX62u/xXWqrX3EMDT7ag64vb5/ZoFDZoQluoAxB8Te5ZRBLrgZj0ZjoN05mh Urvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9si599320ejj.256.2019.09.17.00.08.46; Tue, 17 Sep 2019 00:09:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387915AbfIPUrR (ORCPT + 99 others); Mon, 16 Sep 2019 16:47:17 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35760 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727971AbfIPUrQ (ORCPT ); Mon, 16 Sep 2019 16:47:16 -0400 Received: by mail-wm1-f66.google.com with SMTP id y21so724089wmi.0; Mon, 16 Sep 2019 13:47:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ClDwwNU7E7yVLshOYSMVtt4b9UbBrgClZoV7wecu9U4=; b=kx1FcIuxqvx/TvGD90QWt4xhIZr0MLjjtDVYiHMWkygeBFSujBP4FQDu5Vo+F6vaY3 stlQ4K7oUUXrBK1zm2R70twTq1Hg+exGa2hVWpJkUH7Ojpp3b+L0NikXbEDfiXIe4L82 ah+BTen1SSD1o/HY5A9y6U1YbsWXHvFyO8ZF2LU6eZF8Dv/kKaR1oXZsgoYx3wx8eKHU CjxCH1bIHYi/hqrOaQr6E9F6SYwowTpcikuylyBSeLqD0Xt7QYAqaOICjapY2tMHi49r TDPTTmP0uSBok/5Ch+JlwIGj11b/J8AAHzMrwCtK5cuFcsKU0S50Zt+VBxKc1oJ+tBCe WBIg== X-Gm-Message-State: APjAAAUN7xBbYgORE2bYQUB3TnE4xxj99DMOg7NQp1t4BvYCr4TLexQw ZLRzKSujOf2B4R5gd0kqz88= X-Received: by 2002:a1c:7319:: with SMTP id d25mr675553wmb.56.1568666834587; Mon, 16 Sep 2019 13:47:14 -0700 (PDT) Received: from black.home (broadband-188-32-48-208.ip.moscow.rt.ru. [188.32.48.208]) by smtp.googlemail.com with ESMTPSA id x6sm231437wmf.38.2019.09.16.13.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 13:47:14 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Andrew Murray , linux-fbdev@vger.kernel.org, Bartlomiej Zolnierkiewicz , Peter Jones Subject: [PATCH v3 15/26] efifb: Loop using PCI_STD_NUM_BARS Date: Mon, 16 Sep 2019 23:41:47 +0300 Message-Id: <20190916204158.6889-16-efremov@linux.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190916204158.6889-1-efremov@linux.com> References: <20190916204158.6889-1-efremov@linux.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor loops to use idiomatic C style and avoid the fencepost error of using "i < PCI_STD_RESOURCE_END" when "i <= PCI_STD_RESOURCE_END" is required, e.g., commit 2f686f1d9bee ("PCI: Correct PCI_STD_RESOURCE_END usage"). To iterate through all possible BARs, loop conditions changed to the *number* of BARs "i < PCI_STD_NUM_BARS", instead of the index of the last valid BAR "i <= PCI_STD_RESOURCE_END". Acked-by: Bartlomiej Zolnierkiewicz Cc: Peter Jones Signed-off-by: Denis Efremov --- drivers/video/fbdev/efifb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 04a22663b4fb..6c72b825e92a 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -668,7 +668,7 @@ static void efifb_fixup_resources(struct pci_dev *dev) if (!base) return; - for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { struct resource *res = &dev->resource[i]; if (!(res->flags & IORESOURCE_MEM)) -- 2.21.0