efi: Avoid including net.h unless necessary

When exfat is enabled this causes linux/byteorder to be included:

In file included from include/linux/byteorder/little_endian.h:107,
                 from arch/sandbox/include/asm/byteorder.h:19,
                 from include/net-legacy.h:16,
                 from include/net.h:11,
                 from include/efi.h:23,
                 from include/blk.h:12,
                 from include/part.h:9,
                 from include/fs_internal.h:11,
                 from fs/exfat/io.c:50:

Fix it by only added the net.h include for the EFI app, which is the
only user. The EFI app is highly unlikely to make use of exfat in any
case. If it does, we could refactor net.h to separate the struct
definitions from the functions, perhaps.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-04-30 08:31:46 -06:00
parent 84d7727765
commit 1cdebf7d8f

View File

@@ -19,7 +19,7 @@
#include <linux/linkage.h>
#include <linux/string.h>
#include <linux/types.h>
#ifndef USE_HOSTCC
#if !defined(USE_HOSTCC) && CONFIG_EFI_APP
#include <net.h>
#endif
@@ -509,7 +509,7 @@ struct efi_media_plat {
struct efi_device_path *device_path;
};
#ifndef USE_HOSTCC
#if !defined(USE_HOSTCC) && CONFIG_EFI_APP
/*
* EFI attributes of the udevice handled by efi_net driver
*