public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] Allow negative offset in command loads
@ 2008-07-23 17:10 Ricardo Ribalda Delgado
  2008-07-23 17:10 ` [U-Boot-Users] [PATCH] I2C EEPROM simulator (Resubmit) Ricardo Ribalda Delgado
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Ribalda Delgado @ 2008-07-23 17:10 UTC (permalink / raw)
  To: u-boot

Comand loads only allows positive offset for relocating the .srec files,
this patch allows negative offsets

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
---
 common/cmd_load.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/cmd_load.c b/common/cmd_load.c
index 89f6403..ae56543 100644
--- a/common/cmd_load.c
+++ b/common/cmd_load.c
@@ -53,7 +53,7 @@ static int do_echo = 1;
 #if defined(CONFIG_CMD_LOADS)
 int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-	ulong offset = 0;
+	long offset = 0;
 	ulong addr;
 	int i;
 	char *env_echo;
@@ -72,7 +72,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 #ifdef	CFG_LOADS_BAUD_CHANGE
 	if (argc >= 2) {
-		offset = simple_strtoul(argv[1], NULL, 16);
+		offset = simple_strtol(argv[1], NULL, 16);
 	}
 	if (argc == 3) {
 		load_baudrate = (int)simple_strtoul(argv[2], NULL, 10);
@@ -95,7 +95,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	}
 #else	/* ! CFG_LOADS_BAUD_CHANGE */
 	if (argc == 2) {
-		offset = simple_strtoul(argv[1], NULL, 16);
+		offset = simple_strtol(argv[1], NULL, 16);
 	}
 #endif	/* CFG_LOADS_BAUD_CHANGE */
 
@@ -141,7 +141,7 @@ int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 }
 
 static ulong
-load_serial (ulong offset)
+load_serial (long offset)
 {
 	char	record[SREC_MAXRECLEN + 1];	/* buffer for one S-Record	*/
 	char	binbuf[SREC_MAXBINLEN];		/* buffer for binary data	*/
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-08-18 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 17:10 [U-Boot-Users] [PATCH] Allow negative offset in command loads Ricardo Ribalda Delgado
2008-07-23 17:10 ` [U-Boot-Users] [PATCH] I2C EEPROM simulator (Resubmit) Ricardo Ribalda Delgado
2008-07-23 17:10   ` [U-Boot-Users] [PATCH] I2C Monitor chip ADT7460 support (Resubmit) Ricardo Ribalda Delgado
2008-08-18 21:48     ` [U-Boot] " Wolfgang Denk
2008-07-25  7:37   ` [U-Boot-Users] [PATCH] I2C EEPROM simulator (Resubmit) Michal Simek
2008-07-25  8:55     ` Ricardo Ribalda Delgado
2008-07-26  8:09       ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox