lkml.org 
[lkml]   [2011]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/8] firmware: Sigma: Mark firmware strutcs packed
On 11/24/2011 06:19 PM, Mike Frysinger wrote:
> On Thursday 24 November 2011 07:48:23 Lars-Peter Clausen wrote:
>> Mark structs which are embedded into the firmware as packed to avoid
>> alignment issues.
>
> while in general this makes sense, i designed the struct layout specifically to
> work on any sane system. that means 8bits align on 8bits, 16bits align on
> 16bits, and 32bits align on 32bits.
>
> do you see any place where this is not the case ? otherwise, using __packed
> by itself doesn't make much sense unless you also change all the loads from
> the struct to the get_unaligned variety which would add useless overhead to
> many embedded parts.
>
> all in all, i'd omit the __packed markings since they're unnecessary.
> -mike

While you are right I think it's generally a good idea to mark anything as
packed, where we don't have direct influence on the alignment, to avoid
unpleasant suppresses. The compiler will usually take of performing proper
unaligned reads. I've though about adding a __aligned__(2) to the struct,
but since the majority of the data is 8bit data the overhead should be
negligible.

- Lars


\
 
 \ /
  Last update: 2011-11-25 11:49    [W:0.246 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site