diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-03-04 00:55:03 +0100 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-03-04 19:53:20 +0100 |
commit | 2dd161f556eb0bfb4f092d35397fd04c98d1a3fb (patch) | |
tree | d6f2383983dcd849c4a78459ef7aa9d68c616915 /util/cbfstool/cbfs_image.c | |
parent | 3aca2cdced54ff525022366bc6dee949b0152d83 (diff) |
cbfstool: Clean up code
cbfstool has diverged between coreboot upstream and the chromium tree.
Bring in some of the chromium changes, in particular the useful remainders
of cbf37fe (https://chromium-review.googlesource.com/176710)
- fix coding style
- mark unused variables explicitly unused
- remove some dead code
Change-Id: I354aaede8ce425ebe99d4c60c232feea62bf8a11
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/8577
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'util/cbfstool/cbfs_image.c')
-rw-r--r-- | util/cbfstool/cbfs_image.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c index 6775b069dd..6b0ed59efc 100644 --- a/util/cbfstool/cbfs_image.c +++ b/util/cbfstool/cbfs_image.c @@ -69,16 +69,6 @@ static uint32_t align_up(uint32_t value, uint32_t align) return value; } -static uint32_t lookup_type_by_name(const struct typedesc_t *desc, const char *name, - uint32_t default_value) -{ - int i; - for (i = 0; desc[i].name; i++) - if (strcmp(desc[i].name, name) == 0) - return desc[i].type; - return default_value; -} - static const char *lookup_name_by_type(const struct typedesc_t *desc, uint32_t type, const char *default_value) { @@ -89,21 +79,11 @@ static const char *lookup_name_by_type(const struct typedesc_t *desc, uint32_t t return default_value; } -uint32_t get_cbfs_entry_type(const char *name, uint32_t default_value) -{ - return lookup_type_by_name(types_cbfs_entry, name, default_value); -} - -const char *get_cbfs_entry_type_name(uint32_t type) +static const char *get_cbfs_entry_type_name(uint32_t type) { return lookup_name_by_type(types_cbfs_entry, type, "(unknown)"); } -uint32_t get_cbfs_compression(const char *name, uint32_t unknown) -{ - return lookup_type_by_name(types_cbfs_compression, name, unknown); -} - /* CBFS image */ static int cbfs_calculate_file_header_size(const char *name) @@ -186,7 +166,7 @@ void cbfs_get_header(struct cbfs_header *header, const void *src) } int cbfs_image_create(struct cbfs_image *image, - uint32_t myarch, + uint32_t architecture, size_t size, uint32_t align, struct buffer *bootblock, @@ -253,7 +233,7 @@ int cbfs_image_create(struct cbfs_image *image, image->header->bootblocksize = bootblock->size; image->header->align = align; image->header->offset = entries_offset; - image->header->architecture = myarch; + image->header->architecture = architecture; header_loc = (image->buffer.data + header_offset); cbfs_put_header(header_loc, image->header); |