[PATCH v2 03/13] lwip: split net/lwip/wget.c

Tom Rini trini at konsulko.com
Fri Jun 6 16:17:05 CEST 2025


On Fri, Jun 06, 2025 at 08:41:39AM +0200, Jerome Forissier wrote:

> Split net/lwip/wget.c in two: one part which implements CONFIG_WGET
> stays in net/ while the part that implements CONFIG_CMD_WGET is moved
> into cmd/.
> 
> Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
[snip]
> diff --git a/include/net-lwip.h b/include/net-lwip.h
> index b762956e8fd..cf3cf513b2b 100644
> --- a/include/net-lwip.h
> +++ b/include/net-lwip.h
> @@ -6,6 +6,19 @@
>  #include <lwip/ip4.h>
>  #include <lwip/netif.h>
>  
> +#if CONFIG_IS_ENABLED(WGET_CACERT)
> +/* HTTPS authentication mode */
> +enum auth_mode {
> +	AUTH_NONE,
> +	AUTH_OPTIONAL,
> +	AUTH_REQUIRED,
> +};
> +
> +extern char *cacert;
> +extern size_t cacert_size;
> +extern enum auth_mode cacert_auth_mode;
> +#endif

Since we aren't going to run in to compile problems elsewhere because
these are in the header file (IOW we don't reference CONFIG symbols
which might not be set), we shouldn't guard these here. In general it's
an anti-pattern because it makes it harder to do:
if (IS_ENABLED(CONFIG_FOO)) { ... }
in code. Thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250606/78f6e78a/attachment.sig>


More information about the U-Boot mailing list