summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-23 22:42:03 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-23 22:42:03 +0000
commit3813fda44adcea486b7308423a699f63d79273ee (patch)
treef515b454cfaea4806d0d307c1d19f1e3081482d1 /src/target
parentaea6815462d3302f7f8b6576f59320d5f5985642 (diff)
downloadopenocd+libswd-3813fda44adcea486b7308423a699f63d79273ee.tar.gz
openocd+libswd-3813fda44adcea486b7308423a699f63d79273ee.tar.bz2
openocd+libswd-3813fda44adcea486b7308423a699f63d79273ee.tar.xz
openocd+libswd-3813fda44adcea486b7308423a699f63d79273ee.zip
- 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/target')
-rw-r--r--src/target/arm11.c2
-rw-r--r--src/target/arm7_9_common.c34
-rw-r--r--src/target/arm7tdmi.c4
-rw-r--r--src/target/arm9tdmi.c4
-rw-r--r--src/target/arm_adi_v5.c4
-rw-r--r--src/target/arm_disassembler.c8
-rw-r--r--src/target/arm_jtag.c4
-rw-r--r--src/target/breakpoints.c6
-rw-r--r--src/target/etb.c2
-rw-r--r--src/target/image.c10
-rw-r--r--src/target/mips32_pracc.c4
-rw-r--r--src/target/mips_ejtag.c4
-rw-r--r--src/target/target.c28
-rw-r--r--src/target/xscale.c6
14 files changed, 60 insertions, 60 deletions
diff --git a/src/target/arm11.c b/src/target/arm11.c
index 7cb24dfb..29f11573 100644
--- a/src/target/arm11.c
+++ b/src/target/arm11.c
@@ -1540,7 +1540,7 @@ int arm11_target_create(struct target_s *target, Jim_Interp *interp)
arm11->target = target;
- if (target->tap==NULL)
+ if (target->tap == NULL)
return ERROR_FAIL;
if (target->tap->ir_length != 5)
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index 985b9f63..2b278747 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -131,7 +131,7 @@ static int arm7_9_set_software_breakpoints(arm7_9_common_t *arm7_9)
return ERROR_FAIL;
}
- if (arm7_9->sw_breakpoints_added==1)
+ if (arm7_9->sw_breakpoints_added == 1)
{
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_DATA_VALUE], arm7_9->arm_bkpt);
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_DATA_MASK], 0x0);
@@ -139,7 +139,7 @@ static int arm7_9_set_software_breakpoints(arm7_9_common_t *arm7_9)
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_MASK], ~EICE_W_CTRL_nOPC & 0xff);
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE], EICE_W_CTRL_ENABLE);
}
- else if (arm7_9->sw_breakpoints_added==2)
+ else if (arm7_9->sw_breakpoints_added == 2)
{
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_DATA_VALUE], arm7_9->arm_bkpt);
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_DATA_MASK], 0x0);
@@ -232,12 +232,12 @@ int arm7_9_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
uint32_t mask = (breakpoint->length == 4) ? 0x3u : 0x1u;
/* reassign a hw breakpoint */
- if (breakpoint->set==0)
+ if (breakpoint->set == 0)
{
arm7_9_assign_wp(arm7_9, breakpoint);
}
- if (breakpoint->set==1)
+ if (breakpoint->set == 1)
{
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_ADDR_VALUE], breakpoint->address);
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_ADDR_MASK], mask);
@@ -245,7 +245,7 @@ int arm7_9_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_MASK], ~EICE_W_CTRL_nOPC & 0xff);
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE], EICE_W_CTRL_ENABLE);
}
- else if (breakpoint->set==2)
+ else if (breakpoint->set == 2)
{
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_VALUE], breakpoint->address);
embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_MASK], mask);
@@ -377,7 +377,7 @@ int arm7_9_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
{
return retval;
}
- if (current_instr==arm7_9->arm_bkpt)
+ if (current_instr == arm7_9->arm_bkpt)
if ((retval = target_write_memory(target, breakpoint->address, 4, 1, breakpoint->orig_instr)) != ERROR_OK)
{
return retval;
@@ -391,7 +391,7 @@ int arm7_9_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
{
return retval;
}
- if (current_instr==arm7_9->thumb_bkpt)
+ if (current_instr == arm7_9->thumb_bkpt)
if ((retval = target_write_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr)) != ERROR_OK)
{
return retval;
@@ -423,7 +423,7 @@ int arm7_9_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
return ERROR_TARGET_NOT_HALTED;
}
- if (arm7_9->breakpoint_count==0)
+ if (arm7_9->breakpoint_count == 0)
{
/* make sure we don't have any dangling breakpoints. This is vital upon
* GDB connect/disconnect
@@ -478,7 +478,7 @@ int arm7_9_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
arm7_9->wp_available++;
arm7_9->breakpoint_count--;
- if (arm7_9->breakpoint_count==0)
+ if (arm7_9->breakpoint_count == 0)
{
/* make sure we don't have any dangling breakpoints */
if ((retval = arm7_9_clear_watchpoints(arm7_9)) != ERROR_OK)
@@ -906,7 +906,7 @@ int arm7_9_poll(target_t *target)
if (target->reset_halt)
{
enum reset_types jtag_reset_config = jtag_get_reset_config();
- if ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0)
+ if ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0)
{
check_pc = 1;
}
@@ -1022,7 +1022,7 @@ int arm7_9_assert_reset(target_t *target)
armv4_5_invalidate_core_regs(target);
- if ((target->reset_halt) && ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0))
+ if ((target->reset_halt) && ((jtag_reset_config & RESET_SRST_PULLS_TRST) == 0))
{
/* debug entry was already prepared in arm7_9_assert_reset() */
target->debug_reason = DBG_REASON_DBGRQ;
@@ -1246,7 +1246,7 @@ int arm7_9_soft_reset_halt(struct target_s *target)
*/
int arm7_9_halt(target_t *target)
{
- if (target->state==TARGET_RESET)
+ if (target->state == TARGET_RESET)
{
LOG_ERROR("BUG: arm7/9 does not support halt during reset. This is handled in arm7_9_assert_reset()");
return ERROR_OK;
@@ -2272,7 +2272,7 @@ int arm7_9_read_memory(struct target_s *target, uint32_t address, uint32_t size,
buffer += thisrun_accesses * 4;
num_accesses += thisrun_accesses;
- if ((j++%1024)==0)
+ if ((j++%1024) == 0)
{
keep_alive();
}
@@ -2310,7 +2310,7 @@ int arm7_9_read_memory(struct target_s *target, uint32_t address, uint32_t size,
buffer += thisrun_accesses * 2;
num_accesses += thisrun_accesses;
- if ((j++%1024)==0)
+ if ((j++%1024) == 0)
{
keep_alive();
}
@@ -2347,7 +2347,7 @@ int arm7_9_read_memory(struct target_s *target, uint32_t address, uint32_t size,
buffer += thisrun_accesses * 1;
num_accesses += thisrun_accesses;
- if ((j++%1024)==0)
+ if ((j++%1024) == 0)
{
keep_alive();
}
@@ -2579,7 +2579,7 @@ static int arm7_9_dcc_completion(struct target_s *target, uint32_t exit_point, i
if ((retval=target_wait_state(target, TARGET_DEBUG_RUNNING, 500)) != ERROR_OK)
return retval;
- int little=target->endianness==TARGET_LITTLE_ENDIAN;
+ int little=target->endianness == TARGET_LITTLE_ENDIAN;
int count=dcc_count;
uint8_t *buffer=dcc_buffer;
if (count>2)
@@ -2674,7 +2674,7 @@ int arm7_9_bulk_write_memory(target_t *target, uint32_t address, uint32_t count,
retval = armv4_5_run_algorithm_inner(target, 0, NULL, 1, reg_params,
arm7_9->dcc_working_area->address, arm7_9->dcc_working_area->address+6*4, 20*1000, &armv4_5_info, arm7_9_dcc_completion);
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
uint32_t endaddress=buf_get_u32(reg_params[0].value, 0, 32);
if (endaddress != (address+count*4))
diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c
index 21fa1083..541bede7 100644
--- a/src/target/arm7tdmi.c
+++ b/src/target/arm7tdmi.c
@@ -254,7 +254,7 @@ static int arm7endianness(jtag_callback_data_t arg, jtag_callback_data_t size, j
/* clock the target, and read the databus
* the *in pointer points to a buffer where elements of 'size' bytes
- * are stored in big (be==1) or little (be==0) endianness
+ * are stored in big (be == 1) or little (be == 0) endianness
*/
int arm7tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size, int be)
{
@@ -725,7 +725,7 @@ int arm7tdmi_examine(struct target_s *target)
/* get pointers to arch-specific information */
reg_cache_t **cache_p = register_get_last_cache_p(&target->reg_cache);
reg_cache_t *t=embeddedice_build_reg_cache(target, arm7_9);
- if (t==NULL)
+ if (t == NULL)
return ERROR_FAIL;
(*cache_p) = t;
diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c
index 75ae3e8b..577a4252 100644
--- a/src/target/arm9tdmi.c
+++ b/src/target/arm9tdmi.c
@@ -301,7 +301,7 @@ static int arm9endianness(jtag_callback_data_t arg, jtag_callback_data_t size, j
/* clock the target, and read the databus
* the *in pointer points to a buffer where elements of 'size' bytes
- * are stored in big (be==1) or little (be==0) endianness
+ * are stored in big (be == 1) or little (be == 0) endianness
*/
int arm9tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size, int be)
{
@@ -818,7 +818,7 @@ int arm9tdmi_examine(struct target_s *target)
reg_cache_t *t;
/* one extra register (vector catch) */
t=embeddedice_build_reg_cache(target, arm7_9);
- if (t==NULL)
+ if (t == NULL)
return ERROR_FAIL;
(*cache_p) = t;
arm7_9->eice_cache = (*cache_p);
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index a58c0a7c..aac0a173 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -165,7 +165,7 @@ int scan_inout_check_u32(swjdp_common_t *swjdp, uint8_t instr, uint8_t reg_addr,
{
adi_jtag_dp_scan_u32(swjdp, instr, reg_addr, RnW, outvalue, NULL, NULL);
- if ((RnW==DPAP_READ) && (invalue != NULL))
+ if ((RnW == DPAP_READ) && (invalue != NULL))
{
adi_jtag_dp_scan_u32(swjdp, DAP_IR_DPACC, DP_RDBUFF, DPAP_READ, 0, invalue, &swjdp->ack);
}
@@ -1108,7 +1108,7 @@ int dap_info_command(struct command_context_s *cmd_ctx, swjdp_common_t *swjdp, i
command_print(cmd_ctx, "\t\tComponent cid1 0x%" PRIx32 ", class is %s",c_cid1,class_description[(c_cid1 >> 4)&0xF]); /* Se ARM DDI 0314 C Table 2.2 */
command_print(cmd_ctx, "\t\tCID3 0x%" PRIx32 ", CID2 0x%" PRIx32 ", CID1 0x%" PRIx32 ", CID0, 0x%" PRIx32 "",c_cid3,c_cid2,c_cid1,c_cid0);
command_print(cmd_ctx, "\t\tPID3 0x%" PRIx32 ", PID2 0x%" PRIx32 ", PID1 0x%" PRIx32 ", PID0, 0x%" PRIx32 "",c_pid3,c_pid2,c_pid1,c_pid0);
- /* For CoreSight components, (c_cid1 >> 4)&0xF==9 , we also read 0xFC8 DevId and 0xFCC DevType */
+ /* For CoreSight components, (c_cid1 >> 4)&0xF == 9 , we also read 0xFC8 DevId and 0xFCC DevType */
}
else
{
diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c
index b314e02a..e460e468 100644
--- a/src/target/arm_disassembler.c
+++ b/src/target/arm_disassembler.c
@@ -1158,7 +1158,7 @@ int evaluate_data_proc(uint32_t opcode, uint32_t address, arm_instruction_t *ins
}
else if ((op == 0xd) || (op == 0xf)) /* <opcode1>{<cond>}{S} <Rd>, <shifter_operand> */
{
- if (opcode==0xe1a00000) /* print MOV r0,r0 as NOP */
+ if (opcode == 0xe1a00000) /* print MOV r0,r0 as NOP */
snprintf(instruction->text, 128, "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\tNOP",address, opcode);
else
snprintf(instruction->text, 128, "0x%8.8" PRIx32 "\t0x%8.8" PRIx32 "\t%s%s%s r%i, %s",
@@ -1327,7 +1327,7 @@ int evaluate_b_bl_blx_thumb(uint16_t opcode, uint32_t address, arm_instruction_t
char *mnemonic = NULL;
/* sign extend 11-bit offset */
- if (((opc==0) || (opc==2)) && (offset & 0x00000400))
+ if (((opc == 0) || (opc == 2)) && (offset & 0x00000400))
offset = 0xfffff800 | offset;
target_address = address + 4 + (offset << 1);
@@ -1435,7 +1435,7 @@ int evaluate_shift_imm_thumb(uint16_t opcode, uint32_t address, arm_instruction_
break;
}
- if ((imm==0) && (opc != 0))
+ if ((imm == 0) && (opc != 0))
imm = 32;
instruction->info.data_proc.Rd = Rd;
@@ -1748,7 +1748,7 @@ int evaluate_load_store_imm_thumb(uint16_t opcode, uint32_t address, arm_instruc
mnemonic = "STR";
}
- if ((opcode&0xF000)==0x8000)
+ if ((opcode&0xF000) == 0x8000)
{
suffix = 'H';
shift = 1;
diff --git a/src/target/arm_jtag.c b/src/target/arm_jtag.c
index 2db49e52..9df4eeae 100644
--- a/src/target/arm_jtag.c
+++ b/src/target/arm_jtag.c
@@ -35,7 +35,7 @@ int arm_jtag_set_instr(arm_jtag_t *jtag_info, uint32_t new_instr, void *no_veri
{
jtag_tap_t *tap;
tap = jtag_info->tap;
- if (tap==NULL)
+ if (tap == NULL)
return ERROR_FAIL;
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr)
@@ -51,7 +51,7 @@ int arm_jtag_set_instr(arm_jtag_t *jtag_info, uint32_t new_instr, void *no_veri
- if (no_verify_capture==NULL)
+ if (no_verify_capture == NULL)
{
jtag_add_ir_scan(1, &field, jtag_get_end_state());
} else
diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c
index cffe1cb8..60f4805a 100644
--- a/src/target/breakpoints.c
+++ b/src/target/breakpoints.c
@@ -99,13 +99,13 @@ static void breakpoint_free(target_t *target, breakpoint_t *breakpoint_remove)
while (breakpoint)
{
- if (breakpoint==breakpoint_remove)
+ if (breakpoint == breakpoint_remove)
break;
breakpoint_p = &breakpoint->next;
breakpoint = breakpoint->next;
}
- if (breakpoint==NULL)
+ if (breakpoint == NULL)
return;
target_remove_breakpoint(target, breakpoint);
@@ -227,7 +227,7 @@ static void watchpoint_free(target_t *target, watchpoint_t *watchpoint_remove)
watchpoint = watchpoint->next;
}
- if (watchpoint==NULL)
+ if (watchpoint == NULL)
return;
target_remove_watchpoint(target, watchpoint);
(*watchpoint_p) = watchpoint->next;
diff --git a/src/target/etb.c b/src/target/etb.c
index fdaa2eee..41f2f5c5 100644
--- a/src/target/etb.c
+++ b/src/target/etb.c
@@ -49,7 +49,7 @@ static int etb_set_instr(etb_t *etb, uint32_t new_instr)
jtag_tap_t *tap;
tap = etb->tap;
- if (tap==NULL)
+ if (tap == NULL)
return ERROR_FAIL;
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr)
diff --git a/src/target/image.c b/src/target/image.c
index 2ce03b82..d8c0cfc4 100644
--- a/src/target/image.c
+++ b/src/target/image.c
@@ -34,11 +34,11 @@
/* convert ELF header field to host endianness */
#define field16(elf,field)\
- ((elf->endianness==ELFDATA2LSB)? \
+ ((elf->endianness == ELFDATA2LSB)? \
le_to_h_u16((uint8_t*)&field):be_to_h_u16((uint8_t*)&field))
#define field32(elf,field)\
- ((elf->endianness==ELFDATA2LSB)? \
+ ((elf->endianness == ELFDATA2LSB)? \
le_to_h_u32((uint8_t*)&field):be_to_h_u32((uint8_t*)&field))
static int autodetect_image_type(image_t *image, char *url)
@@ -55,7 +55,7 @@ static int autodetect_image_type(image_t *image, char *url)
}
retval = fileio_read(&fileio, 9, buffer, &read_bytes);
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
if (read_bytes != 9)
{
@@ -68,7 +68,7 @@ static int autodetect_image_type(image_t *image, char *url)
return retval;
/* check header against known signatures */
- if (strncmp((char*)buffer,ELFMAG,SELFMAG)==0)
+ if (strncmp((char*)buffer,ELFMAG,SELFMAG) == 0)
{
LOG_DEBUG("ELF image detected.");
image->type = IMAGE_ELF;
@@ -382,7 +382,7 @@ static int image_elf_read_headers(image_t *image)
}
elf->segment_count = field16(elf,elf->header->e_phnum);
- if (elf->segment_count==0)
+ if (elf->segment_count == 0)
{
LOG_ERROR("invalid ELF file, no program headers");
return ERROR_IMAGE_FORMAT_ERROR;
diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c
index 06e852ba..21a788f6 100644
--- a/src/target/mips32_pracc.c
+++ b/src/target/mips32_pracc.c
@@ -278,7 +278,7 @@ int mips32_pracc_read_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int
case 2:
return mips32_pracc_read_mem16(ejtag_info, addr, count, (uint16_t*)buf);
case 4:
- if (count==1)
+ if (count == 1)
return mips32_pracc_read_u32(ejtag_info, addr, (uint32_t*)buf);
else
return mips32_pracc_read_mem32(ejtag_info, addr, count, (uint32_t*)buf);
@@ -562,7 +562,7 @@ int mips32_pracc_write_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, in
case 2:
return mips32_pracc_write_mem16(ejtag_info, addr, count,(uint16_t*)buf);
case 4:
- if (count==1)
+ if (count == 1)
return mips32_pracc_write_u32(ejtag_info, addr, (uint32_t*)buf);
else
return mips32_pracc_write_mem32(ejtag_info, addr, count, (uint32_t*)buf);
diff --git a/src/target/mips_ejtag.c b/src/target/mips_ejtag.c
index 7a64bd4d..c03d1adb 100644
--- a/src/target/mips_ejtag.c
+++ b/src/target/mips_ejtag.c
@@ -32,7 +32,7 @@ int mips_ejtag_set_instr(mips_ejtag_t *ejtag_info, int new_instr, void *delete_m
jtag_tap_t *tap;
tap = ejtag_info->tap;
- if (tap==NULL)
+ if (tap == NULL)
return ERROR_FAIL;
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != (uint32_t)new_instr)
@@ -115,7 +115,7 @@ int mips_ejtag_drscan_32(mips_ejtag_t *ejtag_info, uint32_t *data)
jtag_tap_t *tap;
tap = ejtag_info->tap;
- if (tap==NULL)
+ if (tap == NULL)
return ERROR_FAIL;
scan_field_t field;
uint8_t t[4], r[4];
diff --git a/src/target/target.c b/src/target/target.c
index 89d2c88a..81d753e0 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1079,7 +1079,7 @@ int target_register_commands(struct command_context_s *cmd_ctx)
int target_arch_state(struct target_s *target)
{
int retval;
- if (target==NULL)
+ if (target == NULL)
{
LOG_USER("No target has been configured");
return ERROR_OK;
@@ -1851,7 +1851,7 @@ static int handle_poll_command(struct command_context_s *cmd_ctx, char *cmd, cha
return retval;
}
- else if (argc==1)
+ else if (argc == 1)
{
if (strcmp(args[0], "on") == 0)
{
@@ -2314,7 +2314,7 @@ static int handle_load_image_command(struct command_context_s *cmd_ctx, char *cm
return retvaltemp;
}
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
command_print(cmd_ctx, "downloaded %u byte in %s",
(unsigned int)image_size,
@@ -2390,7 +2390,7 @@ static int handle_dump_image_command(struct command_context_s *cmd_ctx, char *cm
if ((retvaltemp = duration_stop_measure(&duration, &duration_text)) != ERROR_OK)
return retvaltemp;
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
command_print(cmd_ctx, "dumped %lld byte in %s",
fileio.size, duration_text);
@@ -2517,7 +2517,7 @@ static int handle_verify_image_command_internal(struct command_context_s *cmd_ct
retval=ERROR_FAIL;
goto done;
}
- if ((t%16384)==0)
+ if ((t%16384) == 0)
{
keep_alive();
}
@@ -2544,7 +2544,7 @@ done:
return retvaltemp;
}
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
command_print(cmd_ctx, "verified %u bytes in %s",
(unsigned int)image_size,
@@ -2808,7 +2808,7 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, char *filename)
{
uint32_t i;
FILE *f=fopen(filename, "w");
- if (f==NULL)
+ if (f == NULL)
return;
writeString(f, "gmon");
writeLong(f, 0x00000001); /* Version */
@@ -2843,7 +2843,7 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, char *filename)
length=maxBuckets;
}
int *buckets=malloc(sizeof(int)*length);
- if (buckets==NULL)
+ if (buckets == NULL)
{
fclose(f);
return;
@@ -2918,7 +2918,7 @@ static int handle_profile_command(struct command_context_s *cmd_ctx, char *cmd,
static const int maxSample=10000;
uint32_t *samples=malloc(sizeof(uint32_t)*maxSample);
- if (samples==NULL)
+ if (samples == NULL)
return ERROR_OK;
int numSamples=0;
@@ -4432,7 +4432,7 @@ static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, cha
retval = ERROR_OK;
fastload_num=image.num_sections;
fastload=(struct FastLoad *)malloc(sizeof(struct FastLoad)*image.num_sections);
- if (fastload==NULL)
+ if (fastload == NULL)
{
image_close(&image);
return ERROR_FAIL;
@@ -4477,7 +4477,7 @@ static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, cha
fastload[i].address=image.sections[i].base_address+offset;
fastload[i].data=malloc(length);
- if (fastload[i].data==NULL)
+ if (fastload[i].data == NULL)
{
free(buffer);
break;
@@ -4495,7 +4495,7 @@ static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, cha
}
duration_stop_measure(&duration, &duration_text);
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
command_print(cmd_ctx, "Loaded %u bytes in %s", (unsigned int)image_size, duration_text);
command_print(cmd_ctx, "NB!!! image has not been loaded to target, issue a subsequent 'fast_load' to do so.");
@@ -4516,7 +4516,7 @@ static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd
{
if (argc>0)
return ERROR_COMMAND_SYNTAX_ERROR;
- if (fastload==NULL)
+ if (fastload == NULL)
{
LOG_ERROR("No image in memory");
return ERROR_FAIL;
@@ -4531,7 +4531,7 @@ static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd
command_print(cmd_ctx, "Write to 0x%08x, length 0x%08x",
(unsigned int)(fastload[i].address),
(unsigned int)(fastload[i].length));
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
retval = target_write_buffer(target, fastload[i].address, fastload[i].length, fastload[i].data);
}
diff --git a/src/target/xscale.c b/src/target/xscale.c
index 71d365dd..506cd76a 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -197,7 +197,7 @@ int xscale_get_arch_pointers(target_t *target, armv4_5_common_t **armv4_5_p, xsc
int xscale_jtag_set_instr(jtag_tap_t *tap, uint32_t new_instr)
{
- if (tap==NULL)
+ if (tap == NULL)
return ERROR_FAIL;
if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr)
@@ -301,7 +301,7 @@ static void xscale_getbuf(jtag_callback_data_t arg)
int xscale_receive(target_t *target, uint32_t *buffer, int num_words)
{
- if (num_words==0)
+ if (num_words == 0)
return ERROR_INVALID_ARGUMENTS;
int retval=ERROR_OK;
@@ -392,7 +392,7 @@ int xscale_receive(target_t *target, uint32_t *buffer, int num_words)
words_scheduled--;
}
}
- if (words_scheduled==0)
+ if (words_scheduled == 0)
{
if (attempts++==1000)
{