image: fit: Use stack allocation macro

The documentation above the DEFINE_ALIGN_BUFFER says it's for use
outside functions, but we're inside one.

Instead use ALLOC_CACHE_ALIGN_BUFFER, the stack based macro, which also
includes the cache alignment.

Fixes: b583348ca8 ("image: fit: Align hash output buffers")
Signed-off-by: Joel Stanley <joel@jms.id.au>
Tested-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
This commit is contained in:
Joel Stanley 2022-06-20 16:31:17 +09:30 committed by Tom Rini
parent 975918f6a1
commit c5e2442033
2 changed files with 2 additions and 4 deletions

View File

@ -1264,8 +1264,7 @@ int calculate_hash(const void *data, int data_len, const char *name,
static int fit_image_check_hash(const void *fit, int noffset, const void *data, static int fit_image_check_hash(const void *fit, int noffset, const void *data,
size_t size, char **err_msgp) size_t size, char **err_msgp)
{ {
DEFINE_ALIGN_BUFFER(uint8_t, value, FIT_MAX_HASH_LEN, ALLOC_CACHE_ALIGN_BUFFER(uint8_t, value, FIT_MAX_HASH_LEN);
ARCH_DMA_MINALIGN);
int value_len; int value_len;
const char *algo; const char *algo;
uint8_t *fit_value; uint8_t *fit_value;

View File

@ -41,8 +41,7 @@ static inline ulong map_to_sysmem(void *ptr)
return (ulong)(uintptr_t)ptr; return (ulong)(uintptr_t)ptr;
} }
#define ARCH_DMA_MINALIGN 1 #define ALLOC_CACHE_ALIGN_BUFFER(type, name, size) type name[size]
#define DEFINE_ALIGN_BUFFER(type, name, size, alugn) type name[size]
#define MKIMAGE_TMPFILE_SUFFIX ".tmp" #define MKIMAGE_TMPFILE_SUFFIX ".tmp"
#define MKIMAGE_MAX_TMPFILE_LEN 256 #define MKIMAGE_MAX_TMPFILE_LEN 256