From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Fri, 23 Sep 2011 12:02:25 +0200 Subject: [U-Boot] [PATCH V2] ATA: Squash warnings in mxc_ata. In-Reply-To: <1316770939-32458-1-git-send-email-marek.vasut@gmail.com> References: <1316769132-20368-1-git-send-email-marek.vasut@gmail.com> <1316770939-32458-1-git-send-email-marek.vasut@gmail.com> Message-ID: <4E7C5931.5060901@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/23/2011 11:42 AM, Marek Vasut wrote: > 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 > Cc: Stefano Babic > --- > drivers/block/mxc_ata.c | 22 +++++++++------------- > 1 files changed, 9 insertions(+), 13 deletions(-) > > V2: Use writeb() access > > diff --git a/drivers/block/mxc_ata.c b/drivers/block/mxc_ata.c > index f22f4f4..b05e3c9 100644 > --- a/drivers/block/mxc_ata.c > +++ b/drivers/block/mxc_ata.c > @@ -96,7 +96,6 @@ static uint16_t pio_tA[NR_PIO_SPECS] = { 50, 50, 50, 50, 50 }; > #define REG2OFF(reg) ((((uint32_t)reg) & 0x3) * 8) > static void set_ata_bus_timing(unsigned char mode) > { > - uint32_t val; > uint32_t T = 1000000000 / mxc_get_clock(MXC_IPG_CLK); > > struct mxc_ata_config_regs *ata_regs; > @@ -106,22 +105,19 @@ static void set_ata_bus_timing(unsigned char mode) > return; > > /* Write TIME_OFF/ON/1/2W */ > - 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); > + writeb(3, &ata_regs->time_off); > + writeb(3, &ata_regs->time_off); ^----- should be time_on Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================