public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] env: Make use of IF_ENABLED_INT in spi flash support
Date: Fri, 20 Mar 2026 14:53:39 -0600	[thread overview]
Message-ID: <20260320205339.3788814-1-trini@konsulko.com> (raw)

In order to build the spi flash environment driver, but with
CONFIG_ENV_REDUNDANT disabled we must make use of IF_ENABLED_INT to
check for a value in CONFIG_ENV_OFFSET_REDUND otherwise we will fail to
build.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 env/sf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/env/sf.c b/env/sf.c
index 0e27a020643e..14c35324e641 100644
--- a/env/sf.c
+++ b/env/sf.c
@@ -396,7 +396,8 @@ static int env_sf_init_early(void)
 
 	if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) {
 		read2_fail = spi_flash_read(env_flash,
-					    CONFIG_ENV_OFFSET_REDUND,
+					    IF_ENABLED_INT(CONFIG_ENV_REDUNDANT,
+							   CONFIG_ENV_OFFSET_REDUND),
 					    CONFIG_ENV_SIZE, tmp_env2);
 		ret = env_check_redund((char *)tmp_env1, read1_fail,
 				       (char *)tmp_env2, read2_fail);
-- 
2.43.0


             reply	other threads:[~2026-03-20 20:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 20:53 Tom Rini [this message]
2026-04-03 19:47 ` [PATCH] env: Make use of IF_ENABLED_INT in spi flash support Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260320205339.3788814-1-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox