Skip to contentSkip to conversation

Fix some more printf() format problems.

PATCH New Kumar Gala 2 participants 4 messages Jul 14, 2008

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 Fix some more printf() format problems.

---
 common/cmd_mp.c  |    2 +-
 cpu/mpc85xx/mp.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
common/cmd_mp.c +1 -1
index 26a57c5..59d0d15 100644
@@ -35,7 +35,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 	cpuid = simple_strtoul(argv[1], NULL, 10);
 	if (cpuid >= CONFIG_NR_CPUS) {
-		printf ("Core num: %d is out of range[0..%d]\n",
+		printf ("Core num: %ld is out of range[0..%d]\n",
 				cpuid, CONFIG_NR_CPUS - 1);
 		return 1;
 	}
cpu/mpc85xx/mp.c +2 -2
index a527cf3..75ceba9 100644
@@ -50,12 +50,12 @@ int cpu_status(int nr)
 
 	if (nr == id) {
 		table = (u32 *)get_spin_addr();
-		printf("table base @ 0x%08x\n", table);
+		printf("table base @ 0x%08x\n", (u32)table);
 	} else {
 		table = (u32 *)get_spin_addr() + nr * NUM_BOOT_ENTRY;
 		printf("Running on cpu %d\n", id);
 		printf("\n");
-		printf("table @ 0x%08x:\n", table);
+		printf("table @ 0x%08x:\n", (u32)table);
 		printf("   addr - 0x%08x\n", table[BOOT_ENTRY_ADDR_LOWER]);
 		printf("   pir  - 0x%08x\n", table[BOOT_ENTRY_PIR]);
 		printf("   r3   - 0x%08x\n", table[BOOT_ENTRY_R3_LOWER]);
Signature · 1 line
1.5.5.1
#1 lore raw

PATCH 1/1 Fix some more printf() format problems.

Quoted 12 lines · Kumar Gala
---
 common/cmd_mp.c  |    2 +-
 cpu/mpc85xx/mp.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
common/cmd_mp.c +0 -0
index 26a57c5..59d0d15 100644

common/cmd_mp.c cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 38

Quoted 5 lines
common/cmd_mp.c +1 -1
@@ -35,7 +35,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 	cpuid = simple_strtoul(argv[1], NULL, 10);
 	if (cpuid >= CONFIG_NR_CPUS) {
-		printf ("Core num: %d is out of range[0..%d]\n",
+		printf ("Core num: %ld is out of range[0..%d]\n",

is it not %lu? cpuid is a unsigned long.

cpu/mpc85xx/mp.c int cpu_status(int nr) · line 53

Quoted 13 lines
common/cmd_mp.c +0 -0
 				cpuid, CONFIG_NR_CPUS - 1);
 		return 1;
 	}
cpu/mpc85xx/mp.c +1 -1
index a527cf3..75ceba9 100644
@@ -50,12 +50,12 @@ int cpu_status(int nr)
 
 	if (nr == id) {
 		table = (u32 *)get_spin_addr();
-		printf("table base @ 0x%08x\n", table);
+		printf("table base @ 0x%08x\n", (u32)table);

why not use %p? it's a pointer.

cpu/mpc85xx/mp.c int cpu_status(int nr) · line 58

Quoted 6 lines
cpu/mpc85xx/mp.c +1 -1
 	} else {
 		table = (u32 *)get_spin_addr() + nr * NUM_BOOT_ENTRY;
 		printf("Running on cpu %d\n", id);
 		printf("\n");
-		printf("table @ 0x%08x:\n", table);
+		printf("table @ 0x%08x:\n", (u32)table);

same.

Quoted 5 lines
cpu/mpc85xx/mp.c +0 -0
 		printf("   addr - 0x%08x\n", table[BOOT_ENTRY_ADDR_LOWER]);
 		printf("   pir  - 0x%08x\n", table[BOOT_ENTRY_PIR]);
 		printf("   r3   - 0x%08x\n", table[BOOT_ENTRY_R3_LOWER]);
Signature · 1 line
1.5.5.1

Best Regards,
J.

author
#2 lore raw

PATCH 1/1 Fix some more printf() format problems.

Quoted 15 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 14 lines · Kumar Gala

---

common/cmd_mp.c  |    2 +-
cpu/mpc85xx/mp.c |    4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
common/cmd_mp.c +0 -0
index 26a57c5..59d0d15 100644
@@ -35,7 +35,7 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc,  
 char *argv[])
 
Quoted 5 lines

common/cmd_mp.c cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 38

Quoted 4 lines
common/cmd_mp.c +1 -1
 	cpuid = simple_strtoul(argv[1], NULL, 10);
 	if (cpuid >= CONFIG_NR_CPUS) {
-		printf ("Core num: %d is out of range[0..%d]\n",
+		printf ("Core num: %ld is out of range[0..%d]\n",

is it not %lu? cpuid is a unsigned long.

probably.

Quoted 10 lines
Quoted 10 lines
common/cmd_mp.c +0 -0
 				cpuid, CONFIG_NR_CPUS - 1);
 		return 1;
	}
cpu/mpc85xx/mp.c +0 -0
index a527cf3..75ceba9 100644
@@ -50,12 +50,12 @@ int cpu_status(int nr)
 
Quoted 5 lines

cpu/mpc85xx/mp.c int cpu_status(int nr) · line 53

Quoted 4 lines
cpu/mpc85xx/mp.c +1 -1
 	if (nr == id) {
 		table = (u32 *)get_spin_addr();
-		printf("table base @ 0x%08x\n", table);
+		printf("table base @ 0x%08x\n", (u32)table);

why not use %p? it's a pointer.

do we support %p in u-boot?

- k

#3 lore raw

PATCH 1/1 Fix some more printf() format problems.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

				cpuid, CONFIG_NR_CPUS - 1);
		return 1;
	}
cpu/mpc85xx/mp.c +0 -0
index a527cf3..75ceba9 100644
@@ -50,12 +50,12 @@ int cpu_status(int nr)
 
Quoted 7 lines
Quoted 5 lines

cpu/mpc85xx/mp.c int cpu_status(int nr) · line 53

Quoted 4 lines
cpu/mpc85xx/mp.c +1 -1
 	if (nr == id) {
 		table = (u32 *)get_spin_addr();
-		printf("table base @ 0x%08x\n", table);
+		printf("table base @ 0x%08x\n", (u32)table);

why not use %p? it's a pointer.

do we support %p in u-boot?

yes we support it.

Best Regards,
J.