rk3399: m0: Fix compiler warnings.
authorChristoph Müllner <[email protected]>
Mon, 15 Apr 2019 19:42:29 +0000 (21:42 +0200)
committerChristoph Müllner <[email protected]>
Wed, 24 Apr 2019 21:03:10 +0000 (23:03 +0200)
GCC complains for quite some versions, when compiling the M0 firmware
for Rockchip's rk3399 platform, about an invalid type of function 'main':

  warning: return type of 'main' is not 'int' [-Wmain]

This patch addresses this, by renaming the function to 'm0_main'.

Signed-off-by: Christoph Müllner <[email protected]>
Change-Id: I10887f2bda6bdb48c5017044c264139004f7c785

plat/rockchip/rk3399/drivers/m0/src/dram.c
plat/rockchip/rk3399/drivers/m0/src/startup.c
plat/rockchip/rk3399/drivers/m0/src/suspend.c

index b939a9605dea26e9c8d90bce8f83546202bed9f7..84e88849e12e8e42fe36d21c61e0d407fb60cf07 100644 (file)
@@ -55,7 +55,7 @@ static void ddr_set_pll(void)
        mmio_write_32(CRU_BASE + CRU_DPLL_CON3, PLL_MODE(PLL_NORMAL_MODE));
 }
 
-__attribute__((noreturn)) void main(void)
+__attribute__((noreturn)) void m0_main(void)
 {
        mmio_setbits_32(PHY_REG(0, 927), (1 << 22));
        mmio_setbits_32(PHY_REG(1, 927), (1 << 22));
index dba031370ce8d15a46e8cef849eb2ce6e07a922c..dfd8af230ebe4c4dfefb73ffceddef3cad1a386b 100644 (file)
@@ -23,7 +23,7 @@ void WEAK svc_handler(void);
 void WEAK pend_sv_handler(void);
 void WEAK systick_handler(void);
 
-extern int main(void);
+extern int m0_main(void);
 
 /* Function prototypes */
 static void default_reset_handler(void);
@@ -59,12 +59,12 @@ void (* const g_pfnVectors[])(void) = {
  * This is the code that gets called when the processor first
  * starts execution following a reset event. Only the absolutely
  * necessary set is performed, after which the application
- * supplied main() routine is called.
+ * supplied m0_main() routine is called.
  */
 static void default_reset_handler(void)
 {
        /* call the application's entry point */
-       main();
+       m0_main();
 }
 
 /**
index 39dfd113820816b090782ac841ba01b1f63afd13..9ad2fa26a1775e57aa41520174b2a971b23e628f 100644 (file)
@@ -11,7 +11,7 @@
 
 #define SCR_SLEEPDEEP_SHIFT    (1 << 2)
 
-__attribute__((noreturn)) void main(void)
+__attribute__((noreturn)) void m0_main(void)
 {
        unsigned int status_value;