xloader: Panda - clean eliminate volatile temps
authorAndy Green <andy.green@linaro.org>
Wed, 9 Feb 2011 14:44:08 +0000 (14:44 +0000)
committerAnand Gadiyar <gadiyar@ti.com>
Mon, 14 Mar 2011 07:16:55 +0000 (12:46 +0530)
The Omap4 hsmmc code has three instances of volatile
temps that are not necessary.

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
cpu/omap4/mmc.c

index bd64f44..5484342 100644 (file)
@@ -62,21 +62,19 @@ unsigned char mmc_board_init(void)
 
 void mmc_init_stream(void)
 {
-       volatile unsigned int mmc_stat;
-
        OMAP_HSMMC_CON |= INIT_INITSTREAM;
 
        OMAP_HSMMC_CMD = MMC_CMD0;
-       do {
-               mmc_stat = OMAP_HSMMC_STAT;
-       } while (!(mmc_stat & CC_MASK));
+
+       while (!(OMAP_HSMMC_STAT & CC_MASK))
+               ;
 
        OMAP_HSMMC_STAT = CC_MASK;
 
        OMAP_HSMMC_CMD = MMC_CMD0;
-       do {
-               mmc_stat = OMAP_HSMMC_STAT;
-       } while (!(mmc_stat & CC_MASK));
+
+       while (!(OMAP_HSMMC_STAT & CC_MASK))
+               ;
 
        OMAP_HSMMC_STAT = OMAP_HSMMC_STAT;
        OMAP_HSMMC_CON &= ~INIT_INITSTREAM;
@@ -148,7 +146,7 @@ unsigned char mmc_init_setup(void)
 unsigned char mmc_send_cmd(unsigned int cmd, unsigned int arg,
                           unsigned int *response)
 {
-       volatile unsigned int mmc_stat;
+       unsigned int mmc_stat;
 
        while ((OMAP_HSMMC_PSTATE & DATI_MASK) == DATI_CMDDIS)
                ;
@@ -161,9 +159,9 @@ unsigned char mmc_send_cmd(unsigned int cmd, unsigned int arg,
            DE_DISABLE;
 
        while (1) {
-               do {
-                       mmc_stat = OMAP_HSMMC_STAT;
-               } while (mmc_stat == 0);
+               mmc_stat = OMAP_HSMMC_STAT;
+               if (mmc_stat == 0)
+                       continue;
 
                if ((mmc_stat & ERRI_MASK) != 0)
                        return (unsigned char) mmc_stat;
@@ -184,16 +182,16 @@ unsigned char mmc_send_cmd(unsigned int cmd, unsigned int arg,
 
 unsigned char mmc_read_data(unsigned int *output_buf)
 {
-       volatile unsigned int mmc_stat;
+       unsigned int mmc_stat;
        unsigned int read_count = 0;
 
        /*
         * Start Polled Read
         */
        while (1) {
-               do {
-                       mmc_stat = OMAP_HSMMC_STAT;
-               } while (mmc_stat == 0);
+               mmc_stat = OMAP_HSMMC_STAT;
+               if (mmc_stat == 0)
+                       continue;
 
                if ((mmc_stat & ERRI_MASK) != 0)
                        return (unsigned char) mmc_stat;