Re: question about __v annotation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/1/3 Ryan Wang <openspace.wang@xxxxxxxxx>:
> 2010/1/2 Shawn <citypw@xxxxxxxxx>:
>> 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; })
>>
>> --
>> GNU powered it...
>> GPL protect it...
>> God blessing it...
>>
>> regards
>> HFG--Shawn the R0ck
>>
>
> notice "{ ... }"
> It's code block, and __v is its last value
> when you use readb link
>        somevar = readb(someport)
> then __v is return to set somevar
>
Oh, sorry
I've made a mistake

{} is a compound statement, () quotes it, and then you get one expression.
And the value of the expression is the last value of the compound statement.
so you can use readb like this:
         alm_en = readb(base + S3C2410_RTCALM);
Here, read(..) is one expression, and you should add ";" after it.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux