]> git.baikalelectronics.ru Git - uboot.git/commit
env: Use static_assert() to check if default_environment is too large
authorMarek Behún <marek.behun@nic.cz>
Fri, 22 Oct 2021 13:47:25 +0000 (15:47 +0200)
committerSimon Glass <sjg@chromium.org>
Sun, 31 Oct 2021 18:26:44 +0000 (12:26 -0600)
commit581cc2cb8a9235b09f96fbf7f1ed27f0635d68a3
treecca121da9f5283677ccfc3097b2711ddf298f463
parent0a99de5856cbdb8b875fed76663fb535fbf45df6
env: Use static_assert() to check if default_environment is too large

Check sizeof(default_environment) against ENV_SIZE in a static_assert()
instead of runtime.
Only check if !USE_HOSTCC (for in fw_env tool ENV_SIZE expands to a
variable, and cannot be checked statically) nad
!DEFAULT_ENV_INSTANCE_EMBEDDED, for in that case the default_environment
variable is not set.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
env/common.c
include/env_default.h