All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Olof Johansson <olof@lixom.net>
Cc: linuxppc-dev@ozlabs.org, sl@powerlinux.fr,
	Philippe Lachenal <philippe.lachenal@hotmail.fr>
Subject: Re: MPC8349ea Random Device Generator driver
Date: Thu, 07 Jun 2007 10:20:19 -0500	[thread overview]
Message-ID: <46682233.7060601@freescale.com> (raw)
In-Reply-To: <20070607152041.GA2851@lixom.net>

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

  reply	other threads:[~2007-06-07 15:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-05 15:42 MPC8349ea Random Device Generator driver Philippe Lachenal
2007-06-06 14:15 ` Arnd Bergmann
2007-06-07 11:29   ` MPC8349ea Random Number " Philippe Lachenal
2007-06-07 14:03     ` Arnd Bergmann
2007-06-06 21:57 ` MPC8349ea Random Device " Timur Tabi
2007-06-06 22:09   ` Olof Johansson
2007-06-06 22:07     ` Timur Tabi
2007-06-06 22:11       ` Arnd Bergmann
2007-06-06 22:19         ` Timur Tabi
2007-06-06 22:35           ` Arnd Bergmann
2007-06-06 22:38             ` Timur Tabi
2007-06-06 22:24       ` Olof Johansson
2007-06-06 22:32         ` Timur Tabi
2007-06-06 23:54           ` Olof Johansson
2007-06-07 14:23             ` Timur Tabi
2007-06-07 15:20               ` Olof Johansson
2007-06-07 15:20                 ` Timur Tabi [this message]
2007-06-07 15:36                   ` Olof Johansson
2007-06-06 22:48         ` Timur Tabi
2007-06-07  0:00           ` Olof Johansson
2007-06-07  2:55 ` Kim Phillips

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46682233.7060601@freescale.com \
    --to=timur@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olof@lixom.net \
    --cc=philippe.lachenal@hotmail.fr \
    --cc=sl@powerlinux.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.