x86: fsp: Avoid cast stack_top in struct shared_data
authorBin Meng <bmeng.cn@gmail.com>
Fri, 11 Dec 2015 06:02:57 +0000 (22:02 -0800)
committerBin Meng <bmeng.cn@gmail.com>
Wed, 13 Jan 2016 04:20:13 +0000 (12:20 +0800)
Declare stack_top as u32 in struct shared_data and struct common_buf
so that we can avoid casting in fsp_init().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
arch/x86/include/asm/fsp/fsp_api.h
arch/x86/include/asm/fsp/fsp_support.h
arch/x86/lib/fsp/fsp_support.c

index 2d34d138abdd8c60f832aa04a173b595947649c1..db83e35e1d47d4d373f306aee7054ae0bdd6ccc7 100644 (file)
@@ -30,7 +30,7 @@ struct common_buf {
         * Stack top pointer used by the bootloader. The new stack frame will be
         * set up at this location after FspInit API call.
         */
-       u32     *stack_top;
+       u32     stack_top;
        u32     boot_mode;      /* Current system boot mode */
        void    *upd_data;      /* User platform configuraiton data region */
        u32     reserved[7];    /* Reserved */
index f30d7b4854d16b0fe457cca5606f974786c31eeb..685778e11e2480b6894afa183c6ceb22c436a9be 100644 (file)
@@ -20,7 +20,7 @@
 
 struct shared_data {
        struct fsp_header       *fsp_hdr;
-       u32                     *stack_top;
+       u32                     stack_top;
        struct upd_region       fsp_upd;
 };
 
index 0408b5d5cd6b1f0c47a34d8a0d49197210c2900b..df62ba80975f6b15410d6440dbad435d9dee187a 100644 (file)
@@ -122,7 +122,7 @@ void fsp_init(u32 stack_top, u32 boot_mode, void *nvs_buf)
        memset(&rt_buf, 0, sizeof(struct fspinit_rtbuf));
 
        /* Reserve a gap in stack top */
-       rt_buf.common.stack_top = (u32 *)stack_top - 32;
+       rt_buf.common.stack_top = stack_top - 32;
        rt_buf.common.boot_mode = boot_mode;
        rt_buf.common.upd_data = fsp_upd;
 
@@ -152,7 +152,7 @@ void fsp_init(u32 stack_top, u32 boot_mode, void *nvs_buf)
        params_ptr = &params;
 
        shared_data.fsp_hdr = fsp_hdr;
-       shared_data.stack_top = (u32 *)stack_top;
+       shared_data.stack_top = stack_top;
 
        post_code(POST_PRE_MRC);