- Fixes '[+]=' whitespace
[fw/openocd] / src / target / image.c
index 286a22133aea07454c57c9747f02f9b9d32f4637..45107b4854860e7abccc20d3359cf68ec22e5f39 100644 (file)
@@ -64,7 +64,7 @@ static int autodetect_image_type(image_t *image, char *url)
        }
        fileio_close(&fileio);
 
-       if (retval!=ERROR_OK)
+       if (retval != ERROR_OK)
                return retval;
 
        /* check header against known signatures */
@@ -362,7 +362,7 @@ static int image_elf_read_headers(image_t *image)
                return ERROR_FILEIO_OPERATION_FAILED;
        }
 
-       if (strncmp((char*)elf->header->e_ident,ELFMAG,SELFMAG)!=0)
+       if (strncmp((char*)elf->header->e_ident,ELFMAG,SELFMAG) != 0)
        {
                LOG_ERROR("invalid ELF file, bad magic number");
                return ERROR_IMAGE_FORMAT_ERROR;
@@ -374,8 +374,8 @@ static int image_elf_read_headers(image_t *image)
        }
 
        elf->endianness = elf->header->e_ident[EI_DATA];
-       if ((elf->endianness!=ELFDATA2LSB)
-                &&(elf->endianness!=ELFDATA2MSB))
+       if ((elf->endianness != ELFDATA2LSB)
+                &&(elf->endianness != ELFDATA2MSB))
        {
                LOG_ERROR("invalid ELF file, unknown endianess setting");
                return ERROR_IMAGE_FORMAT_ERROR;
@@ -764,7 +764,7 @@ int image_open(image_t *image, char *url, char *type_string)
                int section;
                for (section=0; section < image->num_sections; section++)
                {
-                       image->sections[section].base_address+=image->base_address;
+                       image->sections[section].base_address += image->base_address;
                }
                /* we're done relocating. The two statements below are mainly
                 * for documenation purposes: stop anyone from empirically
@@ -1022,7 +1022,7 @@ int image_calculate_checksum(uint8_t* buffer, uint32_t nbytes, uint32_t* checksu
                {
                        run=32768;
                }
-               nbytes-=run;
+               nbytes -= run;
                while (run--)
                {
                        /* as per gdb */