]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
mmc: remove hc_wp_grp_size from struct mmc if not needed
authorJean-Jacques Hiblot <jjhiblot@ti.com>
Thu, 4 Jan 2018 14:23:36 +0000 (15:23 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 12 Jan 2018 09:11:24 +0000 (18:11 +0900)
hc_wp_grp_size is needed only if hardware partitionning is used.
On ARM removing it saves about 30 bytes of code space.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
cmd/mmc.c
drivers/mmc/mmc.c
include/mmc.h

index 65601d82c305226cf3fca845c94e52fbd43561aa..58fdc36f084ced3eb61554f874aea21c68c5c33d 100644 (file)
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -54,8 +54,10 @@ static void print_mmcinfo(struct mmc *mmc)
                bool has_enh = (mmc->part_support & ENHNCD_SUPPORT) != 0;
                bool usr_enh = has_enh && (mmc->part_attr & EXT_CSD_ENH_USR);
 
+#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
                puts("HC WP Group Size: ");
                print_size(((u64)mmc->hc_wp_grp_size) << 9, "\n");
+#endif
 
                puts("User Capacity: ");
                print_size(mmc->capacity_user, usr_enh ? " ENH" : "");
index c1ba57f86dd4a8b8be87f7a374c6579581ee69be..53c819187e7d8af392953b8c3d833ec8551a76d0 100644 (file)
@@ -2098,9 +2098,11 @@ static int mmc_startup_v4(struct mmc *mmc)
                        * (erase_gmul + 1);
        }
 #endif
+#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
        mmc->hc_wp_grp_size = 1024
                * ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]
                * ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
+#endif
 
        mmc->wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET];
 
index cd068b9429bf419d67ffa99e0f846899f5b36d89..a46eaed74699b982ca046bc34ea769c29a3283c4 100644 (file)
@@ -589,7 +589,9 @@ struct mmc {
        uint write_bl_len;
        uint erase_grp_size;    /* in 512-byte sectors */
 #endif
+#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
        uint hc_wp_grp_size;    /* in 512-byte sectors */
+#endif
 #if CONFIG_IS_ENABLED(MMC_WRITE)
        struct sd_ssr   ssr;    /* SD status register */
 #endif