mmc: fix the compile warning in mmc.c 39/155539/2 accepted/tizen_4.0_unified tizen tizen_4.0 accepted/tizen/4.0/unified/20171018.231717 submit/tizen_4.0/20171018.024233 submit/tizen_4.0/20171018.060355 tizen_4.0.IoT.p2_release tizen_4.0.m2_release
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 13 Oct 2017 05:22:13 +0000 (14:22 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Fri, 13 Oct 2017 11:41:06 +0000 (11:41 +0000)
There are some compile warnings in mmc.c
This patch is for fixing them.

Change-Id: I1dc5ae6ef4ea6461b4d4635fbc5fecc66939c886
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/mmc.c

index e5dce266cee9f7087289b7b9fa469e4760b3906e..1eff19cc21d7a3f75e8e86e25550f95934aa4ffd 100644 (file)
@@ -302,6 +302,7 @@ int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)
 
 }
 
+#ifndef CONFIG_S5P_MSHC
 static ulong mmc_erase_t(struct mmc *mmc, ulong start, lbaint_t blkcnt, int sec)
 {
        struct mmc_cmd cmd;
@@ -423,21 +424,18 @@ mmc_berase(int dev_num, unsigned long start, lbaint_t blkcnt)
 
        return blk;
 }
+#endif
 
 #if defined(CONFIG_S5P_MSHC)
 static unsigned long
 mmc_erase(int dev_num, unsigned long start, lbaint_t block)
 {
        int err;
-       lbaint_t count, erase_time, dis, blk_hc;
+       lbaint_t count, erase_time, dis, blk_hc = 0;
        lbaint_t return_blk = block;
        struct mmc_cmd cmd;
        struct mmc *mmc = find_mmc_device(dev_num);
 
-       printf("START: %d BLOCK: %d\n", start, block);
-       printf("high_capacity: %d\n", mmc->high_capacity);
-       printf("Capacity: %d\n", mmc->capacity);
-
        /* Byte addressing */
        if (mmc->high_capacity == 0) {
                start = start * 512;
@@ -536,28 +534,28 @@ mmc_erase(int dev_num, unsigned long start, lbaint_t block)
                printf("*** High Capacity(higher than 2GB) MMC's erase "
                "minimum size is 512KB ***\n");
                if (block < 2) {
-                       printf("\n %d KB erase Done\n", block*512);
+                       printf("\n %lu KB erase Done\n", block*512);
                } else if ((block >= 2)&&(block < 2048)){
-                       printf("\n %d.%d MB erase Done\n", (block/2),
+                       printf("\n %lu.%lu MB erase Done\n", (block/2),
                        (block%2)*5);
                } else {
-                       printf("\n %d.%d GB erase Done\n",
+                       printf("\n %lu.%lu GB erase Done\n",
                        (block/2048),
                        ((block*1000)/2048) -
                        ((block/2048)*1000));
                }
        } else {
                if (block < 2) {
-                       printf("\n %d B erase Done\n", block*512);
+                       printf("\n %lu B erase Done\n", block*512);
                } else if ((block >= 2)&&(block < 2048)){
-                       printf("\n %d KB erase Done\n", (block/2));
+                       printf("\n %lu KB erase Done\n", (block/2));
                } else if ((block >= 2048)&&(block < (2048 * 1024))){
-                       printf("\n %d.%d MB erase Done\n",
+                       printf("\n %lu.%lu MB erase Done\n",
                        (block/2048),
                        ((block*1000)/2048) -
                        ((block/2048)*1000));
                } else {
-                       printf("\n %d.%d GB erase Done\n",
+                       printf("\n %lu.%lu GB erase Done\n",
                        (block/(2048*1024)),
                        ((block*10)/(2048*1024)) -
                        ((block/(2048*1024))*10));
@@ -1190,7 +1188,6 @@ int mmc_startup(struct mmc *mmc)
        u64 cmult, csize, capacity;
        struct mmc_cmd cmd;
        ALLOC_CACHE_ALIGN_BUFFER(char, ext_csd, 512);
-       ALLOC_CACHE_ALIGN_BUFFER(char, test_csd, 512);
        int timeout = 1000;
 
 #ifdef CONFIG_MMC_SPI_CRC_ON