From patchwork Fri Dec 15 20:29:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 10115969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CD0C060231 for ; Fri, 15 Dec 2017 20:31:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFD9E2A16C for ; Fri, 15 Dec 2017 20:31:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B49562A171; Fri, 15 Dec 2017 20:31:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB6072A16C for ; Fri, 15 Dec 2017 20:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:To:From: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1nlpoCzaRBAG4pwawEDkfcTXcNF7J73zeh1/80mbxbk=; b=Ek+/ZjXWH+IjkC cUbmg16BTKXv20n3NSdFWikOihJtsNZltO9KQmsrMrK0xyi0PwFBGTcs22nAuNChA0bNy1xEkbwP1 mcZ3NcggnCqha0g1Dmtgn3TriA5+OSVb6PG03mrzo1PBppGocBehifSEDqS9QRGD9lNbdDkukE9Yn 9+RODJ78BPgB+R0592K8J8bSqthm4bB0f0MHqcIPjZEnArsu0dlhs9Sb0sPZpinQJvoktbi0FTA8s zYmc1cx6ad3PlpOuIRTFZyDz1qbUxd987JP3Q30cd6GCz1q/3P3ieGR+Hw5JtsVPx9B8wv0WClo/g xRMv3vn9HmQCJTyfdWHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePwcW-0003FI-Be; Fri, 15 Dec 2017 20:30:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePwcN-0001rs-Ld for linux-rockchip@lists.infradead.org; Fri, 15 Dec 2017 20:30:10 +0000 Received: from localhost (unknown [69.71.4.159]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ADEB6218C5; Fri, 15 Dec 2017 20:29:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADEB6218C5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Subject: [PATCH] PCI: rockchip: Remove redundant "valid device" check From: Bjorn Helgaas To: Lorenzo Pieralisi Date: Fri, 15 Dec 2017 14:29:35 -0600 Message-ID: <20171215202935.157396.74423.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171215_123003_748915_F47C0134 X-CRM114-Status: UNSURE ( 6.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, Shawn Lin , linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bjorn Helgaas In rockchip_pcie_valid_device(), we do the exact same test twice: if (bus->number == rockchip->root_bus_nr && dev > 0) return 0; if (bus->number == rockchip->root_bus_nr && dev > 0) return 0; We only need to do it once, so remove one of them. Signed-off-by: Bjorn Helgaas --- drivers/pci/host/pcie-rockchip.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c index 9051c6c8fea4..dd9c7ea69e0b 100644 --- a/drivers/pci/host/pcie-rockchip.c +++ b/drivers/pci/host/pcie-rockchip.c @@ -293,10 +293,6 @@ static void rockchip_pcie_update_txcredit_mui(struct rockchip_pcie *rockchip) static int rockchip_pcie_valid_device(struct rockchip_pcie *rockchip, struct pci_bus *bus, int dev) { - /* access only one slot on each root port */ - if (bus->number == rockchip->root_bus_nr && dev > 0) - return 0; - /* * do not read more than one device on the bus directly attached * to RC's downstream side.