Hi Jerome,

On 9/2/24 2:59 PM, Jerome Forissier wrote:
net_auto_load() cannot call tftp_start() if CONFIG_CMD_TFTPBOOT is
disabled.

Signed-off-by: Jerome Forissier <[email protected]>
---
  net/net.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/net/net.c b/net/net.c
index d9bc9df643f..35961ba1c7d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -334,6 +334,7 @@ void net_auto_load(void)
                net_set_state(NETLOOP_SUCCESS);
                return;
        }
+#if defined(CONFIG_CMD_TFTPBOOT)

I think we're supposed to use if IS_ENABLED(CONFIG_CMD_TFTPBOOT) now.

Additionally, it's highly recommended to rather use "normal" if's wherever possible, i.e.:

        if (IS_ENABLED(CONFIG_CMD_TFTPBOOT)) {
            if (net_check_prereq(TFTPGET)) {
                if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) {
[...]
                return;
            }
            tftp_start(TFTPGET);
        }
    }

Would that work?

Cheers,
Quentin

Reply via email to