MPC8349ea Random Device Generator driver
    Timur Tabi 
    timur at freescale.com
       
    Fri Jun  8 01:20:19 EST 2007
    
    
  
Olof Johansson wrote:
> No. in_le16 exists so you can read a little-endian 16 bit register on
> a device, and store it to a regular 16-bit integer variable. It
> has nothing to do with assignment.
What?  Reading from a register and storing the value into a variable *is* assignment.  If 
I have code like this:
	A = B;
I'm assigning B to A.
For the record, I understand the concepts you're talking about, I'm only confused about 
about some of things I'm reading.
> __le16 is just a type with hints for the programmer: "Hey, this is a
> 16-bit variable, but we're storing it in little-endian format. So if you
> need to use it as a native data type, you need to swap it by hand first",
> and sparse is able to help you find places where you didn't.
I understand that.
> If you use the accessors to read/write hardware (as you are supposed to
> do), then you don't need special types in your structs, just make sure
> you use the right accessors.
Ok, I understand that, too.  I just don't understand absolutist statements like "you can 
never assign a __le16 type to any other integer type" when our code is full of example of 
doing just that.
-- 
Timur Tabi
Linux Kernel Developer @ Freescale
    
    
More information about the Linuxppc-dev
mailing list