From patchwork Mon Sep 2 13:25:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Forissier X-Patchwork-Id: 824691 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp1942307wrs; Mon, 2 Sep 2024 06:25:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU5XF6oZ7RI2puRPQFKHpwyAFWyghFH7ufdR15SY2/JjmEp9QIzdhOjlug4BCnKLSpY3ntJfA==@linaro.org X-Google-Smtp-Source: AGHT+IFj13ngL/zZc7LUgOnc8R5CeImjOCeJfo9+1cdgk/80eqJxfGjd/CBx5FUwo7cQAVyZaxCT X-Received: by 2002:a05:6402:d0e:b0:5c2:112f:aa77 with SMTP id 4fb4d7f45d1cf-5c21ed98508mr12967082a12.31.1725283545678; Mon, 02 Sep 2024 06:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725283545; cv=none; d=google.com; s=arc-20240605; b=Ew/mQi5QT13TThufgaG+/T10aOOzNivoQoJEN/RxkHVqQfNBsU5ByBSxcl98scJ6dj tAbqVk89z/gsg9Vcb0Qp7UR/js3KenuADRgU9z4loGvZluEZlqNnZ4O2fm1x2LfwvWYm J3R0mCZCg3jAxftxrroPQ9jlmD3YHhExs682awn72HVlJ6gFWHEwx1GIbd4X/nlNWHOD jgNLwz2FNw9uMcG2U+sY4Bdr7RcQE9HKwX0/e6mYR7oCaigLhNmH5Lwz00kn6fhgLWWn 1NMsyhPHbepB+xaNWetBNi4GECyKqMvhNgRPA0S9NQHPwtGALD9jrKZZIlMXOC1KHr96 E/5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=2YqgAKzPcZIp7cigAi39MJ60yMHP2xJr5ZWvqMJCk9k=; fh=hyvrW9l2kgnjFUv3cKvH5HkmSPuTBcvKBRFLtdQR84k=; b=FHtsMhlncByUHQ4NFQTP5RwhHNCyeLmYU1eqcHAMzFkTn92d6WgxSOA2g4LDJfIEO/ DNDAqX8ODdyOKTHa80nHKrapHY6g7zc1iwUUsJLdE8zPbHSaAyxZ307q6zDaQ6jrh6sA BYPErUmZ2kFRiSVy2mYYE06XZpP4gSGEH9RNrZr/0Z9pU+ZVQR72Tte3uFyyvbAsbxfr YaOMeHG25oYG2g+l+CgcFYKLk74qMzuCpJBXh+9q4YzDux2XSRqokwurKPe0VlqMhSTh 4dh1bPHZ+3GSfotcTTYj+My4hjhgYlYSh575CCTe9AUojj6UhqUyBSvR4zgTAQ1U7Z9e V3qg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sLQsORMR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5c226d06032si7069102a12.367.2024.09.02.06.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 06:25:45 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sLQsORMR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 11CAD88B4B; Mon, 2 Sep 2024 15:25:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="sLQsORMR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 441AD88C39; Mon, 2 Sep 2024 15:25:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 53F7B88B49 for ; Mon, 2 Sep 2024 15:25:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jerome.forissier@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-374bb1a3addso1502755f8f.1 for ; Mon, 02 Sep 2024 06:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725283541; x=1725888341; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2YqgAKzPcZIp7cigAi39MJ60yMHP2xJr5ZWvqMJCk9k=; b=sLQsORMRGW0PqfLSG0JPx86+Or/wuAqCbh8bWQq8IjaJTYdKoI9r6gzSllQpLRInEm /tYhZlAt9dIumRZ4go5YJ9dS1k9LtbLMkZyiO+EvAg8NmuwjUSiDx7Zp/Uc7fDwnY21j vGmwFjeWGBh13HyupLvsARqrtE09MD2Rj+FkzIQPDoyU/f+1c8st2//ZEPK4q6OUIvVr 8P4rnC8v8FXR0s86qGIH4FjXI4oPBjUAOSxL58CxM/YTsxWt9ymSdndlCwGS8OvliSrK u8GbpksPqNNVv/JtMuH3WO2aR5EABKlhFWmZarfMxYiIwCkLnjo2OFPTScOgONmgSNeJ SA/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725283541; x=1725888341; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2YqgAKzPcZIp7cigAi39MJ60yMHP2xJr5ZWvqMJCk9k=; b=CgfZ11tgZQv9KZmZLZtApRfmNjOvNwCy9N7mlkAICPL7VU0VeAR+Ti7cYNr+9NE6fC MG1iIR3k7m0/YSLCm9U8D4b000Dp/vxDBW+HmRKAq0uXIALFpf2GJvOKXaVAvOdeKnFi eoWPB6gzkaZqxOjTT2RaX2M0v7PNnjT0o8BpZjPslTdOAx1UIf4eRT0aWTjuAcCtnm/E UOAhXbgALtaiS2pTcyiHUUwjNkCaiXu+O/Q7wwK2cCnlIQGprs/sC6J2et8LiI4ns12V 1E7baLIQuvQOZtv9kwxq8RAoxoEIQ1+VrCyYn9DNv3QSPYiAX1ZhOyIijE3jX7hKg+Wk JyJw== X-Gm-Message-State: AOJu0YyVmPlj1ae6EOuyVI7q/HJQNtnrVeOL+i3aaO6p9CdFyJd/QkOT pIfFQRxgjAzxREUEEBwurX5VeVmUBrVYfArZHrObY7o0xMlGTqhwrqCGAWLSCmqTyp5sHrSaIN1 wJb18Nw== X-Received: by 2002:a05:6000:18a1:b0:374:cd36:8533 with SMTP id ffacd0b85a97d-374cd368862mr2227988f8f.54.1725283541377; Mon, 02 Sep 2024 06:25:41 -0700 (PDT) Received: from builder.. ([2a01:e0a:3cb:7bb0:6417:8cf6:a7f7:ee38]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ee5080asm11723512f8f.18.2024.09.02.06.25.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2024 06:25:41 -0700 (PDT) From: Jerome Forissier To: u-boot@lists.denx.de Cc: Jerome Forissier , Joe Hershberger , Ramon Fried , Tom Rini , Simon Glass , Sean Anderson , Marek Vasut Subject: [PATCH] net: guard call to tftp_start() with IS_ENABLED(CONFIG_CMD_TFTPBOOT) Date: Mon, 2 Sep 2024 15:25:11 +0200 Message-Id: <20240902132511.148683-1-jerome.forissier@linaro.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean net_auto_load() cannot call tftp_start() if CONFIG_CMD_TFTPBOOT is disabled. Signed-off-by: Jerome Forissier --- net/net.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/net/net.c b/net/net.c index d9bc9df643f..1e0b7c85624 100644 --- a/net/net.c +++ b/net/net.c @@ -334,17 +334,22 @@ void net_auto_load(void) net_set_state(NETLOOP_SUCCESS); return; } - if (net_check_prereq(TFTPGET)) { -/* We aren't expecting to get a serverip, so just accept the assigned IP */ - if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) { - net_set_state(NETLOOP_SUCCESS); - } else { - printf("Cannot autoload with TFTPGET\n"); - net_set_state(NETLOOP_FAIL); + if (IS_ENABLED(CONFIG_CMD_TFTPBOOT)) { + if (net_check_prereq(TFTPGET)) { + /* + * We aren't expecting to get a serverip, so just + * accept the assigned IP + */ + if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) { + net_set_state(NETLOOP_SUCCESS); + } else { + printf("Cannot autoload with TFTPGET\n"); + net_set_state(NETLOOP_FAIL); + } + return; } - return; + tftp_start(TFTPGET); } - tftp_start(TFTPGET); } static int net_init_loop(void)