Skip to contentSkip to conversation

imx8m: clock_imx8mm: Staticize functions

PATCH New Alifer Moraes 2 participants 6 messages Jan 14, 2020 – Jan 20, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 imx8m: clock_imx8mm: Staticize functions

Functions fracpll_configure(), decode_intpll(), decode_fracpll(), get_root_src_clk() and get_root_clk() are used only in the scope of this file, so make them static to fix the following sparse warnings:

arch/arm/mach-imx/imx8m/clock_imx8mm.c:50:5: warning: no previous prototype for ‘fracpll_configure’ [-Wmissing-prototypes] arch/arm/mach-imx/imx8m/clock_imx8mm.c:271:5: warning: no previous prototype for ‘decode_intpll’ [-Wmissing-prototypes] arch/arm/mach-imx/imx8m/clock_imx8mm.c:418:5: warning: no previous prototype for ‘decode_fracpll’ [-Wmissing-prototypes] arch/arm/mach-imx/imx8m/clock_imx8mm.c:483:5: warning: no previous prototype for ‘get_root_src_clk’ [-Wmissing-prototypes] arch/arm/mach-imx/imx8m/clock_imx8mm.c:527:5: warning: no previous prototype for ‘get_root_clk’ [-Wmissing-prototypes]

---
 arch/arm/mach-imx/imx8m/clock_imx8mm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-imx/imx8m/clock_imx8mm.c +5 -5
index ca4b4c05ab..c423ac0058 100644
@@ -47,7 +47,7 @@ static struct imx_int_pll_rate_table imx8mm_fracpll_tbl[] = {
 	PLL_1443X_RATE(100000000U, 300, 9, 3, 0),
 };
 
-int fracpll_configure(enum pll_clocks pll, u32 freq)
+static int fracpll_configure(enum pll_clocks pll, u32 freq)
 {
 	int i;
 	u32 tmp, div_val;
@@ -268,7 +268,7 @@ u32 imx_get_uartclk(void)
 	return 24000000U;
 }
 
-u32 decode_intpll(enum clk_root_src intpll)
+static u32 decode_intpll(enum clk_root_src intpll)
 {
 	u32 pll_gnrl_ctl, pll_div_ctl, pll_clke_mask;
 	u32 main_div, pre_div, post_div, div;
@@ -415,7 +415,7 @@ u32 decode_intpll(enum clk_root_src intpll)
 	return lldiv(freq, pre_div * (1 << post_div) * div);
 }
 
-u32 decode_fracpll(enum clk_root_src frac_pll)
+static u32 decode_fracpll(enum clk_root_src frac_pll)
 {
 	u32 pll_gnrl_ctl, pll_fdiv_ctl0, pll_fdiv_ctl1;
 	u32 main_div, pre_div, post_div, k;
@@ -480,7 +480,7 @@ u32 decode_fracpll(enum clk_root_src frac_pll)
 		     65536 * pre_div * (1 << post_div));
 }
 
-u32 get_root_src_clk(enum clk_root_src root_src)
+static u32 get_root_src_clk(enum clk_root_src root_src)
 {
 	switch (root_src) {
 	case OSC_24M_CLK:
@@ -524,7 +524,7 @@ u32 get_root_src_clk(enum clk_root_src root_src)
 	return 0;
 }
 
-u32 get_root_clk(enum clk_root_index clock_id)
+static u32 get_root_clk(enum clk_root_index clock_id)
 {
 	enum clk_root_src root_src;
 	u32 post_podf, pre_podf, root_src_clk;
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/3 mx8mm_evk: spl: Staticize functions

Functions spl_dram_init() and power_init_board() are used only in the scope of this file, so make them static to fix the following sparse warnings:

board/freescale/imx8mm_evk/spl.c:40:6: warning: no previous prototype for ‘spl_dram_init’ [-Wmissing-prototypes]

board/freescale/imx8mm_evk/spl.c:85:5: warning: no previous prototype for ‘power_init_board’ [-Wmissing-prototypes]

---
 board/freescale/imx8mm_evk/spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/freescale/imx8mm_evk/spl.c +2 -2
index 2d08f9a563..e28f795676 100644
@@ -37,7 +37,7 @@ int spl_board_boot_device(enum boot_device boot_dev_spl)
 	}
 }
 
-void spl_dram_init(void)
+static void spl_dram_init(void)
 {
 	ddr_init(&dram_timing);
 }
@@ -82,7 +82,7 @@ int board_early_init_f(void)
 	return 0;
 }
 
-int power_init_board(void)
+static int power_init_board(void)
 {
 	struct udevice *dev;
 	int ret;
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/3 mx8mm_evk: spl: Staticize functions

Quoted 8 lines

Functions spl_dram_init() and power_init_board() are used only in the scope of this file, so make them static to fix the following sparse warnings:
board/freescale/imx8mm_evk/spl.c:40:6: warning: no previous prototype for ‘spl_dram_init’ [-Wmissing-prototypes] board/freescale/imx8mm_evk/spl.c:85:5: warning: no previous prototype for ‘power_init_board’ [-Wmissing-prototypes]

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 3/3 spl: Add prototype to function spl_board_boot_device()

In reply to Alifer Moraes

Add prototype to function spl_board_boot_device to fix the following sparse warning:

board/freescale/imx8mm_evk/spl.c:26:5: warning: no previous prototype for ‘spl_board_boot_device’ [-Wmissing-prototypes]

---
 include/spl.h | 1 +
 1 file changed, 1 insertion(+)
include/spl.h +1 -0
index 02aa1ff85d..8a311fefad 100644
@@ -269,6 +269,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
 void spl_board_prepare_for_linux(void);
 void spl_board_prepare_for_boot(void);
 int spl_board_ubi_load_image(u32 boot_device);
+int spl_board_boot_device(u32 boot_device);
 
 /**
  * jump_to_image_linux() - Jump to a Linux kernel from SPL
Signature · 1 line
2.17.1
#4 lore raw

PATCH 3/3 spl: Add prototype to function spl_board_boot_device()

Quoted 5 lines

Add prototype to function spl_board_boot_device to fix the following sparse warning:
board/freescale/imx8mm_evk/spl.c:26:5: warning: no previous prototype for ‘spl_board_boot_device’ [-Wmissing-prototypes]

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#5 lore raw

PATCH 1/3 imx8m: clock_imx8mm: Staticize functions

In reply to Alifer Moraes
Quoted 13 lines

Functions fracpll_configure(), decode_intpll(), decode_fracpll(), get_root_src_clk() and get_root_clk() are used only in the scope of this file, so make them static to fix the following sparse warnings:
arch/arm/mach-imx/imx8m/clock_imx8mm.c:50:5: warning: no previous prototype for ‘fracpll_configure’ [-Wmissing-prototypes] arch/arm/mach-imx/imx8m/clock_imx8mm.c:271:5: warning: no previous prototype for ‘decode_intpll’ [-Wmissing-prototypes] arch/arm/mach-imx/imx8m/clock_imx8mm.c:418:5: warning: no previous prototype for ‘decode_fracpll’ [-Wmissing-prototypes] arch/arm/mach-imx/imx8m/clock_imx8mm.c:483:5: warning: no previous prototype for ‘get_root_src_clk’ [-Wmissing-prototypes] arch/arm/mach-imx/imx8m/clock_imx8mm.c:527:5: warning: no previous prototype for ‘get_root_clk’ [-Wmissing-prototypes]

Quoted 1 line

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================