Skip to contentSkip to conversation

dm: sparc: net: Fixup greth compile warnings

PATCH New Marek Vasut 2 participants 8 messages Jul 27, 2012 – Sep 18, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dm: sparc: net: Fixup greth compile warnings

greth.c: In function ?greth_recv?:
greth.c:507:3: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?unsigned int? [-Wformat] greth.c:507:3: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 3 has type ?unsigned int? [-Wformat] greth.c:541:6: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
greth.c: In function ?greth_initialize?:
greth.c:623:2: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?struct greth_regs *? [-Wformat] greth.c:655:3: warning: format ?%x? expects argument of type ?unsigned int?, but argument 2 has type ?struct greth_regs *? [-Wformat] greth.c:684:2: warning: format ?%x? expects argument of type ?unsigned int?, but argument 2 has type ?struct greth_regs *? [-Wformat]

Cc Joe Hershberger <[email protected]>
Cc Daniel Hellstrom <[email protected]>
Cc u-boot-dm at lists.denx.de
---
 drivers/net/greth.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/greth.c +5 -5
index 08206c8..3103a74 100644
@@ -483,7 +483,7 @@ int greth_recv(struct eth_device *dev)
 	greth_regs *regs = greth->regs;
 	greth_bd *rxbd;
 	unsigned int status, len = 0, bad;
-	unsigned char *d;
+	char *d;
 	int enable = 0;
 	int i;
 
@@ -504,7 +504,7 @@ int greth_recv(struct eth_device *dev)
 			goto done;
 		}
 
-		debug("greth_recv: packet 0x%lx, 0x%lx, len: %d\n",
+		debug("greth_recv: packet 0x%x, 0x%x, len: %d\n",
 		       (unsigned int)rxbd, status, status & GRETH_BD_LEN);
 
 		/* Check status for errors.
@@ -620,7 +620,7 @@ int greth_initialize(bd_t * bis)
 
 	greth->regs = (greth_regs *) apbdev.address;
 	greth->irq = apbdev.irq;
-	debug("Found GRETH at 0x%lx, irq %d\n", greth->regs, greth->irq);
+	debug("Found GRETH at %p, irq %d\n", greth->regs, greth->irq);
 	dev->priv = (void *)greth;
 	dev->iobase = (unsigned int)greth->regs;
 	dev->init = greth_init;
@@ -652,7 +652,7 @@ int greth_initialize(bd_t * bis)
 	/* initiate PHY, select speed/duplex depending on connected PHY */
 	if (greth_init_phy(greth, bis)) {
 		/* Failed to init PHY (timedout) */
-		debug("GRETH[0x%08x]: Failed to init PHY\n", greth->regs);
+		debug("GRETH[%p]: Failed to init PHY\n", greth->regs);
 		return -1;
 	}
 
@@ -681,6 +681,6 @@ int greth_initialize(bd_t * bis)
 	/* set and remember MAC address */
 	greth_set_hwaddr(greth, addr);
 
-	debug("GRETH[0x%08x]: Initialized successfully\n", greth->regs);
+	debug("GRETH[%p]: Initialized successfully\n", greth->regs);
 	return 0;
 }
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/3 dm: sparc: net: Fixup greth compile warnings

Hi Tom,

can you pick these three sparc things by hand please?

Quoted 63 lines

greth.c: In function ?greth_recv?:
greth.c:507:3: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?unsigned int? [-Wformat] greth.c:507:3: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 3 has type ?unsigned int? [-Wformat] greth.c:541:6: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] greth.c: In function ?greth_initialize?:
greth.c:623:2: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?struct greth_regs *? [-Wformat] greth.c:655:3: warning: format ?%x? expects argument of type ?unsigned int?, but argument 2 has type ?struct greth_regs *? [-Wformat] greth.c:684:2: warning: format ?%x? expects argument of type ?unsigned int?, but argument 2 has type ?struct greth_regs *? [-Wformat]

Cc Joe Hershberger <[email protected]>
Cc Daniel Hellstrom <[email protected]>
Cc u-boot-dm at lists.denx.de
---
 drivers/net/greth.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/greth.c +4 -4
index 08206c8..3103a74 100644
@@ -483,7 +483,7 @@ int greth_recv(struct eth_device *dev)
 	greth_regs *regs = greth->regs;
 	greth_bd *rxbd;
 	unsigned int status, len = 0, bad;
-	unsigned char *d;
+	char *d;
 	int enable = 0;
 	int i;
 
@@ -504,7 +504,7 @@ int greth_recv(struct eth_device *dev)
 			goto done;
 		}
 
-		debug("greth_recv: packet 0x%lx, 0x%lx, len: %d\n",
+		debug("greth_recv: packet 0x%x, 0x%x, len: %d\n",
 		       (unsigned int)rxbd, status, status & GRETH_BD_LEN);
 
 		/* Check status for errors.
@@ -620,7 +620,7 @@ int greth_initialize(bd_t * bis)
 
 	greth->regs = (greth_regs *) apbdev.address;
 	greth->irq = apbdev.irq;
-	debug("Found GRETH at 0x%lx, irq %d\n", greth->regs, greth->irq);
+	debug("Found GRETH at %p, irq %d\n", greth->regs, greth->irq);
 	dev->priv = (void *)greth;
 	dev->iobase = (unsigned int)greth->regs;
 	dev->init = greth_init;
@@ -652,7 +652,7 @@ int greth_initialize(bd_t * bis)
 	/* initiate PHY, select speed/duplex depending on connected PHY */
 	if (greth_init_phy(greth, bis)) {
 		/* Failed to init PHY (timedout) */
-		debug("GRETH[0x%08x]: Failed to init PHY\n", greth->regs);
+		debug("GRETH[%p]: Failed to init PHY\n", greth->regs);
 		return -1;
 	}
 

drivers/net/greth.c int greth_initialize(bd_t * bis) · line 686

Quoted 7 lines
drivers/net/greth.c +1 -1
@@ -681,6 +681,6 @@ int greth_initialize(bd_t * bis)
 	/* set and remember MAC address */
 	greth_set_hwaddr(greth, addr);
 
-	debug("GRETH[0x%08x]: Initialized successfully\n", greth->regs);
+	debug("GRETH[%p]: Initialized successfully\n", greth->regs);
 	return 0;
 }

Best regards,
Marek Vasut

#2 lore raw

PATCH 2/3 dm: sparc: common: Fixup cmd_bdinfo warnings

In reply to Marek Vasut

cmd_bdinfo.c: In function ?do_bdinfo?:
cmd_bdinfo.c:220:9: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?int? [-Wformat] cmd_bdinfo.c:222:9: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?int? [-Wformat] cmd_bdinfo.c:224:9: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?int? [-Wformat] cmd_bdinfo.c:226:9: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?int? [-Wformat] cmd_bdinfo.c:228:9: warning: format ?%lx? expects argument of type ?long unsigned int?, but argument 2 has type ?int? [-Wformat]

Cc Daniel Hellstrom <[email protected]>
Cc u-boot-dm at lists.denx.de
---
 common/cmd_bdinfo.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
common/cmd_bdinfo.c +5 -5
index 42f08fd..23bd8a5 100644
@@ -216,15 +216,15 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 	print_num("flashstart             ", bd->bi_flashstart);
 	print_num("CONFIG_SYS_MONITOR_BASE       ", CONFIG_SYS_MONITOR_BASE);
 	print_num("CONFIG_ENV_ADDR           ", CONFIG_ENV_ADDR);
-	printf("CONFIG_SYS_RELOC_MONITOR_BASE = 0x%lx (%d)\n", CONFIG_SYS_RELOC_MONITOR_BASE,
+	printf("CONFIG_SYS_RELOC_MONITOR_BASE = 0x%x (%d)\n", CONFIG_SYS_RELOC_MONITOR_BASE,
 	       CONFIG_SYS_MONITOR_LEN);
-	printf("CONFIG_SYS_MALLOC_BASE        = 0x%lx (%d)\n", CONFIG_SYS_MALLOC_BASE,
+	printf("CONFIG_SYS_MALLOC_BASE        = 0x%x (%d)\n", CONFIG_SYS_MALLOC_BASE,
 	       CONFIG_SYS_MALLOC_LEN);
-	printf("CONFIG_SYS_INIT_SP_OFFSET     = 0x%lx (%d)\n", CONFIG_SYS_INIT_SP_OFFSET,
+	printf("CONFIG_SYS_INIT_SP_OFFSET     = 0x%x (%d)\n", CONFIG_SYS_INIT_SP_OFFSET,
 	       CONFIG_SYS_STACK_SIZE);
-	printf("CONFIG_SYS_PROM_OFFSET        = 0x%lx (%d)\n", CONFIG_SYS_PROM_OFFSET,
+	printf("CONFIG_SYS_PROM_OFFSET        = 0x%x (%d)\n", CONFIG_SYS_PROM_OFFSET,
 	       CONFIG_SYS_PROM_SIZE);
-	printf("CONFIG_SYS_GBL_DATA_OFFSET    = 0x%lx (%d)\n", CONFIG_SYS_GBL_DATA_OFFSET,
+	printf("CONFIG_SYS_GBL_DATA_OFFSET    = 0x%x (%d)\n", CONFIG_SYS_GBL_DATA_OFFSET,
 	       GENERATED_GBL_DATA_SIZE);
 
 #if defined(CONFIG_CMD_NET)
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 2/3 dm: sparc: common: Fixup cmd_bdinfo warnings

Quoted 10 lines · Marek Vasut

cmd_bdinfo.c: In function ???do_bdinfo???:
cmd_bdinfo.c:220:9: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???int??? [-Wformat] cmd_bdinfo.c:222:9: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???int??? [-Wformat] cmd_bdinfo.c:224:9: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???int??? [-Wformat] cmd_bdinfo.c:226:9: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???int??? [-Wformat] cmd_bdinfo.c:228:9: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???int??? [-Wformat]

Cc Daniel Hellstrom <[email protected]>
Cc u-boot-dm at lists.denx.de

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120918/80ef0aa8/attachment.pgp>
#4 lore raw

PATCH 3/3 dm: sparc: Fixup the compile warnings in sparc code

In reply to Marek Vasut
Cc Daniel Hellstrom <[email protected]>
Cc u-boot-dm at lists.denx.de
---
 arch/sparc/cpu/leon2/interrupts.c |    6 +++---
 arch/sparc/cpu/leon3/interrupts.c |    6 +++---
 arch/sparc/lib/board.c            |    1 -
 3 files changed, 6 insertions(+), 7 deletions(-)
arch/sparc/cpu/leon2/interrupts.c +3 -3
index 5149550..f707efd 100644
@@ -207,9 +207,9 @@ void do_irqinfo(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char * const a
 
 	for (irq = 0; irq < NR_IRQS; irq++) {
 		if (irq_handlers[irq].handler != NULL) {
-			printf("%02d  %08lx  %08lx  %ld\n", irq,
-			       (unsigned int)irq_handlers[irq].handler,
-			       (unsigned int)irq_handlers[irq].arg,
+			printf("%02d  %p  %p  %d\n", irq,
+			       irq_handlers[irq].handler,
+			       irq_handlers[irq].arg,
 			       irq_handlers[irq].count);
 		}
 	}
arch/sparc/cpu/leon3/interrupts.c +3 -3
index 4138f9b..4a3847d 100644
@@ -209,9 +209,9 @@ void do_irqinfo(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char * const a
 
 	for (irq = 0; irq < NR_IRQS; irq++) {
 		if (irq_handlers[irq].handler != NULL) {
-			printf("%02d  %08lx  %08lx  %ld\n", irq,
-			       (unsigned int)irq_handlers[irq].handler,
-			       (unsigned int)irq_handlers[irq].arg,
+			printf("%02d  %p  %p  %d\n", irq,
+			       irq_handlers[irq].handler,
+			       irq_handlers[irq].arg,
 			       irq_handlers[irq].count);
 		}
 	}
arch/sparc/lib/board.c +0 -1
index 7e48775..6f33666 100644
@@ -166,7 +166,6 @@ char *str_init_seq_done = "\n\rInit sequence done...\r\n\r\n";
 void board_init_f(ulong bootflag)
 {
 	bd_t *bd;
-	unsigned char *s;
 	init_fnc_t **init_fnc_ptr;
 	int j;
 
Signature · 1 line
1.7.10.4
#5 lore raw

PATCH 3/3 dm: sparc: Fixup the compile warnings in sparc code

Quoted 3 lines · Marek Vasut
Cc Daniel Hellstrom <[email protected]>
Cc u-boot-dm at lists.denx.de

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120918/14fcae68/attachment.pgp>
#6 lore raw

PATCH 1/3 dm: sparc: net: Fixup greth compile warnings

In reply to Marek Vasut
Quoted 9 lines · Marek Vasut

greth.c: In function ???greth_recv???:
greth.c:507:3: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???unsigned int??? [-Wformat] greth.c:507:3: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 3 has type ???unsigned int??? [-Wformat] greth.c:541:6: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
greth.c: In function ???greth_initialize???:
greth.c:623:2: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???struct greth_regs *??? [-Wformat] greth.c:655:3: warning: format ???%x??? expects argument of type ???unsigned int???, but argument 2 has type ???struct greth_regs *??? [-Wformat] greth.c:684:2: warning: format ???%x??? expects argument of type ???unsigned int???, but argument 2 has type ???struct greth_regs *??? [-Wformat]

Quoted 4 lines
Cc Joe Hershberger <[email protected]>
Cc Daniel Hellstrom <[email protected]>
Cc u-boot-dm at lists.denx.de

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120918/2dea6601/attachment.pgp>
#7 lore raw

PATCH 1/3 dm: sparc: net: Fixup greth compile warnings

Dear Tom Rini,

Quoted 17 lines · Marek Vasut
Quoted 16 lines

greth.c: In function ???greth_recv???:
greth.c:507:3: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???unsigned int??? [-Wformat] greth.c:507:3: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 3 has type ???unsigned int??? [-Wformat] greth.c:541:6: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] greth.c: In function ???greth_initialize???:
greth.c:623:2: warning: format ???%lx??? expects argument of type ???long unsigned int???, but argument 2 has type ???struct greth_regs *??? [-Wformat] greth.c:655:3: warning: format ???%x??? expects argument of type ???unsigned int???, but argument 2 has type ???struct greth_regs *??? [-Wformat] greth.c:684:2: warning: format ???%x??? expects argument of type ???unsigned int???, but argument 2 has type ???struct greth_regs *??? [-Wformat]

Quoted 6 lines
Quoted 4 lines
Cc Joe Hershberger <[email protected]>
Cc Daniel Hellstrom <[email protected]>
Cc u-boot-dm at lists.denx.de

Applied to u-boot/master, thanks!

I wonder if we shouldn't throw all that sparc crap away ... same with m68k. It's starting to rot, noone uses it anymore anyway.

Best regards,
Marek Vasut