X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fflash%2Focl.c;h=a2dac50a31b363a35e62c9903ff05d9711788062;hb=fb50efc6e712f413d109c3d77683d0358a557ed4;hp=9997bc0bc458352d12b7993a753dcb926e38505f;hpb=b96052d5918592ed185a487fd4d741de4f0edd5c;p=openocd diff --git a/src/flash/ocl.c b/src/flash/ocl.c index 9997bc0b..a2dac50a 100644 --- a/src/flash/ocl.c +++ b/src/flash/ocl.c @@ -139,7 +139,7 @@ static int ocl_erase(struct flash_bank_s *bank, int first, int last) } /* receive response */ - if ((retval = embeddedice_receive(ocl->jtag_info, dcc_buffer+1, 1) != ERROR_OK)) + if ((retval = embeddedice_receive(ocl->jtag_info, dcc_buffer + 1, 1) != ERROR_OK)) return retval; if (dcc_buffer[1] != OCL_CMD_DONE) @@ -172,7 +172,7 @@ static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset int i; /* check preconditions */ - if (ocl->buflen == 0 || ocl->bufalign==0) + if (ocl->buflen == 0 || ocl->bufalign == 0) return ERROR_FLASH_BANK_NOT_PROBED; if (bank->target->state != TARGET_RUNNING) @@ -182,7 +182,7 @@ static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset } /* allocate buffer for max. ocl buffer + overhead */ - dcc_buffer = malloc(sizeof(uint32_t)*(ocl->buflen/4+3)); + dcc_buffer = malloc(sizeof(uint32_t)*(ocl->buflen/4 + 3)); while (count) { @@ -200,7 +200,7 @@ static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset chksum = OCL_CHKS_INIT; /* copy data to DCC buffer in proper byte order and properly aligned */ - for (i=0; isize / bank->num_sectors; - for (i=0; inum_sectors; i++) + for (i = 0; i < bank->num_sectors; i++) { bank->sectors[i].offset = i * sectsize; bank->sectors[i].size = sectsize; @@ -373,7 +373,7 @@ static int ocl_auto_probe(struct flash_bank_s *bank) { ocl_priv_t *ocl = bank->driver_priv; - if (ocl->buflen == 0 || ocl->bufalign==0) + if (ocl->buflen == 0 || ocl->bufalign == 0) return ERROR_FLASH_BANK_NOT_PROBED; return ERROR_OK;