[U-Boot] [PATCH 1/2] NET: NE2000: Cleanup IO accessors

Mike Frysinger vapier at gentoo.org
Fri Dec 16 20:32:53 CET 2011


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>


More information about the U-Boot mailing list