public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/10] pxe: make string parameters const
Date: Sun,  2 Dec 2012 21:00:21 -0600	[thread overview]
Message-ID: <1354503629-25621-3-git-send-email-robherring2@gmail.com> (raw)
In-Reply-To: <1354503629-25621-1-git-send-email-robherring2@gmail.com>

From: Rob Herring <rob.herring@calxeda.com>

Convert a bunch of string parameters to be const.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 common/cmd_pxe.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 306c483..8b897ad 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -31,7 +31,7 @@
  * environment.  It always returns what getenv does, so it can be used in
  * place of getenv without changing error handling otherwise.
  */
-static char *from_env(char *envvar)
+static char *from_env(const char *envvar)
 {
 	char *ret;
 
@@ -115,14 +115,14 @@ static int get_bootfile_path(const char *file_path, char *bootfile_path,
 	return 1;
 }
 
-static int (*do_getfile)(char *file_path, char *file_addr);
+static int (*do_getfile)(const char *file_path, char *file_addr);
 
-static int do_get_tftp(char *file_path, char *file_addr)
+static int do_get_tftp(const char *file_path, char *file_addr)
 {
 	char *tftp_argv[] = {"tftp", NULL, NULL, NULL};
 
 	tftp_argv[1] = file_addr;
-	tftp_argv[2] = file_path;
+	tftp_argv[2] = (void *)file_path;
 
 	if (do_tftpb(NULL, 0, 3, tftp_argv))
 		return -ENOENT;
@@ -132,12 +132,12 @@ static int do_get_tftp(char *file_path, char *file_addr)
 
 static char *fs_argv[5];
 
-static int do_get_ext2(char *file_path, char *file_addr)
+static int do_get_ext2(const char *file_path, char *file_addr)
 {
 #ifdef CONFIG_CMD_EXT2
 	fs_argv[0] = "ext2load";
 	fs_argv[3] = file_addr;
-	fs_argv[4] = file_path;
+	fs_argv[4] = (void *)file_path;
 
 	if (!do_ext2load(NULL, 0, 5, fs_argv))
 		return 1;
@@ -145,12 +145,12 @@ static int do_get_ext2(char *file_path, char *file_addr)
 	return -ENOENT;
 }
 
-static int do_get_fat(char *file_path, char *file_addr)
+static int do_get_fat(const char *file_path, char *file_addr)
 {
 #ifdef CONFIG_CMD_FAT
 	fs_argv[0] = "fatload";
 	fs_argv[3] = file_addr;
-	fs_argv[4] = file_path;
+	fs_argv[4] = (void *)file_path;
 
 	if (!do_fat_fsload(NULL, 0, 5, fs_argv))
 		return 1;
@@ -166,7 +166,7 @@ static int do_get_fat(char *file_path, char *file_addr)
  *
  * Returns 1 for success, or < 0 on error.
  */
-static int get_relfile(char *file_path, void *file_addr)
+static int get_relfile(const char *file_path, void *file_addr)
 {
 	size_t path_len;
 	char relfile[MAX_TFTP_PATH_LEN+1];
@@ -205,7 +205,7 @@ static int get_relfile(char *file_path, void *file_addr)
  *
  * Returns 1 on success, or < 0 for error.
  */
-static int get_pxe_file(char *file_path, void *file_addr)
+static int get_pxe_file(const char *file_path, void *file_addr)
 {
 	unsigned long config_file_size;
 	char *tftp_filesize;
@@ -242,7 +242,7 @@ static int get_pxe_file(char *file_path, void *file_addr)
  *
  * Returns 1 on success or < 0 on error.
  */
-static int get_pxelinux_path(char *file, void *pxefile_addr_r)
+static int get_pxelinux_path(const char *file, void *pxefile_addr_r)
 {
 	size_t base_len = strlen(PXELINUX_DIR);
 	char path[MAX_TFTP_PATH_LEN+1];
@@ -382,7 +382,7 @@ do_pxe_get(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  *
  * Returns 1 on success or < 0 on error.
  */
-static int get_relfile_envaddr(char *file_path, char *envaddr_name)
+static int get_relfile_envaddr(const char *file_path, const char *envaddr_name)
 {
 	unsigned long file_addr;
 	char *envaddr;
-- 
1.7.10.4

  parent reply	other threads:[~2012-12-03  3:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-03  3:00 [U-Boot] [PATCH 00/10] PXE support updates Rob Herring
2012-12-03  3:00 ` [U-Boot] [PATCH 01/10] pxe: Use ethact setting for pxe Rob Herring
2013-07-08 15:48   ` Joe Hershberger
2012-12-03  3:00 ` Rob Herring [this message]
2012-12-03  3:00 ` [U-Boot] [PATCH 03/10] pxe: fix handling of different localboot values Rob Herring
2012-12-03  3:00 ` [U-Boot] [PATCH 04/10] bootz: un-staticize do_bootz Rob Herring
2012-12-03  3:00 ` [U-Boot] [PATCH 05/10] pxe: use bootz instead of bootm when enabled Rob Herring
2012-12-03 12:22   ` Wolfgang Denk
2012-12-03 14:16     ` Rob Herring
2012-12-03 19:17   ` [U-Boot] [PATCH v2] pxe: try bootz if bootm fails to find a valid image Rob Herring
2013-07-08 15:52     ` Joe Hershberger
2012-12-03  3:00 ` [U-Boot] [PATCH 06/10] pxe: always display a menu when present Rob Herring
2012-12-03  3:00 ` [U-Boot] [PATCH 07/10] pxe: simplify menu display and selection Rob Herring
2012-12-03  3:00 ` [U-Boot] [PATCH 08/10] pxe: add support for ontimeout token Rob Herring
2012-12-03  3:00 ` [U-Boot] [PATCH 09/10] pxe: add support for per arch and SoC default paths Rob Herring
2012-12-03  3:00 ` [U-Boot] [PATCH 10/10] pxe: add ipappend support Rob Herring
2013-05-14 19:48 ` [U-Boot] [PATCH 00/10] PXE support updates Rob Herring
2013-05-14 20:32   ` Joe Hershberger
2013-06-16 15:24     ` Rob Herring
2013-06-17  2:29       ` Joe Hershberger
2013-06-21 15:33         ` Joe Hershberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354503629-25621-3-git-send-email-robherring2@gmail.com \
    --to=robherring2@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox