stm32mp1: zeromem device_info struct
authorYann Gautier <yann.gautier@st.com>
Thu, 7 Mar 2019 09:54:34 +0000 (10:54 +0100)
committerYann Gautier <yann.gautier@st.com>
Thu, 7 Mar 2019 09:56:17 +0000 (10:56 +0100)
The change of the structure highlighted the fact that all fields are not
correctly initialized with zeroes.

Replace the other memset in the function with zeromem, as it is faster.

Change-Id: I27f45a64e34637f79fa519f486bf5936721ef396
Signed-off-by: Yann Gautier <yann.gautier@st.com>
plat/st/common/bl2_io_storage.c

index c8bb559f4f851769329c0e40f8047afbe5b28133..f1721602dfb2329a71cec2e81ce6fbd610d29daa 100644 (file)
@@ -194,7 +194,8 @@ void stm32mp_io_setup(void)
        case BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_EMMC:
                dmbsy();
 
-               memset(&params, 0, sizeof(struct stm32_sdmmc2_params));
+               zeromem(&device_info, sizeof(struct mmc_device_info));
+               zeromem(&params, sizeof(struct stm32_sdmmc2_params));
 
                if (boot_context->boot_interface_selected ==
                    BOOT_API_CTX_BOOT_INTERFACE_SEL_FLASH_EMMC) {