diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-23 22:42:03 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-23 22:42:03 +0000 |
commit | 3813fda44adcea486b7308423a699f63d79273ee (patch) | |
tree | f515b454cfaea4806d0d307c1d19f1e3081482d1 /src | |
parent | aea6815462d3302f7f8b6576f59320d5f5985642 (diff) |
- Fixes '==' whitespace
- Replace ')\(==\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
39 files changed, 150 insertions, 150 deletions
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 27779a39..8b51b95b 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -284,7 +284,7 @@ static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16 target_write_u32(target, MC_FCR[bank->bank_number], fcr); LOG_DEBUG("Flash command: 0x%" PRIx32 ", flash bank: %i, page number: %u", fcr, bank->bank_number+1, pagen); - if ((at91sam7_info->cidr_arch == 0x60) && ((cmd==SLB)|(cmd==CLB))) + if ((at91sam7_info->cidr_arch == 0x60) && ((cmd == SLB)|(cmd == CLB))) { /* Lock bit manipulation on AT91SAM7A3 waits for FC_FSR bit 1, EOL */ if (at91sam7_wait_status_busy(bank, MC_FSR_EOL, 10)&0x0C) diff --git a/src/flash/flash.c b/src/flash/flash.c index 60827594..3b8a883c 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -654,7 +654,7 @@ static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, c /* flash auto-erase is disabled by default*/ int auto_erase = 0; - if (strcmp(args[0], "erase")==0) + if (strcmp(args[0], "erase") == 0) { auto_erase = 1; args++; @@ -894,7 +894,7 @@ static int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, ch fileio_close(&fileio); return retvaltemp; } - if (retval==ERROR_OK) + if (retval == ERROR_OK) { command_print(cmd_ctx, "wrote %lld byte from file %s to flash bank %li at offset 0x%8.8" PRIx32 " in %s (%f kb/s)", diff --git a/src/flash/ocl.c b/src/flash/ocl.c index a83f5ea8..e6a342e7 100644 --- a/src/flash/ocl.c +++ b/src/flash/ocl.c @@ -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) @@ -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; diff --git a/src/flash/ocl/at91sam7x/dcc.c b/src/flash/ocl/at91sam7x/dcc.c index 3507bbe5..a6976595 100644 --- a/src/flash/ocl/at91sam7x/dcc.c +++ b/src/flash/ocl/at91sam7x/dcc.c @@ -27,7 +27,7 @@ uint32 dcc_rd(void) do { asm volatile ("mrc p14, 0, %0, C0, C0" : "=r" (dcc_reg) : ); - } while ((dcc_reg&1)==0); + } while ((dcc_reg&1) == 0); asm volatile ("mrc p14, 0, %0, C1, C0" : "=r" (dcc_reg) : ); return dcc_reg; diff --git a/src/flash/ocl/at91sam7x/samflash.c b/src/flash/ocl/at91sam7x/samflash.c index 893b579f..a534f6d8 100644 --- a/src/flash/ocl/at91sam7x/samflash.c +++ b/src/flash/ocl/at91sam7x/samflash.c @@ -86,7 +86,7 @@ int flash_page_program(uint32 *data, int page_num) else efc_ofs=0; /* wait until FLASH is ready, just for sure */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* calculate page address, only lower 8 bits are used to address the latch, but the upper part of address is needed for writing to proper EFC */ @@ -103,7 +103,7 @@ int flash_page_program(uint32 *data, int page_num) outr(MC_FCR+efc_ofs, ((page_num&0x3ff) << 8) | MC_KEY | MC_FCMD_WP); /* wait until it's done */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* check for errors */ if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE; @@ -134,12 +134,12 @@ int flash_erase_plane(int efc_ofs) if (lockbits&1) { /* wait until FLASH is ready, just for sure */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); outr(MC_FCR+efc_ofs, ((page_num&0x3ff) << 8) | 0x5a000004); /* wait until it's done */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* check for errors */ if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE; @@ -151,13 +151,13 @@ int flash_erase_plane(int efc_ofs) } /* wait until FLASH is ready, just for sure */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* erase all command to FCR */ outr(MC_FCR+efc_ofs, 0x5a000008); /* wait until it's done */ - while ((inr(MC_FSR+efc_ofs)&MC_FRDY)==0); + while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0); /* check for errors */ if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE; diff --git a/src/flash/str9x.c b/src/flash/str9x.c index 2b92d009..73c86da7 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -309,7 +309,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last) break; alive_sleep(1); } - if (timeout==1000) + if (timeout == 1000) { LOG_ERROR("erase timed out"); return ERROR_FAIL; @@ -582,7 +582,7 @@ static int str9x_write(struct flash_bank_s *bank, break; alive_sleep(1); } - if (timeout==1000) + if (timeout == 1000) { LOG_ERROR("write timed out"); return ERROR_FAIL; @@ -631,7 +631,7 @@ static int str9x_write(struct flash_bank_s *bank, break; alive_sleep(1); } - if (timeout==1000) + if (timeout == 1000) { LOG_ERROR("write timed out"); return ERROR_FAIL; diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index d1fcd8b9..d07a15a1 100644 --- a/src/helper/binarybuffer.h +++ b/src/helper/binarybuffer.h @@ -32,7 +32,7 @@ /* inlining this will help show what fn that is taking time during profiling. */ static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int num, uint32_t value) { - if ((num==32) && (first==0)) + if ((num == 32) && (first == 0)) { buffer[3]=(value >> 24)&0xff; buffer[2]=(value >> 16)&0xff; @@ -53,7 +53,7 @@ static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int } static inline uint32_t buf_get_u32(const uint8_t* buffer, unsigned int first, unsigned int num) { - if ((num==32) && (first==0)) + if ((num == 32) && (first == 0)) { return (((uint32_t)buffer[3]) << 24)|(((uint32_t)buffer[2]) << 16)|(((uint32_t)buffer[1]) << 8)|(((uint32_t)buffer[0]) << 0); } else diff --git a/src/helper/command.c b/src/helper/command.c index f474756a..e8391054 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -94,9 +94,9 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv) * to the fn and fish it out manually. */ c = interp->cmdPrivData; - if (c==NULL) + if (c == NULL) { - LOG_ERROR("BUG: interp->cmdPrivData==NULL"); + LOG_ERROR("BUG: interp->cmdPrivData == NULL"); return JIM_ERR; } target_call_timer_callbacks_now(); @@ -157,7 +157,7 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv) *return_retval = retval; } - return (retval==ERROR_OK)?JIM_OK:JIM_ERR; + return (retval == ERROR_OK)?JIM_OK:JIM_ERR; } /* nice short description of source file */ @@ -212,7 +212,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char } /* just a placeholder, no handler */ - if (c->handler==NULL) + if (c->handler == NULL) return c; /* If this is a two level command, e.g. "flash banks", then the @@ -478,7 +478,7 @@ int command_run_line(command_context_t *context, char *line) /* We do not print the connection closed error message */ Jim_PrintErrorMessage(interp); } - if (retval==ERROR_OK) + if (retval == ERROR_OK) { /* It wasn't a low level OpenOCD command that failed */ return ERROR_FAIL; @@ -745,7 +745,7 @@ command_context_t* command_init() #if !BUILD_ECOSBOARD Jim_EventLoopOnLoad(interp); #endif - if (Jim_Eval_Named(interp, startup_tcl, "embedded:startup.tcl",1)==JIM_ERR) + if (Jim_Eval_Named(interp, startup_tcl, "embedded:startup.tcl",1) == JIM_ERR) { LOG_ERROR("Failed to run startup.tcl (embedded into OpenOCD compile time)"); Jim_PrintErrorMessage(interp); @@ -812,7 +812,7 @@ int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **arg if (argc != 1) return ERROR_COMMAND_SYNTAX_ERROR; - fast_and_dangerous = strcmp("enable", args[0])==0; + fast_and_dangerous = strcmp("enable", args[0]) == 0; return ERROR_OK; } @@ -856,7 +856,7 @@ long jim_global_long(const char *variable) { Jim_Obj *objPtr=Jim_GetGlobalVariableStr(interp, variable, JIM_ERRMSG); long t; - if (Jim_GetLong(interp, objPtr, &t)==JIM_OK) + if (Jim_GetLong(interp, objPtr, &t) == JIM_OK) { return t; } diff --git a/src/helper/configuration.c b/src/helper/configuration.c index 2f9d8066..95b4c7e0 100644 --- a/src/helper/configuration.c +++ b/src/helper/configuration.c @@ -94,7 +94,7 @@ FILE *open_file_from_path (char *file, char *mode) } else { char *full_path=find_file(file); - if (full_path==NULL) + if (full_path == NULL) return NULL; FILE *fp = NULL; fp = fopen(full_path, mode); diff --git a/src/helper/ioutil.c b/src/helper/ioutil.c index 4c09b779..8f02e2eb 100644 --- a/src/helper/ioutil.c +++ b/src/helper/ioutil.c @@ -84,7 +84,7 @@ int loadFile(const char *fileName, void **data, size_t *len) FILE * pFile; pFile = fopen(fileName,"rb"); - if (pFile==NULL) + if (pFile == NULL) { LOG_ERROR("Can't open %s\n", fileName); return ERROR_FAIL; @@ -111,7 +111,7 @@ int loadFile(const char *fileName, void **data, size_t *len) return ERROR_FAIL; } *data = malloc(*len + 1); - if (*data==NULL) + if (*data == NULL) { LOG_ERROR("Can't open %s\n", fileName); fclose(pFile); @@ -233,7 +233,7 @@ int handle_append_command(struct command_context_s *cmd_ctx, char *cmd, break; } } - if ((i==argc) && (fwrite("\n", 1, 1, config_file)==1)) + if ((i == argc) && (fwrite("\n", 1, 1, config_file) == 1)) { retval=ERROR_OK; } @@ -274,7 +274,7 @@ int handle_cp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, chunk = maxChunk; } - if ((retval==ERROR_OK) && (fwrite(((char *)data)+pos, 1, chunk, f) != chunk)) + if ((retval == ERROR_OK) && (fwrite(((char *)data)+pos, 1, chunk, f) != chunk)) retval = ERROR_INVALID_ARGUMENTS; if (retval != ERROR_OK) @@ -363,7 +363,7 @@ void copydir(char *name, char *destdir) DIR *dirp; dirp = opendir(destdir); - if (dirp==NULL) + if (dirp == NULL) { mkdir(destdir, 0777); } else @@ -477,7 +477,7 @@ zylinjtag_Jim_Command_ls(Jim_Interp *interp, if (entry == NULL) break; - if ((strcmp(".", entry->d_name)==0)||(strcmp("..", entry->d_name)==0)) + if ((strcmp(".", entry->d_name) == 0)||(strcmp("..", entry->d_name) == 0)) continue; Jim_ListAppendElement(interp, objPtr, Jim_NewStringObj(interp, entry->d_name, strlen(entry->d_name))); diff --git a/src/helper/jim.c b/src/helper/jim.c index 9c862150..8e063608 100644 --- a/src/helper/jim.c +++ b/src/helper/jim.c @@ -198,7 +198,7 @@ static jim_wide JimStrtoll(const char *nptr, char **endptr, register int base) * digit. For instance, if the range for quads is * [-9223372036854775808..9223372036854775807] and the input base * is 10, cutoff will be set to 922337203685477580 and cutlim to - * either 7 (neg==0) or 8 (neg==1), meaning that if we have + * either 7 (neg == 0) or 8 (neg == 1), meaning that if we have * accumulated a value > 922337203685477580, or equal but the * next digit is > 7 (or 8), the number is too big, and we will * return a range error. @@ -503,7 +503,7 @@ int Jim_StringToDouble(const char *str, double *doublePtr) static jim_wide JimPowWide(jim_wide b, jim_wide e) { jim_wide i, res = 1; - if ((b==0 && e != 0) || (e<0)) return 0; + if ((b == 0 && e != 0) || (e<0)) return 0; for (i=0; i<e; i++) {res *= b;} return res; } @@ -568,7 +568,7 @@ void Jim_Panic(Jim_Interp *interp, const char *fmt, ...) void *Jim_Alloc(int size) { /* We allocate zero length arrayes, etc. to use a single orthogonal codepath */ - if (size==0) + if (size == 0) size=1; void *p = malloc(size); if (p == NULL) @@ -583,7 +583,7 @@ void Jim_Free(void *ptr) { void *Jim_Realloc(void *ptr, int size) { /* We allocate zero length arrayes, etc. to use a single orthogonal codepath */ - if (size==0) + if (size == 0) size=1; void *p = realloc(ptr, size); if (p == NULL) @@ -6959,7 +6959,7 @@ int Jim_EvalExpression(Jim_Interp *interp, Jim_Obj *exprObjPtr, case JIM_EXPROP_GTE: wC = wA >= wB; break; case JIM_EXPROP_LSHIFT: wC = wA << wB; break; case JIM_EXPROP_RSHIFT: wC = wA >> wB; break; - case JIM_EXPROP_NUMEQ: wC = wA==wB; break; + case JIM_EXPROP_NUMEQ: wC = wA == wB; break; case JIM_EXPROP_NUMNE: wC = wA != wB; break; case JIM_EXPROP_BITAND: wC = wA&wB; break; case JIM_EXPROP_BITXOR: wC = wA^wB; break; @@ -7062,7 +7062,7 @@ trydouble: case JIM_EXPROP_GT: dC = dA>dB; break; case JIM_EXPROP_LTE: dC = dA <= dB; break; case JIM_EXPROP_GTE: dC = dA >= dB; break; - case JIM_EXPROP_NUMEQ: dC = dA==dB; break; + case JIM_EXPROP_NUMEQ: dC = dA == dB; break; case JIM_EXPROP_NUMNE: dC = dA != dB; break; case JIM_EXPROP_LOGICAND_LEFT: if (dA == 0) { diff --git a/src/helper/jim.h b/src/helper/jim.h index b7fae59c..3d3346c2 100644 --- a/src/helper/jim.h +++ b/src/helper/jim.h @@ -578,7 +578,7 @@ typedef struct Jim_Reference { * An NVP Table is terminated with ".name=NULL". * * During the 'name2value' operation, if no matching string is found - * the pointer to the terminal element (with p->name==NULL) is returned. + * the pointer to the terminal element (with p->name == NULL) is returned. * * Example: * \code diff --git a/src/jtag/bitbang.c b/src/jtag/bitbang.c index dacd65ec..cb0d73d6 100644 --- a/src/jtag/bitbang.c +++ b/src/jtag/bitbang.c @@ -189,7 +189,7 @@ static void bitbang_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int for (bit_cnt = 0; bit_cnt < scan_size; bit_cnt++) { int val=0; - int tms=(bit_cnt==scan_size-1) ? 1 : 0; + int tms=(bit_cnt == scan_size-1) ? 1 : 0; int tdi; int bytec=bit_cnt/8; int bcval=1 << (bit_cnt % 8); diff --git a/src/jtag/bitq.c b/src/jtag/bitq.c index 65dbb656..e843733c 100644 --- a/src/jtag/bitq.c +++ b/src/jtag/bitq.c @@ -51,7 +51,7 @@ void bitq_in_proc(void) while (bitq_in_state.cmd) { /* only JTAG_SCAN command may return data */ - if (bitq_in_state.cmd->type==JTAG_SCAN) + if (bitq_in_state.cmd->type == JTAG_SCAN) { /* loop through the fields */ while (bitq_in_state.field_idx<bitq_in_state.cmd->cmd.scan->num_fields) @@ -59,7 +59,7 @@ void bitq_in_proc(void) field = &bitq_in_state.cmd->cmd.scan->fields[bitq_in_state.field_idx]; if (field->in_value) { - if (bitq_in_state.bit_pos==0) + if (bitq_in_state.bit_pos == 0) { /* initialize field scanning */ in_mask = 0x01; @@ -83,7 +83,7 @@ void bitq_in_proc(void) bitq_in_bufsize *= 2; } /* if necessary, allocate buffer and check for malloc error */ - if (bitq_in_buffer==NULL && ( bitq_in_buffer = malloc(bitq_in_bufsize) )==NULL) + if (bitq_in_buffer == NULL && ( bitq_in_buffer = malloc(bitq_in_bufsize) ) == NULL) { LOG_ERROR("malloc error"); exit(-1); @@ -102,11 +102,11 @@ void bitq_in_proc(void) #endif return; } - if (in_mask==0x01) + if (in_mask == 0x01) in_buff[in_idx] = 0; if (tdo) in_buff[in_idx] |= in_mask; - if (in_mask==0x80) + if (in_mask == 0x80) { in_mask = 0x01; in_idx++; @@ -226,7 +226,7 @@ void bitq_scan_field(scan_field_t* field, int pause) else tdo_req = 0; - if (field->out_value==NULL) + if (field->out_value == NULL) { /* just send zeros and request data from TDO */ for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--) @@ -242,7 +242,7 @@ void bitq_scan_field(scan_field_t* field, int pause) for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--) { bitq_io(0, ( (*out_ptr) & out_mask ) != 0, tdo_req); - if (out_mask==0x80) + if (out_mask == 0x80) { out_mask = 0x01; out_ptr++; @@ -257,9 +257,9 @@ void bitq_scan_field(scan_field_t* field, int pause) if (pause) { bitq_io(0, 0, 0); - if (tap_get_state()==TAP_IRSHIFT) + if (tap_get_state() == TAP_IRSHIFT) tap_set_state(TAP_IRPAUSE); - else if (tap_get_state()==TAP_DRSHIFT) + else if (tap_get_state() == TAP_DRSHIFT) tap_set_state(TAP_DRPAUSE); } } diff --git a/src/jtag/core.c b/src/jtag/core.c index 09f62c30..34ad11b0 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -508,9 +508,9 @@ int jtag_add_statemove(tap_state_t goal_state) tap_state_name(goal_state) ); - if (goal_state==cur_state ) + if (goal_state == cur_state ) ; /* nothing to do */ - else if ( goal_state==TAP_RESET ) + else if ( goal_state == TAP_RESET ) { jtag_add_tlr(); } @@ -576,7 +576,7 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst) */ if ((jtag_reset_config & RESET_HAS_SRST)&& (jtag_reset_config & RESET_HAS_TRST)&& - ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0)) + ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0)) { if (((req_tlr_or_trst&&!jtag_trst)|| (!req_tlr_or_trst && jtag_trst))&& @@ -746,7 +746,7 @@ void jtag_check_value_mask(scan_field_t *field, uint8_t *value, uint8_t *mask) { assert(field->in_value != NULL); - if (value==NULL) + if (value == NULL) { /* no checking to do */ return; @@ -1216,7 +1216,7 @@ int jtag_init_reset(struct command_context_s *cmd_ctx) if (jtag_reset_config & RESET_HAS_SRST) { jtag_add_reset(1, 1); - if ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0) + if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0) jtag_add_reset(0, 1); } jtag_add_reset(0, 0); @@ -1238,7 +1238,7 @@ int jtag_init(struct command_context_s *cmd_ctx) int retval; if ((retval=jtag_interface_init(cmd_ctx)) != ERROR_OK) return retval; - if (jtag_init_inner(cmd_ctx)==ERROR_OK) + if (jtag_init_inner(cmd_ctx) == ERROR_OK) { return ERROR_OK; } diff --git a/src/jtag/driver.c b/src/jtag/driver.c index 1e9af54b..c3d63067 100644 --- a/src/jtag/driver.c +++ b/src/jtag/driver.c @@ -476,7 +476,7 @@ void interface_jtag_add_callback4(jtag_callback_t callback, jtag_callback_data_t entry->data2=data2; entry->data3=data3; - if (jtag_callback_queue_head==NULL) + if (jtag_callback_queue_head == NULL) { jtag_callback_queue_head=entry; jtag_callback_queue_tail=entry; diff --git a/src/jtag/dummy.c b/src/jtag/dummy.c index b4aa9415..497e5a64 100644 --- a/src/jtag/dummy.c +++ b/src/jtag/dummy.c @@ -131,7 +131,7 @@ static void dummy_reset(int trst, int srst) static int dummy_khz(int khz, int *jtag_speed) { - if (khz==0) + if (khz == 0) { *jtag_speed=0; } @@ -144,7 +144,7 @@ static int dummy_khz(int khz, int *jtag_speed) static int dummy_speed_div(int speed, int *khz) { - if (speed==0) + if (speed == 0) { *khz = 0; } diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c index d4e0fbcb..07b4bec4 100644 --- a/src/jtag/ft2232.c +++ b/src/jtag/ft2232.c @@ -50,7 +50,7 @@ #include <assert.h> -#if (BUILD_FT2232_FTD2XX==1 && BUILD_FT2232_LIBFTDI==1) +#if (BUILD_FT2232_FTD2XX == 1 && BUILD_FT2232_LIBFTDI == 1) #error "BUILD_FT2232_FTD2XX && BUILD_FT2232_LIBFTDI are mutually exclusive" #elif (BUILD_FT2232_FTD2XX != 1 && BUILD_FT2232_LIBFTDI != 1) #error "BUILD_FT2232_FTD2XX || BUILD_FT2232_LIBFTDI must be chosen" @@ -274,7 +274,7 @@ static void clock_tms(uint8_t mpsse_cmd, int tms_bits, int tms_count, bool tdi_b */ ++tms_ndx; - if (tms_ndx==7 || i==tms_count-1) + if (tms_ndx == 7 || i == tms_count-1) { buffer_write(mpsse_cmd); buffer_write(tms_ndx - 1); @@ -498,7 +498,7 @@ static int ft2232_speed_div(int speed, int* khz) static int ft2232_khz(int khz, int* jtag_speed) { - if (khz==0) + if (khz == 0) { #ifdef BUILD_FTD2XX_HIGHSPEED *jtag_speed = 0; @@ -2049,7 +2049,7 @@ static int ft2232_init(void) const ft2232_layout_t* cur_layout = ft2232_layouts; int i; - if (tap_get_tms_path_len(TAP_IRPAUSE,TAP_IRPAUSE)==7) + if (tap_get_tms_path_len(TAP_IRPAUSE,TAP_IRPAUSE) == 7) { LOG_DEBUG("ft2232 interface using 7 step jtag state transitions"); } diff --git a/src/jtag/jlink.c b/src/jtag/jlink.c index 97a8e485..0b39acfe 100644 --- a/src/jtag/jlink.c +++ b/src/jtag/jlink.c @@ -770,7 +770,7 @@ static int jlink_tap_execute(void) /* JLink returns an extra NULL in packet when size of in message is a multiple of 64, creates problems with usb comms */ /* WARNING This will interfere with tap state counting */ - while ((TAP_SCAN_BYTES(tap_length)%64)==0) + while ((TAP_SCAN_BYTES(tap_length)%64) == 0) { jlink_tap_append_step((tap_get_state() == TAP_RESET)?1:0, 0); } @@ -932,7 +932,7 @@ static int jlink_usb_message(jlink_jtag_t *jlink_jtag, int out_length, int in_le if (1 != result2) { LOG_ERROR("jlink_usb_read_emu_result retried requested=1, result=%d, in_length=%i", result2,in_length); - /* Try again once, should only happen if (in_length%64==0) */ + /* Try again once, should only happen if (in_length%64 == 0) */ result2 = jlink_usb_read_emu_result(jlink_jtag); if (1 != result2) { diff --git a/src/jtag/presto.c b/src/jtag/presto.c index 8985cd76..1d03bdd1 100644 --- a/src/jtag/presto.c +++ b/src/jtag/presto.c @@ -534,7 +534,7 @@ static int presto_sendbyte(int data) if (presto->buff_out_pos >= BUFFER_SIZE) #elif BUILD_PRESTO_LIBFTDI == 1 /* libftdi does not do background read, be sure that USB IN buffer does not overflow (128 bytes only!) */ - if (presto->buff_out_pos >= BUFFER_SIZE || presto->buff_in_exp==128) + if (presto->buff_out_pos >= BUFFER_SIZE || presto->buff_in_exp == 128) #endif return presto_flush(); diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 24870ab2..88f335a6 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -1208,7 +1208,7 @@ static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, c for (i = 0; i < num_fields; i++) { tap = jtag_tap_by_string( args[i*2] ); - if (tap==NULL) + if (tap == NULL) { command_print( cmd_ctx, "Tap: %s unknown", args[i*2] ); return ERROR_FAIL; diff --git a/src/jtag/usbprog.c b/src/jtag/usbprog.c index c9ade3d6..ba91b14e 100644 --- a/src/jtag/usbprog.c +++ b/src/jtag/usbprog.c @@ -591,7 +591,7 @@ static void usbprog_jtag_write_tdi(struct usbprog_jtag *usbprog_jtag, char * buf { send_bits = size; loops = size/8; - /* if (loops==0) */ + /* if (loops == 0) */ loops++; size = 0; } diff --git a/src/jtag/zy1000/jtag_minidriver.h b/src/jtag/zy1000/jtag_minidriver.h index 6b51844b..9f24dd66 100644 --- a/src/jtag/zy1000/jtag_minidriver.h +++ b/src/jtag/zy1000/jtag_minidriver.h @@ -41,7 +41,7 @@ static __inline__ void waitIdle(void) do { ZY1000_PEEK(ZY1000_JTAG_BASE+0x10, empty); - } while ((empty & 0x100)==0); + } while ((empty & 0x100) == 0); } static __inline__ void waitQueue(void) @@ -64,7 +64,7 @@ static void setCurrentState(enum tap_state state) cyg_uint32 a; a=state; int repeat=0; - if (state==TAP_RESET) + if (state == TAP_RESET) { // The FPGA nor we know the current state of the CPU TAP // controller. This will move it to TAP for sure. @@ -92,7 +92,7 @@ static __inline__ void shiftValueInner(const enum tap_state state, const enum ta ZY1000_POKE(ZY1000_JTAG_BASE+0xc, value); #if 1 #if TEST_MANUAL() - if ((state==TAP_DRSHIFT) && (endState != TAP_DRSHIFT)) + if ((state == TAP_DRSHIFT) && (endState != TAP_DRSHIFT)) { int i; setCurrentState(state); |