[PATCH] net: tftpput: Rework to exclude code from xPL phases
Quentin Schulz
quentin.schulz at cherry.de
Tue Jan 13 17:30:55 CET 2026
Hi Tom,
On 12/25/25 4:37 PM, Tom Rini wrote:
> Given how the support for CONFIG_CMD_TFTPPUT is woven through the
> support for the tftp protocol we currently end up including "put"
> support in xPL phases, if enabled. This in turn can lead to size
> overflow on those platforms as xPL tends to be constrained. To resolve
> this, use "CMD_TFTPPUT" in the code to check for both CONFIG_CMD_TFTPPUT
> being true and not being in an xPL build phase.
>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
> Cc: Jerome Forissier <jerome.forissier at arm.com>
> ---
> net/tftp.c | 31 ++++++++++++++++++++-----------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/net/tftp.c b/net/tftp.c
> index 3b0f4cd2006e..78ec44159c1b 100644
> --- a/net/tftp.c
> +++ b/net/tftp.c
> @@ -22,6 +22,15 @@
>
> DECLARE_GLOBAL_DATA_PTR;
>
> +/*
> + * We cannot use the 'tftpput' command in xPL phases. Given how the
> + * support is integrated in the code, this is how we disable that support
> + * in xPL.
> + */
> +#if defined(CONFIG_CMD_TFTPPUT) && !defined(CONFIG_XPL_BUILD)
> +#define CMD_TFTPPUT
> +#endif
> +
Doesn't
#if CONFIG_IS_ENABLED(CMD_TFTPPUT)
work?
Of course, CONFIG_SPL_CMD_TFTPPUT, TPL_, VPL_, ... will never exist, so
that should tackle it properly and be more consistent with the reset of
the (recent) code base?
Cheers,
Quentin
More information about the U-Boot
mailing list