Skip to contentSkip to conversation

pci: rockchip: Mark inline functions as static inline

PATCH In review Tom Rini 3 participants 3 messages Jul 1, 2020 – Jul 8, 2020

Subsystems (2)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 pci: rockchip: Mark inline functions as static inline

Unless we mark the function as 'static inline' it may end up being non-inlined by the compiled and result in duplicate functions.

Cc Jagan Teki <[email protected]>
Cc Kever Yang <[email protected]>
---
 drivers/pci/pcie_rockchip.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pci/pcie_rockchip.h +2 -3
index c3a0a2846d45..845d5059e111 100644
@@ -130,13 +130,12 @@ struct rockchip_pcie {
 
 int rockchip_pcie_phy_get(struct udevice *dev);
 
-inline struct rockchip_pcie_phy *pcie_get_phy(struct rockchip_pcie *pcie)
+static inline struct rockchip_pcie_phy *pcie_get_phy(struct rockchip_pcie *pcie)
 {
 	return pcie->phy;
 }
 
-inline
-struct rockchip_pcie_phy_ops *phy_get_ops(struct rockchip_pcie_phy *phy)
+static inline struct rockchip_pcie_phy_ops *phy_get_ops(struct rockchip_pcie_phy *phy)
 {
 	return (struct rockchip_pcie_phy_ops *)phy->ops;
 }
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH] pci: rockchip: Mark inline functions as static inline【请注意,邮件由[email protected]代发】

In reply to Tom Rini
Quoted 6 lines · Tom Rini

Unless we mark the function as 'static inline' it may end up being non-inlined by the compiled and result in duplicate functions.

Cc Jagan Teki <[email protected]>
Cc Kever Yang <[email protected]>

Thanks,
- Kever

Quoted 24 lines
---
  drivers/pci/pcie_rockchip.h | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pci/pcie_rockchip.h +2 -3
index c3a0a2846d45..845d5059e111 100644
@@ -130,13 +130,12 @@ struct rockchip_pcie {
 
  int rockchip_pcie_phy_get(struct udevice *dev);
 
-inline struct rockchip_pcie_phy *pcie_get_phy(struct rockchip_pcie *pcie)
+static inline struct rockchip_pcie_phy *pcie_get_phy(struct rockchip_pcie *pcie)
  {
  	return pcie->phy;
  }
 
-inline
-struct rockchip_pcie_phy_ops *phy_get_ops(struct rockchip_pcie_phy *phy)
+static inline struct rockchip_pcie_phy_ops *phy_get_ops(struct rockchip_pcie_phy *phy)
  {
  	return (struct rockchip_pcie_phy_ops *)phy->ops;
  }