]> git.sur5r.net Git - u-boot/commitdiff
net: nfs: Remove separate buffer for default name
authorJoe Hershberger <joe.hershberger@ni.com>
Mon, 15 Aug 2016 19:42:16 +0000 (14:42 -0500)
committerJoe Hershberger <joe.hershberger@ni.com>
Mon, 22 Aug 2016 19:20:11 +0000 (14:20 -0500)
There is no reason to store the default filename in a separate buffer
only to immediately copy it to the main name buffer. Just write it there
directly and remove the other buffer.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
net/nfs.c

index 4a5a1ab2a918b91cef552d046d01715cdbebcca4..d7aeef916207d037f579e09b3c5576247c4f51a0 100644 (file)
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -65,7 +65,6 @@ static int nfs_state;
 #define STATE_READ_REQ                 6
 #define STATE_READLINK_REQ             7
 
-static char default_filename[64];
 static char *nfs_filename;
 static char *nfs_path;
 static char nfs_path_buff[2048];
@@ -720,12 +719,11 @@ void nfs_start(void)
        }
 
        if (net_boot_file_name[0] == '\0') {
-               sprintf(default_filename, "/nfsroot/%02X%02X%02X%02X.img",
+               sprintf(nfs_path, "/nfsroot/%02X%02X%02X%02X.img",
                        net_ip.s_addr & 0xFF,
                        (net_ip.s_addr >>  8) & 0xFF,
                        (net_ip.s_addr >> 16) & 0xFF,
                        (net_ip.s_addr >> 24) & 0xFF);
-               strcpy(nfs_path, default_filename);
 
                printf("*** Warning: no boot file name; using '%s'\n",
                       nfs_path);