net: fix build without NFS or NFS download enabled
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 15 May 2020 10:08:54 +0000 (12:08 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 20 Oct 2020 06:13:49 +0000 (15:13 +0900)
Partial NFS download requires setting net_boot_file_{offset,size_limit}
global variables, which are available only when CONFIG_CMD_NFS is set.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I74e2dbb56c2b41078d2e5506bdcba6458299d792

cmd/net.c

index 35a13da..877ec4d 100644 (file)
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -198,8 +198,10 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
        ulong addr;
 
        net_boot_file_name_explicit = false;
+#if defined(CONFIG_CMD_NFS)
        net_boot_file_offset = 0;
        net_boot_file_size_limit = 0;
+#endif
 
        /* pre-set image_load_addr */
        s = env_get("loadaddr");
@@ -285,6 +287,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
        return rcode;
 }
 
+#if defined(CONFIG_CMD_NFS_DOWNLOAD)
 int netboot_nfs(unsigned long addr, const char *filename,
                unsigned long offset, unsigned long limit)
 {
@@ -322,7 +325,7 @@ int netboot_nfs(unsigned long addr, const char *filename,
                bootstage_error(BOOTSTAGE_ID_NET_DONE_ERR);
        return rcode;
 }
-
+#endif
 
 #if defined(CONFIG_CMD_PING)
 static int do_ping(struct cmd_tbl *cmdtp, int flag, int argc,