On Mon, Jan 04, 2010 at 03:32:07PM -0800, Bruce Blinn wrote:
> > -----Original Message-----
> > From: [email protected] 
> > [mailto:[email protected]] On Behalf Of Greg KH
> > Sent: Sunday, January 03, 2010 1:27 PM
> > To: Shawn
> > Cc: [email protected]
> > Subject: Re: question about __v annotation
> > 
> > 
> > On Sat, Jan 02, 2010 at 09:10:08PM +0800, Shawn wrote:
> > > hello guys,
> > >  I got a newbie confused when I was looking into the source code of 
> > > s3c2440's RTC driver.I dont know what is __v excatly 
> > means.anyone can 
> > > tell?thanks anyway!
> > > 
> > > #define readb(c) ({ __u8  __v = __raw_readb(__mem_pci(c)); __v; })
> > 
> > __v is an variable that the macro creates and then returns 
> > the value of.
> > 
> > Don't code like this, it's horrible :)
> > 
> 
> Could you be more specific with what you find wrong with this. The reason I
> ask is there is code like this all over the kernel.

Like what specifically?

Wrapping up a function call in a macro just because someone doesn't want
to type the whole thing out?  That's the horrible thing.

Returning a temporary variable isn't a big deal, but an inline function
is better to use as you will get the proper type safety.

thanks,

greg k-h

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to