From 128741682250e196ccc9ff0bf9e7a5db5dfcdbd3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 12 Jan 2014 14:12:15 +0100 Subject: CBFS: use cbfs_get_file_content whenever possible rather than cbfs_get_file Number one reason to use cbfs_get_file was to get file length. With previous patch no more need for this. Change-Id: I330dda914d800c991757c5967b11963276ba9e00 Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/4674 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/southbridge/intel/lynxpoint/spi_loading.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/southbridge') diff --git a/src/southbridge/intel/lynxpoint/spi_loading.c b/src/southbridge/intel/lynxpoint/spi_loading.c index 1ae7a263eb..57e3af8cbd 100644 --- a/src/southbridge/intel/lynxpoint/spi_loading.c +++ b/src/southbridge/intel/lynxpoint/spi_loading.c @@ -28,7 +28,7 @@ #if CONFIG_VBOOT_VERIFY_FIRMWARE #include #else -static inline void *vboot_get_payload(int *len) { return NULL; } +static inline void *vboot_get_payload(size_t *len) { return NULL; } #endif #define CACHELINE_SIZE 64 @@ -73,26 +73,18 @@ static inline void *spi_mirror(void *file_start, int file_len) void *cbfs_load_payload(struct cbfs_media *media, const char *name) { - int file_len; + size_t file_len; void *file_start; - struct cbfs_file *file; file_start = vboot_get_payload(&file_len); if (file_start != NULL) return spi_mirror(file_start, file_len); - file = cbfs_get_file(media, name); + file_start = cbfs_get_file_content(media, name, CBFS_TYPE_PAYLOAD, &file_len); - if (file == NULL) + if (file_start == NULL) return NULL; - if (ntohl(file->type) != CBFS_TYPE_PAYLOAD) - return NULL; - - file_len = ntohl(file->len); - - file_start = CBFS_SUBHEADER(file); - return spi_mirror(file_start, file_len); } -- cgit v1.2.3