Macro inflation [was: Re: change log for rtems (2010-09-08)]

Eric Norum wenorum at lbl.gov
Fri Sep 10 15:33:22 UTC 2010


I really don't see how
	someIOreg = BIT32(8);
is any clearer than
	someIOreg = 1<<8;

But I think that
#define	SOMEDEVICE_CSR_INTERRUPT_ENABLE	(1<<8)     
.
.
.
	someIOreg = SOMEDEVICE_CSR_INTERRUPT_ENABLE;
would be better.


Or even better, use Till Straumann's I/O macros in case there are special instructions needed to synchronize or serialize I/O (i.e. the PowerPC EIEIO instruction)

On Sep 9, 2010, at 11:45 PM, Thomas Dörfler wrote:

> Eric, Ralf,
> 
> obviously we have different opinions here. Once again: I agree that a
> different namespace is required for these definitions, but I think the
> macros _do_ improve readability.
> 
> I would like to move the discussion back to the rtems-vc mailing list to
> allow Sebastian to express his opinions.
> 
> wkr,
> 
> Thomas.
> 
> 

-- 
Eric Norum
wenorum at lbl.gov





More information about the vc mailing list