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;
return retval;
}
- else if (argc==1)
+ else if (argc == 1)
{
if (strcmp(args[0], "on") == 0)
{
return retvaltemp;
}
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
command_print(cmd_ctx, "downloaded %u byte in %s",
(unsigned int)image_size,
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);
retval=ERROR_FAIL;
goto done;
}
- if ((t%16384)==0)
+ if ((t%16384) == 0)
{
keep_alive();
}
return retvaltemp;
}
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
command_print(cmd_ctx, "verified %u bytes in %s",
(unsigned int)image_size,
{
uint32_t i;
FILE *f=fopen(filename, "w");
- if (f==NULL)
+ if (f == NULL)
return;
writeString(f, "gmon");
writeLong(f, 0x00000001); /* Version */
length=maxBuckets;
}
int *buckets=malloc(sizeof(int)*length);
- if (buckets==NULL)
+ if (buckets == NULL)
{
fclose(f);
return;
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;
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;
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;
}
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.");
{
if (argc>0)
return ERROR_COMMAND_SYNTAX_ERROR;
- if (fastload==NULL)
+ if (fastload == NULL)
{
LOG_ERROR("No image in memory");
return ERROR_FAIL;
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);
}