public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilya Yanok <yanok@emcraft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] dnet: driver for Dave DNET ethernet controller
Date: Wed, 11 Feb 2009 22:40:42 +0300	[thread overview]
Message-ID: <499329BA.5040807@emcraft.com> (raw)
In-Reply-To: <20090205213201.5A0EA8322908@gemini.denx.de>

Dear Wolfgang,

Wolfgang Denk wrote:
>> nothing magical in offsets actually... we usually have offsets in specs
>> not C structures...
>>     
>
> Just to name one reason (but a very important one):  using  a  struct
> allows for strict type checking by the compiler. If you use address +
> offset  you  will  not  get  any  help from the compiler when you for
> example read 8 bit from a register that must be accessed as a 32  bit
> entity.
>   

But this works only if we use "memory-style" IO access, if we use
read/write accessor functions that info we be lost as all pointers we be
silently converted into void*... And using "memory-style" IO access is
strongly discouraged in the kernel...
BTW, what is the general rule for U-Boot? I can see that most accesses
are done "memory-style" but I can see accessor functions used here and
there...

Regards, Ilya.

  reply	other threads:[~2009-02-11 19:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02 15:44 [U-Boot] [PATCH 0/3] qong: support for Dave/DENX QongEVB-LITE Ilya Yanok
2009-02-02 15:44 ` [U-Boot] [PATCH 1/3] mx31: add GPIO registers definitions Ilya Yanok
2009-02-02 20:11   ` Wolfgang Denk
2009-02-02 15:44 ` [U-Boot] [PATCH 2/3] dnet: driver for Dave DNET ethernet controller Ilya Yanok
2009-02-02 17:31   ` Ben Warren
2009-02-02 17:36     ` Ilya Yanok
2009-02-02 20:21   ` Wolfgang Denk
2009-02-05  3:38     ` Ilya Yanok
2009-02-05 21:32       ` Wolfgang Denk
2009-02-11 19:40         ` Ilya Yanok [this message]
2009-02-02 15:44 ` [U-Boot] [PATCH 3/3] qong: support for Dave/DENX QongEVB-LITE board Ilya Yanok
2009-02-02 20:43   ` Wolfgang Denk
2009-02-05  3:43     ` Ilya Yanok

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=499329BA.5040807@emcraft.com \
    --to=yanok@emcraft.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox