x86: fsp: Use if() instead of #ifdef
authorSimon Glass <sjg@chromium.org>
Wed, 25 Sep 2019 14:11:27 +0000 (08:11 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 8 Oct 2019 05:53:48 +0000 (13:53 +0800)
Update a few #ifdefs to if() to improve build coverage.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: recover the codes that got wrongly deleted in dram_init()]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/lib/fsp1/fsp_common.c
arch/x86/lib/fsp1/fsp_dram.c

index 591eef7b813de4f4c8720298ad757b4eb1277ee6..bfd76dccbabe6a872842829e8192561620545df1 100644 (file)
@@ -116,11 +116,10 @@ int arch_fsp_init(void)
 #endif
 
        if (!gd->arch.hob_list) {
-#ifdef CONFIG_ENABLE_MRC_CACHE
-               nvs = fsp_prepare_mrc_cache();
-#else
-               nvs = NULL;
-#endif
+               if (IS_ENABLED(CONFIG_ENABLE_MRC_CACHE))
+                       nvs = fsp_prepare_mrc_cache();
+               else
+                       nvs = NULL;
 
 #ifdef CONFIG_HAVE_ACPI_RESUME
                if (prev_sleep_state == ACPI_S3) {
index 3bf65b495ca750be126ed304edab0e8d2ff9fba6..75341bc52872e1becf4ead5043fce175e7e8197d 100644 (file)
@@ -32,10 +32,9 @@ int dram_init(void)
        gd->ram_size = ram_size;
        post_code(POST_DRAM);
 
-#ifdef CONFIG_ENABLE_MRC_CACHE
-       gd->arch.mrc_output = fsp_get_nvs_data(gd->arch.hob_list,
+       if (IS_ENABLED(CONFIG_ENABLE_MRC_CACHE))
+               gd->arch.mrc_output = fsp_get_nvs_data(gd->arch.hob_list,
                                               &gd->arch.mrc_output_len);
-#endif
 
        return 0;
 }