Remove whitespace that occurs before ')'.
[fw/openocd] / src / flash / mflash.c
index 24eecfc603800e3f6f33fc9eab673322068e1410..cfcb8ec63cfa8be47ad8e01151eee9781ec070c3 100644 (file)
@@ -217,7 +217,7 @@ static int mg_dsk_wait(mg_io_type_wait wait, uint32_t time)
        uint32_t mg_task_reg = mflash_bank->base + MG_REG_OFFSET;
        duration_t duration;
        int ret;
-       long long t=0;
+       long long t = 0;
 
        duration_start_measure(&duration);
 
@@ -232,7 +232,7 @@ static int mg_dsk_wait(mg_io_type_wait wait, uint32_t time)
                        if (wait == mg_io_wait_bsy)
                                return ERROR_OK;
                } else {
-                       switch(wait)
+                       switch (wait)
                        {
                                case mg_io_wait_not_bsy:
                                        return ERROR_OK;
@@ -277,8 +277,8 @@ static int mg_dsk_wait(mg_io_type_wait wait, uint32_t time)
 
                duration_stop_measure(&duration, NULL);
 
-               t=duration.duration.tv_usec/1000;
-               t+=duration.duration.tv_sec*1000;
+               t = duration.duration.tv_usec/1000;
+               t += duration.duration.tv_sec*1000;
 
                if (t > time)
                        break;
@@ -298,7 +298,7 @@ static int mg_dsk_srst(uint8_t on)
        if ((ret = target_read_u8(target, mg_task_reg + MG_REG_DRV_CTRL, &value)) != ERROR_OK)
                return ret;
 
-       if(on) {
+       if (on) {
                value |= (mg_io_rbit_devc_srst);
        } else {
                value &= ~mg_io_rbit_devc_srst;
@@ -415,7 +415,7 @@ static int mg_probe_cmd(struct command_context_s *cmd_ctx, char *cmd, char **arg
 
        if (ret == ERROR_OK) {
                command_print(cmd_ctx, "mflash (total %" PRIu32 " sectors) found at 0x%8.8" PRIx32 "",
-                               mflash_bank->drv_info->tot_sects, mflash_bank->base );
+                               mflash_bank->drv_info->tot_sects, mflash_bank->base);
        }
 
        return ret;
@@ -429,7 +429,7 @@ static int mg_mflash_do_read_sects(void *buff, uint32_t sect_num, uint32_t sect_
        uint8_t *buff_ptr = buff;
        duration_t duration;
 
-       if ((ret = mg_dsk_io_cmd(sect_num, sect_cnt, mg_io_cmd_read)) != ERROR_OK )
+       if ((ret = mg_dsk_io_cmd(sect_num, sect_cnt, mg_io_cmd_read)) != ERROR_OK)
                return ret;
 
        address = mflash_bank->base + MG_BUFFER_OFFSET;
@@ -502,7 +502,7 @@ static int mg_mflash_do_write_sects(void *buff, uint32_t sect_num, uint32_t sect
        uint8_t *buff_ptr = buff;
        duration_t duration;
 
-       if ((ret = mg_dsk_io_cmd(sect_num, sect_cnt, cmd)) != ERROR_OK )
+       if ((ret = mg_dsk_io_cmd(sect_num, sect_cnt, cmd)) != ERROR_OK)
                return ret;
 
        address = mflash_bank->base + MG_BUFFER_OFFSET;
@@ -871,7 +871,7 @@ static int mg_pll_get_M(unsigned short feedback_div)
 {
        int i, M;
 
-       for (i = 1, M=0; i < 512; i <<= 1, feedback_div >>= 1)
+       for (i = 1, M = 0; i < 512; i <<= 1, feedback_div >>= 1)
                M += (feedback_div & 1) * i;
 
        return M + 2;
@@ -892,7 +892,7 @@ static int mg_pll_get_NO(unsigned char  output_div)
        int i, NO;
 
        for (i = 0, NO = 1; i < 2; ++i, output_div >>= 1)
-               if(output_div & 1)
+               if (output_div & 1)
                        NO = NO << 1;
 
        return NO;
@@ -923,7 +923,7 @@ static double mg_do_calc_pll(double XIN, mg_pll_t * p_pll_val, int is_approximat
 
                                CLK_OUT = XIN * ((double)M / N) / NO;
 
-                               if ((int)((CLK_OUT+ROUND) / DIV)
+                               if ((int)((CLK_OUT + ROUND) / DIV)
                                                == (int)(MG_PLL_CLK_OUT / DIV)) {
                                        if (mg_is_valid_pll(XIN, N, CLK_OUT, NO) == ERROR_OK)
                                        {