From patchwork Wed Feb 19 09:47:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 236555 List-Id: U-Boot discussion From: rasmus.villemoes at prevas.dk (Rasmus Villemoes) Date: Wed, 19 Feb 2020 09:47:42 +0000 Subject: [PATCH 4/5] env/ext4.c: remove CONFIG_CMD_SAVEENV ifdef In-Reply-To: <20200219094726.26798-1-rasmus.villemoes@prevas.dk> References: <20200219094726.26798-1-rasmus.villemoes@prevas.dk> Message-ID: <20200219094726.26798-5-rasmus.villemoes@prevas.dk> Removing this ifdef/endif pair yields a "defined but unused warning" for CONFIG_CMD_SAVEENV=n, but that vanishes if we use the ENV_SAVE_PTR macro instead. This gives slightly better compile testing, and moreover, it's possible to have CONFIG_CMD_SAVEENV=n CONFIG_SPL_SAVEENV=y SPL_ENV_IS_IN_EXT4=y in which case env_ext4_save would erroneously not be compiled in. Signed-off-by: Rasmus Villemoes --- env/ext4.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/env/ext4.c b/env/ext4.c index 1f6b1b5bd8..911e19c6d3 100644 --- a/env/ext4.c +++ b/env/ext4.c @@ -41,7 +41,6 @@ __weak const char *env_ext4_get_dev_part(void) return (const char *)CONFIG_ENV_EXT4_DEVICE_AND_PART; } -#ifdef CONFIG_CMD_SAVEENV static int env_ext4_save(void) { env_t env_new; @@ -83,7 +82,6 @@ static int env_ext4_save(void) puts("done\n"); return 0; } -#endif /* CONFIG_CMD_SAVEENV */ static int env_ext4_load(void) { @@ -137,5 +135,5 @@ U_BOOT_ENV_LOCATION(ext4) = { .location = ENVL_EXT4, ENV_NAME("EXT4") .load = env_ext4_load, - .save = env_save_ptr(env_ext4_save), + .save = ENV_SAVE_PTR(env_ext4_save), };