aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2023-06-07 01:07:41 +0100
committerAndre Przywara <andre.przywara@arm.com>2023-07-21 00:29:42 +0100
commitc9dd624a380c2548afcbca0896e83fc6f2311a07 (patch)
tree499fbe1497b291947e723c7cc6f5c4662a658b62 /arch/arm
parent6acc5fa581b4049512b95dbf9ddaf1bda33cda21 (diff)
downloadu-boot-c9dd624a380c2548afcbca0896e83fc6f2311a07.zip
u-boot-c9dd624a380c2548afcbca0896e83fc6f2311a07.tar.gz
u-boot-c9dd624a380c2548afcbca0896e83fc6f2311a07.tar.bz2
sunxi: dram: make MBUS configuration functions static
The usage of the C keyword "inline" seems to be a common misunderstanding: it's a *hint* only, and modern compilers will inline (or not) functions based on their own judgement and provided compiler options. So while marking functions as "inline" does not do much, missing the "static" keyword will force to compiler to spell out a version of the function for potential external callers, which actually increases the code size (though hopefully the linker will drop the function). Change the "inline" attribute for the mbus_configure_port() functions in some Allwinner DRAM drivers to "static", so that the explicit version can actually be dropped from the object file, reducing the code size. "static inline" has a use case in header files, where it avoids a warning if a .c file including this header does not use the particular function. In a .c file itself "static inline" is not useful otherwise, so just use static here as well. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-sunxi/dram_sun50i_h6.c3
-rw-r--r--arch/arm/mach-sunxi/dram_sun50i_h616.c2
-rw-r--r--arch/arm/mach-sunxi/dram_sunxi_dw.c18
3 files changed, 12 insertions, 11 deletions
diff --git a/arch/arm/mach-sunxi/dram_sun50i_h6.c b/arch/arm/mach-sunxi/dram_sun50i_h6.c
index b332f3a..bff2e42 100644
--- a/arch/arm/mach-sunxi/dram_sun50i_h6.c
+++ b/arch/arm/mach-sunxi/dram_sun50i_h6.c
@@ -93,7 +93,8 @@ enum {
MBUS_QOS_HIGH,
MBUS_QOS_HIGHEST
};
-inline void mbus_configure_port(u8 port,
+
+static void mbus_configure_port(u8 port,
bool bwlimit,
bool priority,
u8 qos,
diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c
index 1f9416d..02f6b2a 100644
--- a/arch/arm/mach-sunxi/dram_sun50i_h616.c
+++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c
@@ -31,7 +31,7 @@ enum {
MBUS_QOS_HIGHEST
};
-inline void mbus_configure_port(u8 port,
+static void mbus_configure_port(u8 port,
bool bwlimit,
bool priority,
u8 qos,
diff --git a/arch/arm/mach-sunxi/dram_sunxi_dw.c b/arch/arm/mach-sunxi/dram_sunxi_dw.c
index 4af5922..9382d3d 100644
--- a/arch/arm/mach-sunxi/dram_sunxi_dw.c
+++ b/arch/arm/mach-sunxi/dram_sunxi_dw.c
@@ -81,15 +81,15 @@ enum {
MBUS_QOS_HIGHEST
};
-static inline void mbus_configure_port(u8 port,
- bool bwlimit,
- bool priority,
- u8 qos, /* MBUS_QOS_LOWEST .. MBUS_QOS_HIGEST */
- u8 waittime, /* 0 .. 0xf */
- u8 acs, /* 0 .. 0xff */
- u16 bwl0, /* 0 .. 0xffff, bandwidth limit in MB/s */
- u16 bwl1,
- u16 bwl2)
+static void mbus_configure_port(u8 port,
+ bool bwlimit,
+ bool priority,
+ u8 qos, /* MBUS_QOS_LOWEST .. MBUS_QOS_HIGEST */
+ u8 waittime, /* 0 .. 0xf */
+ u8 acs, /* 0 .. 0xff */
+ u16 bwl0, /* 0 .. 0xffff, bandwidth limit in MB/s */
+ u16 bwl1,
+ u16 bwl2)
{
struct sunxi_mctl_com_reg * const mctl_com =
(struct sunxi_mctl_com_reg *)SUNXI_DRAM_COM_BASE;