diff options
author | Simon Glass | 2022-10-18 06:46:08 -0600 |
---|---|---|
committer | Anatolij Gustschin | 2022-10-30 20:07:16 +0100 |
commit | e65500338427b64e83a59432242a1ef295dd95f0 (patch) | |
tree | 596cfa2c659a73eb89dfa02983a8b08f6d73d9f6 /cmd | |
parent | 4adc28ebc6b2fb9acc6abbb15186de528d502ef7 (diff) |
video: Rename CONFIG_SYS_VIDEO_LOGO_MAX_SIZE
This option should not have the SYS_ in it. Drop it so it fits in with the
other video options.
Also simplify the alignment code in gunzip_bmp(), since malloc() always
returns a 32-bit-aligned pointer.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/bmp.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/cmd/bmp.c b/cmd/bmp.c index d72a826ae74..5a3c8ddf8c8 100644 --- a/cmd/bmp.c +++ b/cmd/bmp.c @@ -48,27 +48,24 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp, /* * Decompress bmp image */ - len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE; + len = CONFIG_VIDEO_LOGO_MAX_SIZE; /* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */ - dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE + 3); - if (dst == NULL) { + dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE + 3); + if (!dst) { puts("Error: malloc in gunzip failed!\n"); return NULL; } - bmp = dst; - /* align to 32-bit-aligned-address + 2 */ - bmp = (struct bmp_image *)((((uintptr_t)dst + 1) & ~3) + 2); + bmp = dst + 2; - if (gunzip(bmp, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0), - &len) != 0) { + if (gunzip(bmp, CONFIG_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0), + &len)) { free(dst); return NULL; } - if (len == CONFIG_SYS_VIDEO_LOGO_MAX_SIZE) - puts("Image could be truncated" - " (increase CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)!\n"); + if (len == CONFIG_VIDEO_LOGO_MAX_SIZE) + puts("Image could be truncated (increase CONFIG_VIDEO_LOGO_MAX_SIZE)!\n"); /* * Check for bmp mark 'BM' |