Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4622523ybe; Mon, 16 Sep 2019 15:42:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi3A94oYA+00u7c0Fn09iGWz3c5CYUwpTazf228Zt3aSelJYD02KBCmKz5ZGkR+e5Zy5+w X-Received: by 2002:a17:906:583:: with SMTP id 3mr2118257ejn.74.1568673737158; Mon, 16 Sep 2019 15:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568673737; cv=none; d=google.com; s=arc-20160816; b=dY44Aux8CVfM1icmjTX7fgRhZzbsH5X1LY6oziC4CczJcUYJU2Imgkq4vBU2enbKAy UVjfKf+mStkELXYhH/2os/Lmf/OOE8ut7urFXkuiPzbHcN2dDizPJj2UbuVO91nsA0Ez EhuPmNbLLSxR6H2IAFF94HUAA+lmLHDdSyekSTSTNaIKW+FN3Z5BlWe0UpFiiqk0OJdA SAg4Yvt3GR/aW6BJgr6HVrFktfTjbNz1XSBHsJxlaQ0s6aSXUBsPL9GKsVyCL7Oof0aG YcSOssARRJ3WTgJI4kbQC7l6rR23I06+W7W/DnqCOrEe2gga79DvZhdu8OuID3ua2sX6 yicw== 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=rTWOX45cY57shcaylIoJs6ddXiu3evrGLFdFM3nnDoA=; b=a1UPx0zFb9lT3/GRRQm01/9hTzchGTtQK80/6nknffm3HJGURao66DZ0zuj805izQM CSH8BSraUeWQfTqQNWegPjM831vAUeY7NNIfusrs6RVPXr/YaQBXYjNVoyPIyK/Q8Z8g V2K3cX1IMQ+qBprZAHV4LoJRRglwTrhMkDSbCoMeh3CbsIuhnMtTy7P1tnOipdjMZRm5 ets+0NAoAcbR2LqSR4BoqVX6/FIcrxOOTVJyTOyF7hx8G1HF4BlpbBzjfEBC0qE/70Rj 3tgYAuWMDYD6Z2X4Nmw0Pbo6+m7Ayi4Jjnys/nEk2kancF0N7DwSyoL2E3fRx/JGHdCN iLFQ== 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 v26si152789eja.230.2019.09.16.15.41.52; Mon, 16 Sep 2019 15:42:17 -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 S2391641AbfIPUrm (ORCPT + 99 others); Mon, 16 Sep 2019 16:47:42 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55692 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391630AbfIPUrk (ORCPT ); Mon, 16 Sep 2019 16:47:40 -0400 Received: by mail-wm1-f66.google.com with SMTP id g207so772961wmg.5; Mon, 16 Sep 2019 13:47:38 -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=rTWOX45cY57shcaylIoJs6ddXiu3evrGLFdFM3nnDoA=; b=ToRG7sGoLnEmzb7Y7+fzQ+X8fc0PN7PNw/v90XdWNeK1WBkEKl6r+bM6vB4mO+FCSt tlHsQNcftXrLGT7EeKw0kbmK1Uvn5G0W/iY+dkiJlsBTzaEnM1gVubxhZ6PEBF1exsp9 +8fRG5273rpVgHSBq8aQmzNU/16wGbl92gKct3JCBZMCN2uKbRfUM7XujlczCnkMzgZG oC8QOGk35nI4Uue4PaW9vDVDKnYkdUu6Q9vPu/WzCnTgTmDxg15ultbi/SmNWxrTZ30G liDO3o3AtcuffN0bi74PVQ97cZJEWOQAJdyLu/LpfOq43evD1IpQukOO1E3ARTw9qRk3 vGTQ== X-Gm-Message-State: APjAAAVlNKMZuGYKSzjw7KX81z+pxbICr7CwXD5Tj8ErsuKkIVNxdJ8G gbr9IHCT0oQKQxoEUDoRdCQ= X-Received: by 2002:a1c:f917:: with SMTP id x23mr694988wmh.101.1568666858204; Mon, 16 Sep 2019 13:47:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2019 13:47:37 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Andrew Murray , linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v3 21/26] serial: 8250_pci: Use PCI_STD_NUM_BARS Date: Mon, 16 Sep 2019 23:41:53 +0300 Message-Id: <20190916204158.6889-22-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 Remove local definition PCI_NUM_BAR_RESOURCES for the number of PCI BARs and use global one PCI_STD_NUM_BARS instead. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Denis Efremov --- drivers/tty/serial/8250/8250_pci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 7f740b37700b..e557605ec75f 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -43,8 +43,6 @@ struct pci_serial_quirk { void (*exit)(struct pci_dev *dev); }; -#define PCI_NUM_BAR_RESOURCES 6 - struct serial_private { struct pci_dev *dev; unsigned int nr; @@ -74,7 +72,7 @@ setup_port(struct serial_private *priv, struct uart_8250_port *port, { struct pci_dev *dev = priv->dev; - if (bar >= PCI_NUM_BAR_RESOURCES) + if (bar >= PCI_STD_NUM_BARS) return -EINVAL; if (pci_resource_flags(dev, bar) & IORESOURCE_MEM) { @@ -3583,7 +3581,7 @@ serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) return -ENODEV; num_iomem = num_port = 0; - for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (pci_resource_flags(dev, i) & IORESOURCE_IO) { num_port++; if (first_port == -1) @@ -3611,7 +3609,7 @@ serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) */ first_port = -1; num_port = 0; - for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { + for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (pci_resource_flags(dev, i) & IORESOURCE_IO && pci_resource_len(dev, i) == 8 && (first_port == -1 || (first_port + num_port) == i)) { -- 2.21.0