From: Wolfgang Denk Date: Fri, 24 May 2013 20:35:46 +0200 Subject: [U-Boot] [PATCH 2/7] ahci: fix unaligned access In-Reply-To: <1369176276-1895-2-git-send-email-robherring2@gmail.com> References: <1369176276-1895-1-git-send-email-robherring2@gmail.com> <1369176276-1895-2-git-send-email-robherring2@gmail.com> Message-ID: <20130524183546.A147E382FC3@gemini.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 Dear Rob Herring, In message <1369176276-1895-2-git-send-email-robherring2@gmail.com> you wrote: > > gcc 4.7 will generate unaligned accesses to local char arrays, so make > them static to avoid that. > > Signed-off-by: Rob Herring > --- > drivers/block/ahci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c > index b89be06..3cb37e7 100644 > --- a/drivers/block/ahci.c > +++ b/drivers/block/ahci.c > @@ -627,7 +627,7 @@ static void dump_ataid(hd_driveid_t *ataid) > */ > static int ata_scsiop_inquiry(ccb *pccb) > { > - u8 hdr[] = { > + static u8 hdr[] = { > 0, > 0, > 0x5, /* claim SPC-3 version compatibility */ Make it also "const" ? Best regards, Wolfgang Denk -- 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 "Pull the wool over your own eyes!" - J.R. "Bob" Dobbs