From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,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 2061DC432C0 for ; Wed, 20 Nov 2019 02:38:22 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C80912245F for ; Wed, 20 Nov 2019 02:38:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XU2WI2Su" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C80912245F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 47Hn1R46lJzDqpG for ; Wed, 20 Nov 2019 13:38:19 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::543; helo=mail-pg1-x543.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XU2WI2Su"; dkim-atps=neutral Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 47HlWL3PCDzDqhD for ; Wed, 20 Nov 2019 12:30:38 +1100 (AEDT) Received: by mail-pg1-x543.google.com with SMTP id q17so12461457pgt.9 for ; Tue, 19 Nov 2019 17:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H9j4v8X64gGeA3xvelDLtKrVe6xtOiY4KBvhieJb6o0=; b=XU2WI2SuGGv6LYdgUe7v3MZiF2o2dQOoWcxkxbL4gqyVHMhehV9K1K2YtMJTc6tbKW /m30wKcjlI87SoW0IhI6jE4YjOeYy70lRwCMoaf11tWUbhCpSpgQvL49jpIpYRDpe+LU 5xd78J6EPsF1XkwhMK5i1jj8QNDjxyO87zZEy1idFSSx+sYHLea9yQf4xQcCDezTKyCI Xann+4vXcvN4QO3nllQgUCboKsS4SKDIATmJxUZGFwLHUtKCXqS77R814gjhj+vaS6pH QDogdEjBx/n/4HQVFgDQITtHSE51sVyQIdHdiTsLCFvXv9/BAn1OG7TFIwDzclfVVQwR hhew== 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=H9j4v8X64gGeA3xvelDLtKrVe6xtOiY4KBvhieJb6o0=; b=BPloTG1Ic9U7lSJgYHbMVtQ5wbqg4zIbM6VUK0HgQ0WD3mUYJa0CRNQUX8QORWHdXa 1cX0LabkmCK+k6Oz93EZAhKkJTijfB82r2UUFTopURZP4ekjrq5C/ikq5rI7AJjq95bz E4HhNNYOubTB6McrqaL7LQmu7J4vZDO1WYFW0hKqS3pXRw8GPNhd35sgPX5QQnIt44Tb esJKFzdEa67Rp5jG/gyfp5pgOW+1pcdRV05A3dSMdzsoX0pX7qdHZG1CAqIivDFgltrQ X/JtXfR/DCvMwqlr7IcSqGbKlYfMhmVRjRXWxCXQKFOmDK574eGYGRTD/FyMHmhGxguW vDng== X-Gm-Message-State: APjAAAUZibGWa9lYEVG1C2WQ/tRsqx56aO3iAl/EAFyNbyec1k1JtB3Z tkyH6vbYMgEq5RVRd9VFxaOWyFN2 X-Google-Smtp-Source: APXvYqxz+/yi9YE7D/csgyHOmHaNaalzVqNMkJcD8MrqLpeBik2SuX3uPkjDMgorKlL2XNieAX/zMg== X-Received: by 2002:a62:20e:: with SMTP id 14mr728150pfc.153.1574213432875; Tue, 19 Nov 2019 17:30:32 -0800 (PST) Received: from wafer.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id b24sm26662116pfi.148.2019.11.19.17.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 17:30:32 -0800 (PST) From: Oliver O'Halloran To: linuxppc-dev@lists.ozlabs.org Subject: [Very RFC 34/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_enable_device_hook() Date: Wed, 20 Nov 2019 12:28:47 +1100 Message-Id: <20191120012859.23300-35-oohall@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191120012859.23300-1-oohall@gmail.com> References: <20191120012859.23300-1-oohall@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair@popple.id.au, Oliver O'Halloran , s.miroshnichenko@yadro.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 7e88de18ead6..4f38652c7cd7 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -3382,7 +3382,6 @@ static resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev, static bool pnv_pci_enable_device_hook(struct pci_dev *dev) { struct pnv_phb *phb = pci_bus_to_pnvhb(dev->bus); - struct pci_dn *pdn; /* The function is probably called while the PEs have * not be created yet. For example, resource reassignment @@ -3392,11 +3391,7 @@ static bool pnv_pci_enable_device_hook(struct pci_dev *dev) if (!phb->initialized) return true; - pdn = pci_get_pdn(dev); - if (!pdn || pdn->pe_number == IODA_INVALID_PE) - return false; - - return true; + return !!pnv_ioda_get_pe(dev); } static long pnv_pci_ioda1_unset_window(struct iommu_table_group *table_group, -- 2.21.0