Skip to contentSkip to conversation

cmd: remoteproc: Fix the base of strtoul for ID conversion from 3 to 10

PATCH In review Keerthy 3 participants 3 messages Oct 24, 2018 – Nov 2, 2018

lore
Share & tools
lore

Keerthy

author
#0 lore raw

PATCH 1/1 cmd: remoteproc: Fix the base of strtoul for ID conversion from 3 to 10

Currently the base is 3 fix it 10 so that IDs follow decimal system.

---
 cmd/remoteproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
cmd/remoteproc.c +2 -2
index 9aebfc2..81463f3 100644
@@ -120,7 +120,7 @@ static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
 	if (argc != 4)
 		return CMD_RET_USAGE;
 
-	id = (int)simple_strtoul(argv[1], NULL, 3);
+	id = (int)simple_strtoul(argv[1], NULL, 10);
 	addr = simple_strtoul(argv[2], NULL, 16);
 
 	size = simple_strtoul(argv[3], NULL, 16);
@@ -163,7 +163,7 @@ static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	id = (int)simple_strtoul(argv[1], NULL, 3);
+	id = (int)simple_strtoul(argv[1], NULL, 10);
 
 	if (!rproc_is_initialized()) {
 		printf("\tRemote Processors are not initialized\n");
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 cmd: remoteproc: Fix the base of strtoul for ID conversion from 3 to 10

Quoted 3 lines · Keerthy

Currently the base is 3 fix it 10 so that IDs follow decimal system.

So it would fail if there are more than 3 remoteproc drivers.

Thanks and regards,
Lokesh

Quoted 27 lines
---
  cmd/remoteproc.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
cmd/remoteproc.c +2 -2
index 9aebfc2..81463f3 100644
@@ -120,7 +120,7 @@ static int do_remoteproc_load(cmd_tbl_t *cmdtp, int flag, int argc,
  	if (argc != 4)
  		return CMD_RET_USAGE;
 
-	id = (int)simple_strtoul(argv[1], NULL, 3);
+	id = (int)simple_strtoul(argv[1], NULL, 10);
  	addr = simple_strtoul(argv[2], NULL, 16);
 
  	size = simple_strtoul(argv[3], NULL, 16);
@@ -163,7 +163,7 @@ static int do_remoteproc_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
  	if (argc != 2)
  		return CMD_RET_USAGE;
 
-	id = (int)simple_strtoul(argv[1], NULL, 3);
+	id = (int)simple_strtoul(argv[1], NULL, 10);
 
  	if (!rproc_is_initialized()) {
  		printf("\tRemote Processors are not initialized\n");
#2 lore raw
In reply to Keerthy
Quoted 4 lines · Keerthy

Currently the base is 3 fix it 10 so that IDs follow decimal system.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181102/32f29323/attachment.sig>