From 2512ed1c56a7c415f5a13ac2f38f72278e3ac660 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Thu, 2 Dec 2021 21:31:54 +0000 Subject: Make inline functions in headers 'static inline' Future-proofing against newer versions of GCC/binutils which are stricter about the use of 'inline' functions in headers. Change-Id: Id620812ed340f0d790ba6c5b8b5cb1d700acfbbf --- firmware/target/mips/ingenic_x1000/clk-x1000.h | 4 ++-- firmware/target/mips/ingenic_x1000/sfc-x1000.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'firmware/target/mips/ingenic_x1000') diff --git a/firmware/target/mips/ingenic_x1000/clk-x1000.h b/firmware/target/mips/ingenic_x1000/clk-x1000.h index e19c56d0ba..f7153da564 100644 --- a/firmware/target/mips/ingenic_x1000/clk-x1000.h +++ b/firmware/target/mips/ingenic_x1000/clk-x1000.h @@ -80,13 +80,13 @@ extern void clk_set_ccr_div(uint32_t divbits); extern void clk_set_ddr(x1000_clk_t src, uint32_t div); /* Returns the smallest n such that infreq/n <= outfreq */ -inline uint32_t clk_calc_div(uint32_t infreq, uint32_t outfreq) +static inline uint32_t clk_calc_div(uint32_t infreq, uint32_t outfreq) { return (infreq + (outfreq - 1)) / outfreq; } /* Returns the smallest n such that (infreq >> n) <= outfreq */ -inline uint32_t clk_calc_shift(uint32_t infreq, uint32_t outfreq) +static inline uint32_t clk_calc_shift(uint32_t infreq, uint32_t outfreq) { uint32_t div = clk_calc_div(infreq, outfreq); return __builtin_clz(div) ^ 31; diff --git a/firmware/target/mips/ingenic_x1000/sfc-x1000.h b/firmware/target/mips/ingenic_x1000/sfc-x1000.h index d28bcb6740..afb4aa3ce6 100644 --- a/firmware/target/mips/ingenic_x1000/sfc-x1000.h +++ b/firmware/target/mips/ingenic_x1000/sfc-x1000.h @@ -87,13 +87,13 @@ extern void sfc_irq_end(void); extern void sfc_set_clock(uint32_t freq); /* Set the device configuration register */ -inline void sfc_set_dev_conf(uint32_t conf) +static inline void sfc_set_dev_conf(uint32_t conf) { REG_SFC_DEV_CONF = conf; } /* Control the state of the write protect pin */ -inline void sfc_set_wp_enable(bool en) +static inline void sfc_set_wp_enable(bool en) { jz_writef(SFC_GLB, WP_EN(en ? 1 : 0)); } -- cgit v1.2.3