* This function takes offset value which represents the offset from one end of the region and * converts it to offset from the other end of the region. offset is expected to be positive. */
| 586 | * converts it to offset from the other end of the region. offset is expected to be positive. |
| 587 | */ |
| 588 | static int convert_region_offset(unsigned int offset, uint32_t *region_offset) |
| 589 | { |
| 590 | size_t size; |
| 591 | |
| 592 | if (param.size) { |
| 593 | size = param.size; |
| 594 | } else { |
| 595 | assert(param.image_region); |
| 596 | size = param.image_region->size; |
| 597 | } |
| 598 | |
| 599 | if (size < offset) { |
| 600 | ERROR("Cannot convert region offset (size=0x%zx, offset=0x%x)\n", size, offset); |
| 601 | return 1; |
| 602 | } |
| 603 | |
| 604 | *region_offset = size - offset; |
| 605 | return 0; |
| 606 | } |
| 607 | |
| 608 | static int do_cbfs_locate(uint32_t *cbfs_addr, size_t data_size) |
| 609 | { |
no outgoing calls
no test coverage detected