diff --git a/rimage/elf.c b/rimage/elf.c index 067e6b578..45e47659f 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -127,20 +127,20 @@ static int elf_read_sections(struct image *image, struct module *module) if (!image->verbose) continue; - fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", module->elf_file, - i, section[i].type); - fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", module->elf_file, - i, section[i].flags); - fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", module->elf_file, - i, section[i].vaddr); - fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", module->elf_file, - i, section[i].off); - fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", module->elf_file, - i, section[i].size); - fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", module->elf_file, - i, section[i].link); - fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", module->elf_file, - i, section[i].info); + fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", + module->elf_file, i, section[i].type); + fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", + module->elf_file, i, section[i].flags); + fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", + module->elf_file, i, section[i].vaddr); + fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", + module->elf_file, i, section[i].off); + fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", + module->elf_file, i, section[i].size); + fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", + module->elf_file, i, section[i].link); + fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", + module->elf_file, i, section[i].info); } return 0; @@ -267,7 +267,8 @@ static void elf_module_size(struct image *image, struct module *module, if (module->text_start > section->vaddr) module->text_start = section->vaddr; if (module->text_end < section->vaddr + section->size) - module->text_end = section->vaddr + section->size; + module->text_end = section->vaddr + + section->size; fprintf(stdout, "\tTEXT\t"); } else { @@ -275,7 +276,8 @@ static void elf_module_size(struct image *image, struct module *module, if (module->data_start > section->vaddr) module->data_start = section->vaddr; if (module->data_end < section->vaddr + section->size) - module->data_end = section->vaddr + section->size; + module->data_end = section->vaddr + + section->size; fprintf(stdout, "\tDATA\t"); } @@ -501,7 +503,8 @@ int elf_find_section(struct image *image, struct module *module, count = fread(buffer, 1, section->size, module->fd); if (count != section->size) { - fprintf(stderr, "error: can't read string section %d\n", -errno); + fprintf(stderr, "error: can't read string section %d\n", + -errno); ret = -errno; goto out; } diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 109d7ddd9..d546144fb 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -194,7 +194,8 @@ static int simple_write_module(struct image *image, struct module *module) err = write_block(image, module, section); if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", i); + fprintf(stderr, "error: failed to write section #%d\n", + i); return err; } /* write_block will return padding size */ @@ -328,7 +329,8 @@ static int simple_write_firmware(struct image *image) module = &image->module[i]; module->fw_size += sizeof(struct snd_sof_blk_hdr) * (module->num_sections - module->num_bss); - module->fw_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; + module->fw_size += sizeof(struct snd_sof_mod_hdr) * + hdr.num_modules; hdr.file_size += module->fw_size; } @@ -411,7 +413,8 @@ int write_logs_dictionary(struct image *image) } if (module->logs_index > 0) { - Elf32_Shdr *section = &module->section[module->logs_index]; + Elf32_Shdr *section = + &module->section[module->logs_index]; header.base_address = section->vaddr; header.data_length = section->size; @@ -436,7 +439,8 @@ int write_logs_dictionary(struct image *image) count = fwrite(buffer, 1, section->size, image->ldc_out_fd); if (count != section->size) { - fprintf(stderr, "error: can't write section %d\n", + fprintf(stderr, + "error: can't write section %d\n", -errno); ret = -errno; goto out; diff --git a/rimage/hash.c b/rimage/hash.c index 7888c7247..18e2d41e4 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -90,7 +90,8 @@ void module_sha256_complete(struct image *image, uint8_t *hash) #endif } -void ri_hash(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) +void ri_hash(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash) { module_sha256_create(image); module_sha256_update(image, image->fw_image + offset, size); diff --git a/rimage/manifest.c b/rimage/manifest.c index 78ffd1899..217058080 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -430,7 +430,8 @@ static int man_module_create(struct image *image, struct module *module, /* bss is last */ man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; - man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = module->bss_start; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = + module->bss_start; pages = (module->bss_end - module->bss_start) / MAN_PAGE_SIZE; if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) pages += 1; @@ -463,7 +464,8 @@ static int man_module_create(struct image *image, struct module *module, man_module, i); if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", i); + fprintf(stderr, "error: failed to write section #%d\n", + i); return err; } } @@ -811,8 +813,8 @@ static int man_write_fw_v1_5_sue(struct image *image) m->desc.header.preload_page_count = preload_size / MAN_PAGE_SIZE; fprintf(stdout, "Firmware file size 0x%x page count %d\n", - FILE_TEXT_OFFSET_V1_5_SUE - MAN_DESC_OFFSET_V1_5_SUE + image->image_end, - m->desc.header.preload_page_count); + FILE_TEXT_OFFSET_V1_5_SUE - MAN_DESC_OFFSET_V1_5_SUE + + image->image_end, m->desc.header.preload_page_count); /* calculate hash for each module */ man_hash_modules(image, &m->desc); diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index d72cc9f6f..23ac4b517 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -168,7 +168,8 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, EVP_PKEY *privkey; FILE *fp; const BIGNUM *n, *e, *d; - unsigned char digest[SHA256_DIGEST_LENGTH], mod[MAN_RSA_KEY_MODULUS_LEN]; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; char path[256]; int ret = -EINVAL, i;