Skip to contentSkip to conversation

CLEANUP: Cleanup of drivers/ directory

PATCH New Marek Vasut 3 participants 44 messages Oct 25, 2011 – Oct 31, 2011

Subsystems (12)
Network drivers USB Block layer PCI +8 more subsystems
lore
Share & tools
lore
#0 lore raw

cover CLEANUP: Cleanup of drivers/ directory

This series fixes the warnings generated by new debug() macro implementation, which will be merged after this series. This series fixes the problems before the macro is reworked to avoid smooth transition. Most of the problems fixed by this series are printf() formating related problems.

Marek Vasut (18):
GCC4.6: Squash warning in cfb_console.c
GCC4.6: Squash warning in cfi_flash.c
GCC4.6: Squash warning in jedec_flash.c
GCC4.6: Squash warnings in 4xx_enet.c
GCC4.6: Squash warnings in ahci.c
GCC4.6: Squash warnings in fsl_espi.c
GCC4.6: Squash warnings in fsl_pci_init.c GCC4.6: Squash warnings in sata_sil3114.c GCC4.6: Squash warnings in tqm8xx_pcmcia.c GCC4.6: Squash error in pcmcia/i82365.c
GCC4.6: Fix warnings in pxa_mmc.c
GCC4.6: Squash warnings in smsc95xx.c
GCC4.6: Squash warnings in kirkwood_spi.c GCC4.6: Squash warnings in lattice.c
GCC4.6: Squash warnings in ks8695eth.c
GCC4.6: Squash warning in bus_vcxk.c
GCC4.6: Squash warnings in fec_mxc.c
GCC4.6: Use debug() instead of debugX() in s3c24xx_nand.c

 drivers/block/ahci.c            |    2 +-
 drivers/block/sata_sil3114.c    |    2 +-
 drivers/fpga/lattice.c          |    2 +-
 drivers/mmc/pxa_mmc.c           |   32 ++++++++++++++++----------------
 drivers/mtd/cfi_flash.c         |    2 +-
 drivers/mtd/jedec_flash.c       |    5 +++--
 drivers/mtd/nand/s3c2410_nand.c |   12 ++++++------
 drivers/net/4xx_enet.c          |    6 +++---
 drivers/net/fec_mxc.c           |    4 ++--
 drivers/net/ks8695eth.c         |    2 +-
 drivers/pci/fsl_pci_init.c      |    8 ++++----
 drivers/pcmcia/i82365.c         |    6 +-----
 drivers/pcmcia/tqm8xx_pcmcia.c  |   15 ++++++++++++---
 drivers/spi/fsl_espi.c          |    6 +++---
 drivers/spi/kirkwood_spi.c      |    4 ++--
 drivers/usb/eth/smsc95xx.c      |    2 +-
 drivers/video/bus_vcxk.c        |    2 +-
 drivers/video/cfb_console.c     |    2 +-
 18 files changed, 60 insertions(+), 54 deletions(-)
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
Signature · 1 line
1.7.6.3
#1 lore raw

PATCH 1/18 GCC4.6: Squash warning in cfb_console.c

cfb_console.c: In function 'video_display_bitmap':
cfb_console.c:1148: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
cfb_console.c:1148: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/video/cfb_console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/cfb_console.c +1 -1
index 4e653b8..1863563 100644
@@ -1152,7 +1152,7 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
 	colors = le32_to_cpu(bmp->header.colors_used);
 	compression = le32_to_cpu(bmp->header.compression);
 
-	debug("Display-bmp: %d x %d  with %d colors\n",
+	debug("Display-bmp: %ld x %ld  with %d colors\n",
 	      width, height, colors);
 
 	if (compression != BMP_BI_RGB
Signature · 1 line
1.7.6.3
#2 lore raw

PATCH 1/18 GCC4.6: Squash warning in cfb_console.c

Dear Marek Vasut,

Quoted 6 lines · In message <[email protected]> you wrote:

cfb_console.c: In function 'video_display_bitmap':
cfb_console.c:1148: warning: format '%d' expects type 'int', but argument 2 has type 'long unsigned int'
cfb_console.c:1148: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/video/cfb_console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It would be illogical to kill without reason
	-- Spock, "Journey to Babel", stardate 3842.4
#3 lore raw

PATCH 2/18 GCC4.6: Squash warning in cfi_flash.c

In reply to Marek Vasut

cfi_flash.c: In function 'flash_protect_default':
cfi_flash.c:2152: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'ulong'
cfi_flash.c:2152: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Scott Wood <[email protected]>
---
 drivers/mtd/cfi_flash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/cfi_flash.c +1 -1
index ac91dfd..5494bcf 100644
@@ -2149,7 +2149,7 @@ void flash_protect_default(void)
 
 #if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
 	for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) {
-		debug("autoprotecting from %08x to %08x\n",
+		debug("autoprotecting from %08lx to %08lx\n",
 		      apl[i].start, apl[i].start + apl[i].size - 1);
 		flash_protect(FLAG_PROTECT_SET,
 			       apl[i].start,
Signature · 1 line
1.7.6.3
#4 lore raw

PATCH 2/18 GCC4.6: Squash warning in cfi_flash.c

Dear Marek Vasut,

Quoted 6 lines · In message <[email protected]> you wrote:

cfi_flash.c: In function 'flash_protect_default':
cfi_flash.c:2152: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'ulong'
cfi_flash.c:2152: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'long unsigned int'

Quoted 8 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Scott Wood <[email protected]>
---
 drivers/mtd/cfi_flash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The algorithm to do that is extremely nasty. You might want  to  mug
someone with it."                   - M. Devine, Computer Science 340
#5 lore raw

PATCH 3/18 GCC4.6: Squash warning in jedec_flash.c

In reply to Marek Vasut

jedec_flash.c: In function 'fill_info':
jedec_flash.c:393: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'ulong'
jedec_flash.c:393: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'ulong'
jedec_flash.c:402: warning: format '%d' expects type 'int', but argument 2 has type 'ulong'
jedec_flash.c:402: warning: format '%d' expects type 'int', but argument 3 has type 'ulong'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Scott Wood <[email protected]>
---
 drivers/mtd/jedec_flash.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/mtd/jedec_flash.c +3 -2
index da8c9b1..36d30c3 100644
@@ -390,7 +390,8 @@ static inline void fill_info(flash_info_t *info, const struct amd_flash_info *je
 	debug("unlock address index %d\n", uaddr_idx);
 	info->addr_unlock1 = unlock_addrs[uaddr_idx].addr1;
 	info->addr_unlock2 = unlock_addrs[uaddr_idx].addr2;
-	debug("unlock addresses are 0x%x/0x%x\n", info->addr_unlock1, info->addr_unlock2);
+	debug("unlock addresses are 0x%lx/0x%lx\n",
+		info->addr_unlock1, info->addr_unlock2);
 
 	sect_cnt = 0;
 	total_size = 0;
@@ -399,7 +400,7 @@ static inline void fill_info(flash_info_t *info, const struct amd_flash_info *je
 		ulong erase_region_count = (jedec_entry->regions[i] & 0xff) + 1;
 
 		total_size += erase_region_size * erase_region_count;
-		debug ("erase_region_count = %d erase_region_size = %d\n",
+		debug("erase_region_count = %ld erase_region_size = %ld\n",
 		       erase_region_count, erase_region_size);
 		for (j = 0; j < erase_region_count; j++) {
 			if (sect_cnt >= CONFIG_SYS_MAX_FLASH_SECT) {
Signature · 1 line
1.7.6.3
#6 lore raw

PATCH 3/18 GCC4.6: Squash warning in jedec_flash.c

Dear Marek Vasut,

Quoted 10 lines · In message <[email protected]> you wrote:

jedec_flash.c: In function 'fill_info':
jedec_flash.c:393: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'ulong'
jedec_flash.c:393: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'ulong'
jedec_flash.c:402: warning: format '%d' expects type 'int', but argument 2 has type 'ulong'
jedec_flash.c:402: warning: format '%d' expects type 'int', but argument 3 has type 'ulong'

Quoted 8 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Scott Wood <[email protected]>
---
 drivers/mtd/jedec_flash.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 9 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
8) Use common sense in routing  cable.  Avoid  wrapping  coax  around
   sources  of  strong  electric  or magnetic fields. Do not wrap the
   cable  around  flourescent  light  ballasts  or  cyclotrons,   for
   example.
- Ethernet Headstart Product, Information and Installation Guide,
   Bell Technologies, pg. 11
#7 lore raw

PATCH 4/18 GCC4.6: Squash warnings in 4xx_enet.c

In reply to Marek Vasut

4xx_enet.c: In function 'ppc_4xx_eth_init':
4xx_enet.c:1352: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'volatile struct mal_desc_t *' 4xx_enet.c:1352: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'volatile struct mal_desc_t *' 4xx_enet.c:1365: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'unsigned int'
4xx_enet.c:1376: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'unsigned int'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/net/4xx_enet.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/4xx_enet.c +3 -3
index 9ab5c80..8013ad9 100644
@@ -1349,7 +1349,7 @@ get_speed:
 		hw_p->rx_phys = bd_cached + MAL_TX_DESC_SIZE;
 		hw_p->tx = (mal_desc_t *)(bd_uncached);
 		hw_p->rx = (mal_desc_t *)(bd_uncached + MAL_TX_DESC_SIZE);
-		debug("hw_p->tx=%08x, hw_p->rx=%08x\n", hw_p->tx, hw_p->rx);
+		debug("hw_p->tx=%p, hw_p->rx=%p\n", hw_p->tx, hw_p->rx);
 	}
 
 	for (i = 0; i < NUM_TX_BUFF; i++) {
@@ -1362,7 +1362,7 @@ get_speed:
 		if ((NUM_TX_BUFF - 1) == i)
 			hw_p->tx[i].ctrl |= MAL_TX_CTRL_WRAP;
 		hw_p->tx_run[i] = -1;
-		debug("TX_BUFF %d @ 0x%08lx\n", i, (u32)hw_p->tx[i].data_ptr);
+		debug("TX_BUFF %d @ 0x%08x\n", i, (u32)hw_p->tx[i].data_ptr);
 	}
 
 	for (i = 0; i < NUM_RX_BUFF; i++) {
@@ -1373,7 +1373,7 @@ get_speed:
 			hw_p->rx[i].ctrl |= MAL_RX_CTRL_WRAP;
 		hw_p->rx[i].ctrl |= MAL_RX_CTRL_EMPTY | MAL_RX_CTRL_INTR;
 		hw_p->rx_ready[i] = -1;
-		debug("RX_BUFF %d @ 0x%08lx\n", i, (u32)hw_p->rx[i].data_ptr);
+		debug("RX_BUFF %d @ 0x%08x\n", i, (u32)hw_p->rx[i].data_ptr);
 	}
 
 	reg = 0x00000000;
Signature · 1 line
1.7.6.3
#8 lore raw

PATCH 4/18 GCC4.6: Squash warnings in 4xx_enet.c

Dear Marek Vasut,

Quoted 10 lines · In message <[email protected]> you wrote:

4xx_enet.c: In function 'ppc_4xx_eth_init':
4xx_enet.c:1352: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'volatile struct mal_desc_t *' 4xx_enet.c:1352: warning: format '%08x' expects type 'unsigned int', but argument 3 has type 'volatile struct mal_desc_t *' 4xx_enet.c:1365: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'unsigned int'
4xx_enet.c:1376: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'unsigned int'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/net/4xx_enet.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
One essential to success is that you desire be an all-obsessing  one,
your thoughts and aims be co-ordinated, and your energy be concentra-
ted and applied without letup.
#9 lore raw

PATCH 5/18 GCC4.6: Squash warnings in ahci.c

In reply to Marek Vasut

ahci.c: In function 'ahci_port_start':
ahci.c:401: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct ahci_cmd_hdr *'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/block/ahci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/ahci.c +1 -1
index 64f52bb..015b341 100644
@@ -398,7 +398,7 @@ static int ahci_port_start(u8 port)
 	 * 32 bytes each in size
 	 */
 	pp->cmd_slot = (struct ahci_cmd_hdr *)mem;
-	debug("cmd_slot = 0x%x\n", pp->cmd_slot);
+	debug("cmd_slot = %p\n", pp->cmd_slot);
 	mem += (AHCI_CMD_SLOT_SZ + 224);
 
 	/*
Signature · 1 line
1.7.6.3
#10 lore raw

PATCH 5/18 GCC4.6: Squash warnings in ahci.c

Dear Marek Vasut,

Quoted 11 lines · In message <[email protected]> you wrote:

ahci.c: In function 'ahci_port_start':
ahci.c:401: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'struct ahci_cmd_hdr *'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/block/ahci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I'm not a god, I was misquoted."                 - Lister, Red Dwarf
#11 lore raw

PATCH 6/18 GCC4.6: Squash warnings in fsl_espi.c

In reply to Marek Vasut

fsl_espi.c: In function 'spi_setup_slave':
fsl_espi.c:100: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
fsl_espi.c: In function 'spi_xfer':
fsl_espi.c:237: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'const void *'
fsl_espi.c:237: warning: format '%08x' expects type 'unsigned int', but argument 7 has type 'void *'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/spi/fsl_espi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/spi/fsl_espi.c +3 -3
index f872cd8..a1ebd33 100644
@@ -97,8 +97,8 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 		pm = spibrg / (max_hz * 16 * 2);
 		if (pm > 16) {
 			pm = 16;
-			debug("Requested speed is too low: %d Hz, "
-				"%d Hz is used.\n", max_hz, spibrg / (32 * 16));
+			debug("Requested speed is too low: %d Hz, %ld Hz "
+				"is used.\n", max_hz, spibrg / (32 * 16));
 		}
 	} else
 		pm = spibrg / (max_hz * 2);
@@ -234,7 +234,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
 		break;
 	}
 
-	debug("spi_xfer: slave %u:%u dout %08X(%08x) din %08X(%08x) len %u\n",
+	debug("spi_xfer: slave %u:%u dout %08X(%p) din %08X(%p) len %u\n",
 	      slave->bus, slave->cs, *(uint *) dout,
 	      dout, *(uint *) din, din, len);
 
Signature · 1 line
1.7.6.3
#12 lore raw

PATCH 6/18 GCC4.6: Squash warnings in fsl_espi.c

Dear Marek Vasut,

Quoted 9 lines · In message <[email protected]> you wrote:

fsl_espi.c: In function 'spi_setup_slave':
fsl_espi.c:100: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
fsl_espi.c: In function 'spi_xfer':
fsl_espi.c:237: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'const void *'
fsl_espi.c:237: warning: format '%08x' expects type 'unsigned int', but argument 7 has type 'void *'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/spi/fsl_espi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If you think the problem is bad now, just wait until we've solved it.
                                                        Epstein's Law
#13 lore raw

PATCH 7/18 GCC4.6: Squash warnings in fsl_pci_init.c

In reply to Marek Vasut

fsl_pci_init.c: In function 'fsl_pci_init':
fsl_pci_init.c:308: warning: format '%08x' expects type 'unsigned int', but argument 6 has type 'long unsigned int'
fsl_pci_init.c:347: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'volatile u32 *'

fsl_pci_init.c: In function 'fsl_pci_init':
fsl_pci_init.c:308: warning: format '%016llx' expects type 'long long unsigned int', but argument 4 has type 'pci_addr_t'
fsl_pci_init.c:308: warning: format '%016llx' expects type 'long long unsigned int', but argument 5 has type 'pci_size_t'
fsl_pci_init.c:308: warning: format '%08x' expects type 'unsigned int', but argument 6 has type 'long unsigned int'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/pci/fsl_pci_init.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/pci/fsl_pci_init.c +4 -4
index 7f601d4..bff1314 100644
@@ -305,10 +305,10 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
 	inbound = fsl_pci_setup_inbound_windows(hose, out_lo, pcie_cap, pi);
 
 	for (r = 0; r < hose->region_count; r++)
-		debug("PCI reg:%d %016llx:%016llx %016llx %08x\n", r,
+		debug("PCI reg:%d %016llx:%016llx %016llx %08lx\n", r,
 			(u64)hose->regions[r].phys_start,
-			hose->regions[r].bus_start,
-			hose->regions[r].size,
+			(u64)hose->regions[r].bus_start,
+			(u64)hose->regions[r].size,
 			hose->regions[r].flags);
 
 	pci_register_hose(hose);
@@ -344,7 +344,7 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
 			setbits_be32(&pci->pdb_stat, 0x08000000);
 			(void) in_be32(&pci->pdb_stat);
 			udelay(100);
-			debug("  Asserting PCIe reset @%x = %x\n",
+			debug("  Asserting PCIe reset @%p = %x\n",
 			      &pci->pdb_stat, in_be32(&pci->pdb_stat));
 			/* clear PCIe reset */
 			clrbits_be32(&pci->pdb_stat, 0x08000000);
Signature · 1 line
1.7.6.3
#14 lore raw

PATCH 7/18 GCC4.6: Squash warnings in fsl_pci_init.c

Dear Marek Vasut,

Quoted 14 lines · In message <[email protected]> you wrote:

fsl_pci_init.c: In function 'fsl_pci_init':
fsl_pci_init.c:308: warning: format '%08x' expects type 'unsigned int', but argument 6 has type 'long unsigned int'
fsl_pci_init.c:347: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'volatile u32 *'

fsl_pci_init.c: In function 'fsl_pci_init':
fsl_pci_init.c:308: warning: format '%016llx' expects type 'long long unsigned int', but argument 4 has type 'pci_addr_t'
fsl_pci_init.c:308: warning: format '%016llx' expects type 'long long unsigned int', but argument 5 has type 'pci_size_t'
fsl_pci_init.c:308: warning: format '%08x' expects type 'unsigned int', but argument 6 has type 'long unsigned int'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/pci/fsl_pci_init.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
... The prejudices people feel about each other disappear  when  then
get to know each other.
	-- Kirk, "Elaan of Troyius", stardate 4372.5
#15 lore raw

PATCH 8/18 GCC4.6: Squash warnings in sata_sil3114.c

In reply to Marek Vasut

sata_sil3114.c: In function 'sata_identify':
sata_sil3114.c:174: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'lbaint_t'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/block/sata_sil3114.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/sata_sil3114.c +1 -1
index d43064e..1e60636 100644
@@ -171,7 +171,7 @@ static void sata_identify (int num, int dev)
 	sata_dev_desc[devno].removable = 0;
 
 	sata_dev_desc[devno].lba = (u32) n_sectors;
-	debug ("lba=0x%x\n", sata_dev_desc[devno].lba);
+	debug("lba=0x%lx\n", sata_dev_desc[devno].lba);
 
 #ifdef CONFIG_LBA48
 	if (iobuf[83] & (1 << 10)) {
Signature · 1 line
1.7.6.3
#16 lore raw

PATCH 8/18 GCC4.6: Squash warnings in sata_sil3114.c

Dear Marek Vasut,

Quoted 11 lines · In message <[email protected]> you wrote:

sata_sil3114.c: In function 'sata_identify':
sata_sil3114.c:174: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'lbaint_t'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/block/sata_sil3114.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The trouble with doing something right the first time is that nobody
appreciates how difficult it was."                        - Walt West
#17 lore raw

PATCH 9/18 GCC4.6: Squash warnings in tqm8xx_pcmcia.c

In reply to Marek Vasut

tqm8xx_pcmcia.c: In function 'power_off':
tqm8xx_pcmcia.c:46: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast
tqm8xx_pcmcia.c: In function 'power_on_5_0':
tqm8xx_pcmcia.c:52: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast
tqm8xx_pcmcia.c: In function 'power_on_3_3':
tqm8xx_pcmcia.c:58: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/pcmcia/tqm8xx_pcmcia.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
drivers/pcmcia/tqm8xx_pcmcia.c +12 -3
index 859cbe0..dda7d37 100644
@@ -43,19 +43,28 @@ static inline void power_config(int slot) {}
 
 static inline void power_off(int slot)
 {
-	out_be32(PCMCIA_CTRL, 0);
+	volatile unsigned __iomem *addr;
+	addr = (volatile unsigned __iomem *)PCMCIA_CTRL;
+
+	out_be32(addr, 0);
 }
 
 static inline void power_on_5_0(int slot)
 {
+	volatile unsigned __iomem *addr;
+	addr = (volatile unsigned __iomem *)PCMCIA_CTRL;
+
 	/* Enable 5V Vccout */
-	out_be32(PCMCIA_CTRL, 2);
+	out_be32(addr, 2);
 }
 
 static inline void power_on_3_3(int slot)
 {
+	volatile unsigned __iomem *addr;
+	addr = (volatile unsigned __iomem *)PCMCIA_CTRL;
+
 	/* Enable 3.3V Vccout */
-	out_be32(PCMCIA_CTRL, 1);
+	out_be32(addr, 1);
 }
 
 #else
Signature · 1 line
1.7.6.3
#18 lore raw

PATCH 9/18 GCC4.6: Squash warnings in tqm8xx_pcmcia.c

Dear Marek Vasut,

Quoted 10 lines · In message <[email protected]> you wrote:

tqm8xx_pcmcia.c: In function 'power_off':
tqm8xx_pcmcia.c:46: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast
tqm8xx_pcmcia.c: In function 'power_on_5_0':
tqm8xx_pcmcia.c:52: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast
tqm8xx_pcmcia.c: In function 'power_on_3_3':
tqm8xx_pcmcia.c:58: warning: passing argument 1 of 'out_be32' makes pointer from integer without a cast

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/pcmcia/tqm8xx_pcmcia.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Maintain an awareness for contribution --  to  your  schedule,  your
project, our company."                         - A Group of Employees
#19 lore raw

PATCH 10/18 GCC4.6: Squash error in pcmcia/i82365.c

In reply to Marek Vasut

i82365.c: In function 'cirrus_set_opts':
i82365.c:329: error: 'buf' undeclared (first use in this function) i82365.c:329: error: (Each undeclared identifier is reported only once i82365.c:329: error: for each function it appears in.)

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/pcmcia/i82365.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/pcmcia/i82365.c +1 -5
index 1bcb3a5..1cde83a 100644
@@ -272,11 +272,7 @@ static u_int cirrus_set_opts (socket_info_t * s)
 {
 	cirrus_state_t *p = &s->c_state;
 	u_int mask = 0xffff;
-#if DEBUG
-	char buf[200];
-
-	memset (buf, 0, 200);
-#endif
+	char buf[200] = {0};
 
 	if (has_ring == -1)
 		has_ring = 1;
Signature · 1 line
1.7.6.3
#20 lore raw

PATCH 10/18 GCC4.6: Squash error in pcmcia/i82365.c

Dear Marek Vasut,

Quoted 5 lines · In message <[email protected]> you wrote:

i82365.c: In function 'cirrus_set_opts':
i82365.c:329: error: 'buf' undeclared (first use in this function) i82365.c:329: error: (Each undeclared identifier is reported only once i82365.c:329: error: for each function it appears in.)

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/pcmcia/i82365.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Spock, did you see the looks on their faces?"
"Yes, Captain, a sort of vacant contentment."
#21 lore raw

PATCH 11/18 GCC4.6: Fix warnings in pxa_mmc.c

In reply to Marek Vasut

pxa_mmc.c: In function 'mmc_cmd':
pxa_mmc.c:77:2: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'ulong'
pxa_mmc.c: In function 'mmc_block_read':
pxa_mmc.c:110:2: warning: format '%d' expects type 'int', but argument 4 has type 'ulong'
pxa_mmc.c: In function 'pxa_mmc_write':
pxa_mmc.c:327:2: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'
pxa_mmc.c:349:2: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'
pxa_mmc.c:354:3: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'
pxa_mmc.c:362:2: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'
pxa_mmc.c:367:3: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/mmc/pxa_mmc.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)
drivers/mmc/pxa_mmc.c +16 -16
index 48e21ef..3c2905c 100644
@@ -55,7 +55,7 @@ mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat)
 /****************************************************/
 {
 	static uint32_t resp[4], a, b, c;
-	ulong status;
+	uint32_t status;
 	int i;
 
 	debug("mmc_cmd %u 0x%04x 0x%04x 0x%04x\n", cmd, argh, argl,
@@ -97,7 +97,7 @@ mmc_cmd(ushort cmd, ushort argh, ushort argl, ushort cmdat)
 
 int
 /****************************************************/
-mmc_block_read(uchar * dst, ulong src, ulong len)
+mmc_block_read(uchar * dst, uint32_t src, int len)
 /****************************************************/
 {
 	ushort argh, argl;
@@ -107,7 +107,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len)
 		return 0;
 	}
 
-	debug("mmc_block_rd dst %lx src %lx len %d\n", (ulong) dst, src, len);
+	debug("mmc_block_rd dst %p src %08x len %d\n", dst, src, len);
 
 	argh = len >> 16;
 	argl = len & 0xffff;
@@ -298,7 +298,7 @@ pxa_mmc_read(long src, uchar * dst, int size)
 
 int
 /****************************************************/
-pxa_mmc_write(uchar * src, ulong dst, int size)
+pxa_mmc_write(uchar * src, uint32_t dst, int size)
 /****************************************************/
 {
 	ulong end, part_start, part_end, part_len, aligned_start, aligned_end;
@@ -325,14 +325,14 @@ pxa_mmc_write(uchar * src, ulong dst, int size)
 
 	/* all block aligned accesses */
 	debug
-	    ("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
-	     src, (ulong) dst, end, part_start, part_end, aligned_start,
+	    ("src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+	     src, dst, end, part_start, part_end, aligned_start,
 	     aligned_end);
 	if (part_start) {
 		part_len = mmc_block_size - part_start;
 		debug
-		    ("ps src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
-		     (ulong) src, dst, end, part_start, part_end, aligned_start,
+		    ("ps src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+		     src, dst, end, part_start, part_end, aligned_start,
 		     aligned_end);
 		if ((mmc_block_read(mmc_buf, aligned_start, mmc_block_size)) <
 		    0) {
@@ -347,26 +347,26 @@ pxa_mmc_write(uchar * src, ulong dst, int size)
 		src += part_len;
 	}
 	debug
-	    ("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
-	     src, (ulong) dst, end, part_start, part_end, aligned_start,
+	    ("src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+	     src, dst, end, part_start, part_end, aligned_start,
 	     aligned_end);
 	for (; dst < aligned_end; src += mmc_block_size, dst += mmc_block_size) {
 		debug
-		    ("al src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
-		     src, (ulong) dst, end, part_start, part_end, aligned_start,
+		    ("al src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+		     src, dst, end, part_start, part_end, aligned_start,
 		     aligned_end);
 		if ((mmc_block_write(dst, (uchar *) src, mmc_block_size)) < 0) {
 			return -1;
 		}
 	}
 	debug
-	    ("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
-	     src, (ulong) dst, end, part_start, part_end, aligned_start,
+	    ("src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+	     src, dst, end, part_start, part_end, aligned_start,
 	     aligned_end);
 	if (part_end && dst < end) {
 		debug
-		    ("pe src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
-		     src, (ulong) dst, end, part_start, part_end, aligned_start,
+		    ("pe src %p dst %08x end %lx pstart %lx pend %lx astart %lx aend %lx\n",
+		     src, dst, end, part_start, part_end, aligned_start,
 		     aligned_end);
 		if ((mmc_block_read(mmc_buf, aligned_end, mmc_block_size)) < 0) {
 			return -1;
Signature · 1 line
1.7.6.3
#22 lore raw

PATCH 11/18 GCC4.6: Fix warnings in pxa_mmc.c

Dear Marek Vasut,

Quoted 18 lines · In message <[email protected]> you wrote:

pxa_mmc.c: In function 'mmc_cmd':
pxa_mmc.c:77:2: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'ulong'
pxa_mmc.c: In function 'mmc_block_read':
pxa_mmc.c:110:2: warning: format '%d' expects type 'int', but argument 4 has type 'ulong'
pxa_mmc.c: In function 'pxa_mmc_write':
pxa_mmc.c:327:2: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'
pxa_mmc.c:349:2: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'
pxa_mmc.c:354:3: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'
pxa_mmc.c:362:2: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'
pxa_mmc.c:367:3: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'uchar *'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/mmc/pxa_mmc.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The best things in life are for a fee.
#23 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

In reply to Marek Vasut

smsc95xx.c: In function 'smsc95xx_write_hwaddr':
smsc95xx.c:380:2: warning: dereferencing type-punned pointer will break strict-aliasing rules

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/usb/eth/smsc95xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/eth/smsc95xx.c +1 -1
index 97f2729..7ee4f87 100644
@@ -377,7 +377,7 @@ static int smsc95xx_write_hwaddr(struct eth_device *eth)
 
 	/* set hardware address */
 	debug("** %s()\n", __func__);
-	addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
+	addr_lo = cpu_to_le32(*eth->enetaddr);
 	addr_hi = cpu_to_le16(*((u16 *)(eth->enetaddr + 4)));
 	ret = smsc95xx_write_reg(dev, ADDRL, addr_lo);
 	if (ret < 0) {
Signature · 1 line
1.7.6.3
#24 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

Dear Marek Vasut,

Quoted 11 lines · In message <[email protected]> you wrote:

smsc95xx.c: In function 'smsc95xx_write_hwaddr':
smsc95xx.c:380:2: warning: dereferencing type-punned pointer will break strict-aliasing rules

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/usb/eth/smsc95xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
grep me no patterns and I'll tell you no lines.
#25 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

In reply to Marek Vasut

drivers/usb/eth/smsc95xx.c static int smsc95xx_write_hwaddr(struct eth_device *eth) · line 380

Quoted 5 lines · On Tuesday 25 October 2011 05:39:58 Marek Vasut wrote:
drivers/usb/eth/smsc95xx.c +1 -1
 
-	addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
+	addr_lo = cpu_to_le32(*eth->enetaddr);

pretty sure this is wrong. enetaddr is a uchar[], so your code now reads only 1 byte instead of 4.

that said, this code also seems to not be endian safe ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111030/e9c7082c/attachment.pgp

#26 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

Quoted 12 lines · On Tuesday 25 October 2011 05:39:58 Marek Vasut wrote:

drivers/usb/eth/smsc95xx.c static int smsc95xx_write_hwaddr(struct eth_device *eth) · line 380

Quoted 5 lines
drivers/usb/eth/smsc95xx.c +1 -1
 
-	addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
+	addr_lo = cpu_to_le32(*eth->enetaddr);

pretty sure this is wrong. enetaddr is a uchar[], so your code now reads only 1 byte instead of 4.

that said, this code also seems to not be endian safe ... -mike

It's good anyone actually cares to properly review. Anyway, why does noone actually care to fix all the damn warnings in their drivers before submitting them in the first place ?!

#27 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

Dear Marek Vasut,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 7 lines

drivers/usb/eth/smsc95xx.c static int smsc95xx_write_hwaddr(struct eth_device *eth) · line 380

Quoted 3 lines
drivers/usb/eth/smsc95xx.c +1 -1
-	addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
+	addr_lo = cpu_to_le32(*eth->enetaddr);

pretty sure this is wrong. enetaddr is a uchar[], so your code now reads only 1 byte instead of 4.

Quoted 6 lines
Quoted 2 lines

that said, this code also seems to not be endian safe ... -mike

It's good anyone actually cares to properly review. Anyway, why does noone actually care to fix all the damn warnings in their drivers before submitting them in the first place ?!

GCC 4.6 has not been around that long. Many people use less bleading-edge tool chains - for a good reason.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Whenever people agree with me, I always think I must be wrong.
- Oscar Wilde
#28 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

Quoted 12 lines

Dear Marek Vasut,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 8 lines

drivers/usb/eth/smsc95xx.c static int smsc95xx_write_hwaddr(struct eth_device *eth) · line 380

Quoted 2 lines
drivers/usb/eth/smsc95xx.c +1 -1
-	addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
+	addr_lo = cpu_to_le32(*eth->enetaddr);

pretty sure this is wrong. enetaddr is a uchar[], so your code now reads only 1 byte instead of 4.

that said, this code also seems to not be endian safe ... -mike

Quoted 6 lines
Quoted 3 lines

It's good anyone actually cares to properly review. Anyway, why does noone actually care to fix all the damn warnings in their drivers before submitting them in the first place ?!

GCC 4.6 has not been around that long. Many people use less bleading-edge tool chains - for a good reason.

The problem is I saw this warning with gcc 4.2 too :-(

Cheers

#29 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

In reply to Marek Vasut
Quoted 10 lines · On Sunday 30 October 2011 16:48:50 Marek Vasut wrote:
Quoted 10 lines · On Tuesday 25 October 2011 05:39:58 Marek Vasut wrote:

drivers/usb/eth/smsc95xx.c static int smsc95xx_write_hwaddr(struct eth_device *eth) · line 380

Quoted 5 lines
drivers/usb/eth/smsc95xx.c +1 -1
 
-	addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
+	addr_lo = cpu_to_le32(*eth->enetaddr);

pretty sure this is wrong. enetaddr is a uchar[], so your code now reads only 1 byte instead of 4.

Quoted 5 lines
Quoted 1 line

that said, this code also seems to not be endian safe ...

It's good anyone actually cares to properly review. Anyway, why does noone actually care to fix all the damn warnings in their drivers before submitting them in the first place ?!

the strict alias warnings you are hitting show up only in newer compilers. so i'm sure at the time of their development/submission, they didn't exist. -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111030/c4ccfb1b/attachment.pgp

#30 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

Quoted 13 lines · On Sunday 30 October 2011 16:48:50 Marek Vasut wrote:
Quoted 12 lines
Quoted 11 lines · On Tuesday 25 October 2011 05:39:58 Marek Vasut wrote:

drivers/usb/eth/smsc95xx.c static int smsc95xx_write_hwaddr(struct eth_device *eth) · line 380

Quoted 5 lines
drivers/usb/eth/smsc95xx.c +1 -1
 
-	addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
+	addr_lo = cpu_to_le32(*eth->enetaddr);

pretty sure this is wrong. enetaddr is a uchar[], so your code now reads only 1 byte instead of 4.

that said, this code also seems to not be endian safe ...

Quoted 7 lines
Quoted 3 lines

It's good anyone actually cares to properly review. Anyway, why does noone actually care to fix all the damn warnings in their drivers before submitting them in the first place ?!

the strict alias warnings you are hitting show up only in newer compilers. so i'm sure at the time of their development/submission, they didn't exist. -mike

This is a different driver than that armada100_fec.c.

#31 lore raw

PATCH 12/18 GCC4.6: Squash warnings in smsc95xx.c

Quoted 17 lines · On Sunday 30 October 2011 19:45:43 Marek Vasut wrote:
Quoted 17 lines · On Sunday 30 October 2011 16:48:50 Marek Vasut wrote:
Quoted 15 lines
Quoted 11 lines · On Tuesday 25 October 2011 05:39:58 Marek Vasut wrote:

drivers/usb/eth/smsc95xx.c static int smsc95xx_write_hwaddr(struct eth_device *eth) · line 380

Quoted 5 lines
drivers/usb/eth/smsc95xx.c +1 -1
 
-	addr_lo = cpu_to_le32(*((u32 *)eth->enetaddr));
+	addr_lo = cpu_to_le32(*eth->enetaddr);

pretty sure this is wrong. enetaddr is a uchar[], so your code now reads only 1 byte instead of 4.

that said, this code also seems to not be endian safe ...

It's good anyone actually cares to properly review. Anyway, why does noone actually care to fix all the damn warnings in their drivers before submitting them in the first place ?!

Quoted 5 lines
Quoted 3 lines

the strict alias warnings you are hitting show up only in newer compilers. so i'm sure at the time of their development/submission, they didn't exist.

This is a different driver than that armada100_fec.c.

ok ? the original 12/18 patch said:
smsc95xx.c: In function 'smsc95xx_write_hwaddr':
smsc95xx.c:380:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111030/1493da06/attachment.pgp

#32 lore raw

PATCH 13/18 GCC4.6: Squash warnings in kirkwood_spi.c

In reply to Marek Vasut

kirkwood_spi.c:125:2: warning: format '%08X' expects type 'unsigned int', but argument 4 has type 'const void *'
kirkwood_spi.c:125:2: warning: format '%08X' expects type 'unsigned int', but argument 5 has type 'void *'
kirkwood_spi.c:160:5: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'void *'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/spi/kirkwood_spi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/spi/kirkwood_spi.c +2 -2
index a1c3070..135895f 100644
@@ -122,7 +122,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
 	unsigned int tmpdout, tmpdin;
 	int tm, isread = 0;
 
-	debug("spi_xfer: slave %u:%u dout %08X din %08X bitlen %u\n",
+	debug("spi_xfer: slave %u:%u dout %p din %p bitlen %u\n",
 	      slave->bus, slave->cs, dout, din, bitlen);
 
 	if (flags & SPI_XFER_BEGIN)
@@ -158,7 +158,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
 				isread = 1;
 				tmpdin = readl(&spireg->din);
 				debug
-					("spi_xfer: din %08x..%08x read\n",
+					("spi_xfer: din %p..%08x read\n",
 					din, tmpdin);
 
 				if (din) {
Signature · 1 line
1.7.6.3
#33 lore raw

PATCH 13/18 GCC4.6: Squash warnings in kirkwood_spi.c

Dear Marek Vasut,

Quoted 7 lines · In message <[email protected]> you wrote:

kirkwood_spi.c:125:2: warning: format '%08X' expects type 'unsigned int', but argument 4 has type 'const void *'
kirkwood_spi.c:125:2: warning: format '%08X' expects type 'unsigned int', but argument 5 has type 'void *'
kirkwood_spi.c:160:5: warning: format '%08x' expects type 'unsigned int', but argument 2 has type 'void *'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/spi/kirkwood_spi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Program maintenance is an entropy-increasing process,  and  even  its
most skilfull execution only delays the subsidence of the system into
unfixable obsolescence.       - Fred Brooks, "The Mythical Man Month"
#34 lore raw

PATCH 14/18 GCC4.6: Squash warnings in lattice.c

In reply to Marek Vasut

lattice.c:319:4: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'const char *'
lattice.c:319:4: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'long unsigned int'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/fpga/lattice.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/fpga/lattice.c +1 -1
index 50d9e54..d8b642a 100644
@@ -317,7 +317,7 @@ int lattice_load(Lattice_desc *desc, const void *buf, size_t bsize)
 			read_bytes = 0;
 			bufsize = bsize;
 			debug("%s: Launching the Lattice ISPVME Loader:"
-				" addr 0x%x size 0x%x...\n",
+				" addr %p size 0x%lx...\n",
 				__func__, fpga_image, bufsize);
 			ret_val = ispVM();
 			if (ret_val)
Signature · 1 line
1.7.6.3
#35 lore raw

PATCH 14/18 GCC4.6: Squash warnings in lattice.c

Dear Marek Vasut,

Quoted 5 lines · In message <[email protected]> you wrote:

lattice.c:319:4: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'const char *'
lattice.c:319:4: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'long unsigned int'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/fpga/lattice.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
8 Catfish                                               = 1 Octo-puss
#36 lore raw

PATCH 15/18 GCC4.6: Squash warnings in ks8695eth.c

In reply to Marek Vasut

ks8695eth.c:199:2: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'volatile void *'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/net/ks8695eth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ks8695eth.c +1 -1
index cd36880..8e988d1 100644
@@ -196,7 +196,7 @@ static int ks8695_eth_send(struct eth_device *dev, volatile void *packet,
 	volatile struct ks8695_txdesc *dp;
 	static int next = 0;
 
-	debug ("%s(%d): eth_send(packet=%x,len=%d)\n", __FILE__, __LINE__,
+	debug ("%s(%d): eth_send(packet=%p,len=%d)\n", __FILE__, __LINE__,
 		packet, len);
 
 	dp = &ks8695_tx[next];
Signature · 1 line
1.7.6.3
#37 lore raw

PATCH 15/18 GCC4.6: Squash warnings in ks8695eth.c

Dear Marek Vasut,

Quoted 10 lines · In message <[email protected]> you wrote:

ks8695eth.c:199:2: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'volatile void *'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/net/ks8695eth.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 9 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Fantasy is like alcohol - too much is bad for you, a little bit makes
the world a better place. Like  an  exercise  bicycle  it  takes  you
nowhere, but it just might tone up the muscles that will. Daydreaming
got  us  where we are today; early in our evolution we learned to let
our minds wander so well that they started coming  back  with  souve-
nirs.   - Terry Pratchett & Stephen Briggs, _The Discworld Companion_
#38 lore raw

PATCH 16/18 GCC4.6: Squash warning in bus_vcxk.c

In reply to Marek Vasut

bus_vcxk.c:167:2: warning: format '%d' expects type 'int', but argument 2 has type 'u_long'
bus_vcxk.c:167:2: warning: format '%d' expects type 'int', but argument 3 has type 'u_long'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/video/bus_vcxk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/video/bus_vcxk.c +1 -1
index 67a59a7..7aecb92 100644
@@ -164,7 +164,7 @@ int vcxk_init(unsigned long width, unsigned long height)
 #else
 	#error CONFIG_SYS_VCXK_DEFAULT_LINEALIGN is invalid
 #endif
-	debug("linesize ((%d + 15) / 8 & ~0x1) = %d\n",
+	debug("linesize ((%ld + 15) / 8 & ~0x1) = %ld\n",
 		display_width, display_bwidth);
 
 #ifdef CONFIG_SYS_VCXK_AUTODETECT
Signature · 1 line
1.7.6.3
#39 lore raw

PATCH 16/18 GCC4.6: Squash warning in bus_vcxk.c

Dear Marek Vasut,

Quoted 5 lines · In message <[email protected]> you wrote:

bus_vcxk.c:167:2: warning: format '%d' expects type 'int', but argument 2 has type 'u_long'
bus_vcxk.c:167:2: warning: format '%d' expects type 'int', but argument 3 has type 'u_long'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/video/bus_vcxk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
core error - bus dumped
#40 lore raw

PATCH 17/18 GCC4.6: Squash warnings in fec_mxc.c

In reply to Marek Vasut

fec_mxc.c: In function 'fec_mii_setspeed':
fec_mxc.c:112:2: warning: format '%#lx' expects type 'long unsigned int', but argument 2 has type 'u32'
fec_mxc.c: In function 'fec_recv':
fec_mxc.c:632:2: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/net/fec_mxc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/fec_mxc.c +2 -2
index cfe2176..0c0c7cd 100644
@@ -109,7 +109,7 @@ static void fec_mii_setspeed(struct fec_priv *fec)
 	 */
 	writel((((imx_get_fecclk() / 1000000) + 2) / 5) << 1,
 			&fec->eth->mii_speed);
-	debug("fec_init: mii_speed %#lx\n",
+	debug("fec_init: mii_speed %08x\n",
 			readl(&fec->eth->mii_speed));
 }
 static int fec_miiphy_write(const char *dev, uint8_t phyAddr, uint8_t regAddr,
@@ -629,7 +629,7 @@ static int fec_recv(struct eth_device *dev)
 	 */
 	ievent = readl(&fec->eth->ievent);
 	writel(ievent, &fec->eth->ievent);
-	debug("fec_recv: ievent 0x%x\n", ievent);
+	debug("fec_recv: ievent 0x%lx\n", ievent);
 	if (ievent & FEC_IEVENT_BABR) {
 		fec_halt(dev);
 		fec_init(dev, fec->bd);
Signature · 1 line
1.7.6.3
#41 lore raw

PATCH 17/18 GCC4.6: Squash warnings in fec_mxc.c

Dear Marek Vasut,

Quoted 7 lines · In message <[email protected]> you wrote:

fec_mxc.c: In function 'fec_mii_setspeed':
fec_mxc.c:112:2: warning: format '%#lx' expects type 'long unsigned int', but argument 2 has type 'u32'
fec_mxc.c: In function 'fec_recv':
fec_mxc.c:632:2: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'

Quoted 7 lines
Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/net/fec_mxc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Yes, it's a technical challenge, and  you  have  to  kind  of  admire
people  who go to the lengths of actually implementing it, but at the
same time you wonder about their IQ...
         --  Linus Torvalds in <[email protected]>
#42 lore raw

PATCH 18/18 GCC4.6: Use debug() instead of debugX() in s3c24xx_nand.c

In reply to Marek Vasut

The debugX() macro was always used with debug level 1. There is no point to use it here instead of debug().

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/mtd/nand/s3c2410_nand.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/mtd/nand/s3c2410_nand.c +6 -6
index 27351fb..e1a459b 100644
@@ -56,7 +56,7 @@ static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
 	struct nand_chip *chip = mtd->priv;
 	struct s3c2410_nand *nand = s3c2410_get_base_nand();
 
-	debugX(1, "hwcontrol(): 0x%02x 0x%02x\n", cmd, ctrl);
+	debug("hwcontrol(): 0x%02x 0x%02x\n", cmd, ctrl);
 
 	if (ctrl & NAND_CTRL_CHANGE) {
 		ulong IO_ADDR_W = (ulong)nand;
@@ -83,7 +83,7 @@ static void s3c2410_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
 static int s3c2410_dev_ready(struct mtd_info *mtd)
 {
 	struct s3c2410_nand *nand = s3c2410_get_base_nand();
-	debugX(1, "dev_ready\n");
+	debug("dev_ready\n");
 	return readl(&nand->nfstat) & 0x01;
 }
 
@@ -91,7 +91,7 @@ static int s3c2410_dev_ready(struct mtd_info *mtd)
 void s3c2410_nand_enable_hwecc(struct mtd_info *mtd, int mode)
 {
 	struct s3c2410_nand *nand = s3c2410_get_base_nand();
-	debugX(1, "s3c2410_nand_enable_hwecc(%p, %d)\n", mtd, mode);
+	debug("s3c2410_nand_enable_hwecc(%p, %d)\n", mtd, mode);
 	writel(readl(&nand->nfconf) | S3C2410_NFCONF_INITECC, &nand->nfconf);
 }
 
@@ -102,7 +102,7 @@ static int s3c2410_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
 	ecc_code[0] = readb(&nand->nfecc);
 	ecc_code[1] = readb(&nand->nfecc + 1);
 	ecc_code[2] = readb(&nand->nfecc + 2);
-	debugX(1, "s3c2410_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n",
+	debug("s3c2410_nand_calculate_hwecc(%p,): 0x%02x 0x%02x 0x%02x\n",
 	       mtd , ecc_code[0], ecc_code[1], ecc_code[2]);
 
 	return 0;
@@ -128,7 +128,7 @@ int board_nand_init(struct nand_chip *nand)
 	struct s3c24x0_clock_power *clk_power = s3c24x0_get_base_clock_power();
 	struct s3c2410_nand *nand_reg = s3c2410_get_base_nand();
 
-	debugX(1, "board_nand_init()\n");
+	debug("board_nand_init()\n");
 
 	writel(readl(&clk_power->clkcon) | (1 << 4), &clk_power->clkcon);
 
@@ -183,7 +183,7 @@ int board_nand_init(struct nand_chip *nand)
 	nand->options = 0;
 #endif
 
-	debugX(1, "end of nand_init\n");
+	debug("end of nand_init\n");
 
 	return 0;
 }
Signature · 1 line
1.7.6.3
#43 lore raw

PATCH 18/18 GCC4.6: Use debug() instead of debugX() in s3c24xx_nand.c

Dear Marek Vasut,

Quoted 10 lines · In message <[email protected]> you wrote:

The debugX() macro was always used with debug level 1. There is no point to use it here instead of debug().

Cc Wolfgang Denk <[email protected]>
Cc Simon Glass <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 drivers/mtd/nand/s3c2410_nand.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Just think, with VLSI we can have 100 ENIACS on a chip!"
- Alan Perlis