All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] NET: NE2000: Cleanup IO accessors
Date: Fri, 16 Dec 2011 14:32:53 -0500	[thread overview]
Message-ID: <201112161432.54362.vapier@gentoo.org> (raw)
In-Reply-To: <201112161913.33530.marek.vasut@gmail.com>

On Friday 16 December 2011 13:13:33 Marek Vasut wrote:
> On Friday 16 December 2011 12:33:53 Mike Frysinger wrote:
> > rename ISA_OFFSET to CONFIG_NE2000_IO_OFFSET, then move the "2" to
> > CONFIG_NE2000_IO_STRIDE, and move them both to the board config header.
> > then you get one unified set:
> > 
> > #define DP_IN(_b_, _o_, _d_) \
> > 	(_d_) = readw((void *)((_b_) + ((_o_) * CONFIG_NE2000_IO_STRIDE) + \
> > 		CONFIG_NE2000_IO_OFFSET));
> > etc...
> > 
> > if you really wanted to clean up the driver, the DP_XXX funcs would get
> > turned into C code as static inline helpers, and the base + register
> > offset would get turned into a C struct.
> 
> Ok, so if you had two different piece of hardware that had different
> NE2000_IO_OFFSET and STRIDE, running the same u-boot, how'd you handle it ?

do you actually have this issue ?  there are plenty of theoretical situations 
like this which would break a significant number (majority?) of drivers in the 
tree.  so unless this is a real case, i'd ignore it for now and stick with 
what optimizes away to no overhead.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111216/30ced049/attachment.pgp>

  reply	other threads:[~2011-12-16 19:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11  1:09 [U-Boot] [PATCH 1/2] NET: NE2000: Cleanup IO accessors Marek Vasut
2011-12-11  1:09 ` [U-Boot] [PATCH 2/2] NET: NE2000: Hide dp83902a_priv_data_t into ne2k_private_data Marek Vasut
2011-12-11  7:24 ` [U-Boot] [PATCH 1/2] NET: NE2000: Cleanup IO accessors Mike Frysinger
2011-12-11 13:42   ` Marek Vasut
2011-12-12  5:45     ` Mike Frysinger
2011-12-12 10:17       ` Marek Vasut
2011-12-16 17:33         ` Mike Frysinger
2011-12-16 18:13           ` Marek Vasut
2011-12-16 19:32             ` Mike Frysinger [this message]
2011-12-16 20:36               ` Marek Vasut
2012-07-10 21:41                 ` Joe Hershberger
2012-07-13 10:50                   ` Marek Vasut

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=201112161432.54362.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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 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.