sunxi: dram: make MBUS configuration functions static
authorAndre Przywara <andre.przywara@arm.com>
Wed, 7 Jun 2023 00:07:41 +0000 (01:07 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Thu, 20 Jul 2023 23:29:42 +0000 (00:29 +0100)
commitc9dd624a380c2548afcbca0896e83fc6f2311a07
tree499fbe1497b291947e723c7cc6f5c4662a658b62
parent6acc5fa581b4049512b95dbf9ddaf1bda33cda21
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>
arch/arm/mach-sunxi/dram_sun50i_h6.c
arch/arm/mach-sunxi/dram_sun50i_h616.c
arch/arm/mach-sunxi/dram_sunxi_dw.c