public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ATA: Squash warnings in mxc_ata.
@ 2011-09-23  9:12 Marek Vasut
  2011-09-23  9:27 ` Stefano Babic
  2011-09-23  9:42 ` [U-Boot] [PATCH V2] " Marek Vasut
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2011-09-23  9:12 UTC (permalink / raw)
  To: u-boot

mxc_ata.c: In function ?set_ata_bus_timing?:
mxc_ata.c:118: warning: dereferencing type-punned pointer will break
strict-aliasing rules
mxc_ata.c:125: warning: dereferencing type-punned pointer will break
strict-aliasing rules
mxc_ata.c:129: warning: dereferencing type-punned pointer will break
strict-aliasing rules

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 drivers/block/mxc_ata.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/block/mxc_ata.c b/drivers/block/mxc_ata.c
index f22f4f4..d94ec9c 100644
--- a/drivers/block/mxc_ata.c
+++ b/drivers/block/mxc_ata.c
@@ -98,6 +98,7 @@ static void set_ata_bus_timing(unsigned char mode)
 {
 	uint32_t val;
 	uint32_t T = 1000000000 / mxc_get_clock(MXC_IPG_CLK);
+	uint32_t reg;
 
 	struct mxc_ata_config_regs *ata_regs;
 	ata_regs = (struct mxc_ata_config_regs *)CONFIG_SYS_ATA_BASE_ADDR;
@@ -106,22 +107,25 @@ static void set_ata_bus_timing(unsigned char mode)
 		return;
 
 	/* Write TIME_OFF/ON/1/2W */
+	reg = (uint32_t)&ata_regs->time_off;
 	val =	(3 << REG2OFF(&ata_regs->time_off)) |
 		(3 << REG2OFF(&ata_regs->time_on)) |
 		(((pio_t1[mode] + T) / T) << REG2OFF(&ata_regs->time_1)) |
 		(((pio_t2_8[mode] + T) / T) << REG2OFF(&ata_regs->time_2w));
-	writel(val, &ata_regs->time_off);
+	writel(val, reg);
 
 	/* Write TIME_2R/AX/RDX/4 */
+	reg = (uint32_t)&ata_regs->time_2r;
 	val =	(((pio_t2_8[mode] + T) / T) << REG2OFF(&ata_regs->time_2r)) |
 		(((pio_tA[mode] + T) / T + 2) << REG2OFF(&ata_regs->time_ax)) |
 		(1 << REG2OFF(&ata_regs->time_pio_rdx)) |
 		(((pio_t4[mode] + T) / T) << REG2OFF(&ata_regs->time_4));
-	writel(val, &ata_regs->time_2r);
+	writel(val, reg);
 
 	/* Write TIME_9 ; the rest of timing registers is irrelevant for PIO */
+	reg = (uint32_t)&ata_regs->time_9;
 	val =	(((pio_t9[mode] + T) / T) << REG2OFF(&ata_regs->time_9));
-	writel(val, &ata_regs->time_9);
+	writel(val, reg);
 }
 
 int ide_preinit(void)
-- 
1.7.5.4

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

end of thread, other threads:[~2011-09-25 17:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-23  9:12 [U-Boot] [PATCH] ATA: Squash warnings in mxc_ata Marek Vasut
2011-09-23  9:27 ` Stefano Babic
2011-09-23  9:42 ` [U-Boot] [PATCH V2] " Marek Vasut
2011-09-23 10:02   ` Stefano Babic
2011-09-23 10:04   ` [U-Boot] [PATCH V3] " Marek Vasut
2011-09-25 17:21     ` Stefano Babic

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