PCI: qcom: Make rst_names array static with const elements
Subsystems (4)
PATCH 1/1 PCI: qcom: Make rst_names array static with const elements
A static const string array often reduces size of the size of text section and can lead to an improved runtime performance as the need to initialize and populate the array every time a given function is called would be removed, contrary to local variables that live on the stack and have to be initialized every time the come into scope.
Thus, make the rst_names array a static const array with constant strings elements (stored in the .rodata section) so that it will be stored in the data section and accessible for the total lifetime of the running kernel.
Signed-off-by Krzysztof Wilczyński <[email protected]>
--- drivers/pci/controller/dwc/pcie-qcom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +3 -3
@@ -977,9 +977,9 @@ static int qcom_pcie_get_resources_2_3_3(struct qcom_pcie *pcie)struct dw_pcie *pci = pcie->pci;struct device *dev = pci->dev;int i; -const char *rst_names[] = {"axi_m" ,"axi_s" ,"pipe" , -"axi_m_sticky" ,"sticky" , -"ahb" ,"sleep" , }; +static const char *const rst_names[] = {"axi_m" ,"axi_s" ,"pipe" , +"axi_m_sticky" ,"sticky" , +"ahb" ,"sleep" , }; res->iface =devm_clk_get (dev,"iface" );if (IS_ERR (res->iface))
Signature · 1 line
2.33.0