From: Niklas Cassel <cassel@kernel.org>
To: "Jingoo Han" <jingoohan1@gmail.com>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>
Cc: Damien Le Moal <dlemoal@kernel.org>,
Shawn Lin <shawn.lin@rock-chips.com>,
Niklas Cassel <cassel@kernel.org>,
linux-pci@vger.kernel.org
Subject: [PATCH 1/2] PCI: dwc: ep: Remove superfluous function dw_pcie_ep_find_ext_capability()
Date: Fri, 21 Feb 2025 21:26:47 +0100 [thread overview]
Message-ID: <20250221202646.395252-3-cassel@kernel.org> (raw)
Remove the superfluous function dw_pcie_ep_find_ext_capability(), as it is
virtually identical to dw_pcie_find_ext_capability().
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
.../pci/controller/dwc/pcie-designware-ep.c | 24 +++----------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index f9d7f3f989ad..20f2436c7091 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -102,24 +102,6 @@ static u8 dw_pcie_ep_find_capability(struct dw_pcie_ep *ep, u8 func_no, u8 cap)
return __dw_pcie_ep_find_next_cap(ep, func_no, next_cap_ptr, cap);
}
-static unsigned int dw_pcie_ep_find_ext_capability(struct dw_pcie *pci, int cap)
-{
- u32 header;
- int pos = PCI_CFG_SPACE_SIZE;
-
- while (pos) {
- header = dw_pcie_readl_dbi(pci, pos);
- if (PCI_EXT_CAP_ID(header) == cap)
- return pos;
-
- pos = PCI_EXT_CAP_NEXT(header);
- if (!pos)
- break;
- }
-
- return 0;
-}
-
static int dw_pcie_ep_write_header(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
struct pci_epf_header *hdr)
{
@@ -230,7 +212,7 @@ static unsigned int dw_pcie_ep_get_rebar_offset(struct dw_pcie *pci,
unsigned int offset, nbars;
int i;
- offset = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR);
+ offset = dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR);
if (!offset)
return offset;
@@ -847,7 +829,7 @@ static void dw_pcie_ep_init_non_sticky_registers(struct dw_pcie *pci)
enum pci_barno bar;
u32 reg, i, val;
- offset = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR);
+ offset = dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR);
dw_pcie_dbi_ro_wr_en(pci);
@@ -970,7 +952,7 @@ int dw_pcie_ep_init_registers(struct dw_pcie_ep *ep)
if (ep->ops->init)
ep->ops->init(ep);
- ptm_cap_base = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_PTM);
+ ptm_cap_base = dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_PTM);
/*
* PTM responder capability can be disabled only after disabling
--
2.48.1
next reply other threads:[~2025-02-21 20:26 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 20:26 Niklas Cassel [this message]
2025-02-21 20:26 ` [PATCH 2/2] PCI: dw-rockchip: hide broken ATS capability Niklas Cassel
2025-02-21 20:26 ` Niklas Cassel
2025-02-22 0:00 ` Bjorn Helgaas
2025-02-22 0:00 ` Bjorn Helgaas
2025-02-22 7:40 ` Krzysztof Wilczyński
2025-02-22 7:40 ` Krzysztof Wilczyński
2025-02-24 14:18 ` Krzysztof Wilczyński
2025-02-24 14:18 ` Krzysztof Wilczyński
2025-02-22 7:38 ` Krzysztof Wilczyński
2025-02-22 7:38 ` Krzysztof Wilczyński
2025-02-22 16:08 ` Manivannan Sadhasivam
2025-02-22 16:08 ` Manivannan Sadhasivam
2025-03-07 12:29 ` Niklas Cassel
2025-03-07 12:29 ` Niklas Cassel
2025-02-25 1:35 ` Shawn Lin
2025-02-25 1:35 ` Shawn Lin
2025-02-25 12:27 ` Niklas Cassel
2025-02-25 12:27 ` Niklas Cassel
2025-02-22 15:50 ` [PATCH 1/2] PCI: dwc: ep: Remove superfluous function dw_pcie_ep_find_ext_capability() Manivannan Sadhasivam
2025-02-24 13:25 ` Niklas Cassel
2025-02-24 14:02 ` Krzysztof Wilczyński
2025-02-26 14:38 ` Krzysztof Wilczyński
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250221202646.395252-3-cassel@kernel.org \
--to=cassel@kernel.org \
--cc=bhelgaas@google.com \
--cc=dlemoal@kernel.org \
--cc=jingoohan1@gmail.com \
--cc=kw@linux.com \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=robh@kernel.org \
--cc=shawn.lin@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.