mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: cbfstool: Don't use le32toh(), it's non-standard
It's a BSD function, also, we missed to include `endian.h`.
Just including `endian.h` doesn't fix the problem for everyone.
Instead of digging deeper, just use our own endian-conversion from
`commonlib`.
BUG=none
BRANCH=none
TEST=none
Change-Id: Ideec790c2ef2f5a97908a589908d8666e61bab65
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 607796a4ff
Original-Change-Id: Ia781b2258cafb0bcbe8408752a133cd28a888786
Original-Reported-by: Werner Zeh <werner.zeh@siemens.com>
Original-Signed-off-by: Nico Huber <nico.huber@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/18157
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Original-Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://chromium-review.googlesource.com/430181
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
This commit is contained in:
parent
8b2af4d7fa
commit
f46162070a
1 changed files with 3 additions and 2 deletions
|
@ -30,6 +30,7 @@
|
|||
#include "fit.h"
|
||||
#include "partitioned_file.h"
|
||||
#include <commonlib/fsp.h>
|
||||
#include <commonlib/endian.h>
|
||||
|
||||
#define SECTION_WITH_FIT_TABLE "BOOTBLOCK"
|
||||
|
||||
|
@ -445,8 +446,8 @@ static int cbfstool_convert_raw(struct buffer *buffer,
|
|||
|
||||
decompressed_size = buffer->size;
|
||||
if (param.precompression) {
|
||||
param.compression = le32toh(((uint32_t *)buffer->data)[0]);
|
||||
decompressed_size = le32toh(((uint32_t *)buffer->data)[1]);
|
||||
param.compression = read_le32(buffer->data);
|
||||
decompressed_size = read_le32(buffer->data + sizeof(uint32_t));
|
||||
compressed_size = buffer->size - 8;
|
||||
compressed = malloc(compressed_size);
|
||||
if (!compressed)
|
||||
|
|
Loading…
Add table
Reference in a new issue