From: Wolfgang Denk Date: Mon, 04 Oct 2010 14:04:58 +0200 Subject: [U-Boot] packed attribute problem In-Reply-To: <4CA9B316.3050802@st.com> References: <4CA9A095.9000900@st.com> <20101004101714.A19931539A0@gemini.denx.de> <4CA9ACAA.2020001@st.com> <20101004104443.09AE41539A0@gemini.denx.de> <4CA9B316.3050802@st.com> Message-ID: <20101004120458.A63D11539A0@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 Vipin Kumar, In message <4CA9B316.3050802@st.com> you wrote: > > >>> Hm... Why do these structs have any "__attribute__ ((packed))" at all? > >> > >> Even I could not understand that very well > > > > Eventually alignment of these structs cannot be guaranteed? > > In my opinion it can be guaranteed. > btw, I am talking about ehci_hcor structure in include/usb/host/ehci.h > The only reason I am confused is that a lot many platforms would have faced a > similar problem (or is it only me). > > Please confirm if I should remove the packed attribute and send a patch This is mostly a decision Remy has to make (on cc:) > This also raises one doubt. Since u-boot code now contains structures to access > device registers, using packed attribute with these structures can be lethal On ARM, indeed. Such structures must not use any packed attributes. 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 About the use of language: it is impossible to sharpen a pencil with a blunt ax. It is equally vain to try to do it with ten blunt axes instead. -- Edsger Dijkstra