lkml.org 
[lkml]   [2000]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] isa_{read,write}{w,l} fixed
> >                                   In practice a lot of code assumes that if
> > if you do all padding yourself so structure members are naturally aligned[*]
> > gcc will leave them in the order they are in and not add padding.

> If structure members are laid out the right way, no padding is added. As
> claimed, depends on architecure, CPU family, optimization flags, ...

> > There is no reason to require readb() to compute offsets by hand while
> > letting TCP, DMA code aso use structs ( (u32 *)ip_header)[IP_SADDR] =
> > source_address; - yuck), and what I'm saying there is no reason to "fix"
> > drivers that use structs for readb() offsets.
>
> TCP was designed for natural alignment of the fields, for efficiency. This
> is _not_ to be taken for granted for any random struct.

We aren't talking about random structs. We're talking about structs which
have been explicitly padded so all members are naturally aligned.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.053 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site