Thread (109 messages) 109 messages, 10 authors, 2007-04-27

Re: [PATCH 6/6] [POWERPC] make struct property's value a void *

From: David Miller <davem@davemloft.net>
Date: 2007-04-04 19:21:29

From: Segher Boessenkool <redacted>
Date: Wed, 4 Apr 2007 13:11:43 +0200
quoted
quoted
Why?  It should logically be an u8 * (and nothing
should ever cast it to anything else, accessor
functions should be used instead to get 32-bit ints
from it, etc.)
Ummm, no.

There are structures there, and other types of objects.
There are arrays of bytes there, with no guarantee of
any further alignment.
On PowerPC misaligned data doesn't generate exceptions, the chip works
it out transparently.  It's not very slow at it even, and these paths
accessing this stuff aren't performance critical anyways.

On sparc everything is aligned.  I know, I've been accessing OFW data
structures for more than 10 years and I haven't gotten one unaligned
trap on sparc yet.
So just do an of_decode_int() and its cousins -- platforms
that are trying to guarantee alignment, or that can handle
unaligned memory accesses, can just define these as direct
accesses; everyone else should use the read-by-byte sequences.
No, that's just stupid.  Peppering simple accesses to properties
with these wrappers is just going to make the code uglier for
no tangible gain whatsoever.

There is no reason to make a mountain out of a mole hill wrt. this
stuff.

And besides what Stephen is doing is just extending existing
practice, he isn't changing how any of this stuff is already
used.  So this discussion should not get in the way of his
patches getting installed.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help