[PATCH 1/2] wrapper: rename offset in offset_devp().

David Gibson david at gibson.dropbear.id.au
Mon Dec 17 11:44:15 EST 2007


On Wed, Dec 12, 2007 at 03:45:28PM +1100, Stephen Rothwell wrote:
> On Tue, 11 Dec 2007 15:23:04 -0600 Scott Wood <scottwood at freescale.com> wrote:
> >
> >  #define offset_devp(off)	\
> >  	({ \
> > -		int offset = (off); \
> > -		check_err(offset) ? NULL : (void *)(offset+1); \
> > +		int _offset = (off); \
> > +		check_err(_offset) ? NULL : (void *)(_offset+1); \
> >  	})
> 
> Just wondering if this could be a static inline function?

Alas, not really.  If we did that, then the __FUNCTION__ and __LINE__
we use in the error message inside check_err() would always refer to
the offset_devp() function, which would be substantially less useful
than referring to the function which invoked the offset_devp() macro.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20071217/3a140a13/attachment.pgp>


More information about the Linuxppc-dev mailing list