diff mbox series

[3/4] firmware: ti_sci: Remove inline keyword from functions

Message ID 20220726012506.19368-4-afd@ti.com
State Accepted
Commit f127a58e054b5607803da62e2b80cb4cd4194938
Delegated to: Tom Rini
Headers show
Series Reduce TI-SCI driver size to fix am65x_evm_r5 build | expand

Commit Message

Andrew Davis July 26, 2022, 1:25 a.m. UTC
The inline hint is not needed here, the compiler will do the right thing
based on if we are compiling for speed or for code size. In this case the
inline causes this function to be placed inside each callsite which is
not the right thing to do for either speed nor size. There is no
performance benefit to this due to the larger function size reducing
cache locality, but there is a huge size penalty. Remove inline keyword.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/firmware/ti_sci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Tom Rini Aug. 26, 2022, 6:49 p.m. UTC | #1
On Mon, Jul 25, 2022 at 08:25:05PM -0500, Andrew Davis wrote:

> The inline hint is not needed here, the compiler will do the right thing
> based on if we are compiling for speed or for code size. In this case the
> inline causes this function to be placed inside each callsite which is
> not the right thing to do for either speed nor size. There is no
> performance benefit to this due to the larger function size reducing
> cache locality, but there is a huge size penalty. Remove inline keyword.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 687acbf2b4..facc0709ae 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -164,7 +164,7 @@  static struct ti_sci_xfer *ti_sci_setup_one_xfer(struct ti_sci_info *info,
  *	   return corresponding error, else if all goes well,
  *	   return 0.
  */
-static inline int ti_sci_get_response(struct ti_sci_info *info,
+static int ti_sci_get_response(struct ti_sci_info *info,
 				      struct ti_sci_xfer *xfer,
 				      struct mbox_chan *chan)
 {
@@ -218,7 +218,7 @@  static inline int ti_sci_get_response(struct ti_sci_info *info,
  *
  * Return: 0 if all went fine, else return appropriate error.
  */
-static inline int ti_sci_do_xfer(struct ti_sci_info *info,
+static int ti_sci_do_xfer(struct ti_sci_info *info,
 				 struct ti_sci_xfer *xfer)
 {
 	struct k3_sec_proxy_msg *msg = &xfer->tx_message;
@@ -310,7 +310,7 @@  static int ti_sci_cmd_get_revision(struct ti_sci_handle *handle)
  *
  * Return: true if the response was an ACK, else returns false.
  */
-static inline bool ti_sci_is_response_ack(void *r)
+static bool ti_sci_is_response_ack(void *r)
 {
 	struct ti_sci_msg_hdr *hdr = r;