diff mbox series

pci: rockchip: Mark inline functions as static inline

Message ID 20200701154752.12805-1-trini@konsulko.com
State Accepted
Delegated to: Tom Rini
Headers show
Series pci: rockchip: Mark inline functions as static inline | expand

Commit Message

Tom Rini July 1, 2020, 3:47 p.m. UTC
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 <jagan@amarulasolutions.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 drivers/pci/pcie_rockchip.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Philipp Tomsich July 2, 2020, 9:38 a.m. UTC | #1
> On 01.07.2020, at 17:47, Tom Rini <trini@konsulko.com> wrote:
> 
> 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 <jagan@amarulasolutions.com>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Kever Yang July 8, 2020, 10:05 a.m. UTC | #2
On 2020/7/1 下午11:47, Tom Rini wrote:
> 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 <jagan@amarulasolutions.com>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>

Reviewed-by: Kever Yang<kever.yang@rock-chips.com>

Thanks,
- Kever

> ---
>   drivers/pci/pcie_rockchip.h | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/pcie_rockchip.h b/drivers/pci/pcie_rockchip.h
> index c3a0a2846d45..845d5059e111 100644
> --- a/drivers/pci/pcie_rockchip.h
> +++ b/drivers/pci/pcie_rockchip.h
> @@ -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;
>   }
diff mbox series

Patch

diff --git a/drivers/pci/pcie_rockchip.h b/drivers/pci/pcie_rockchip.h
index c3a0a2846d45..845d5059e111 100644
--- a/drivers/pci/pcie_rockchip.h
+++ b/drivers/pci/pcie_rockchip.h
@@ -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;
 }