* what does it use two "!!"
2013-04-01 4:12 pci_alloc_consistent doubt Avinash Patil
@ 2013-04-01 7:10 ` Ben Wu
2013-04-01 9:37 ` Valdis.Kletnieks at vt.edu
0 siblings, 1 reply; 6+ messages in thread
From: Ben Wu @ 2013-04-01 7:10 UTC (permalink / raw)
To: kernelnewbies
Dear All?
1> I found some placeuse two "!!", what's means
??? if(button->gpio != INVALID_GPIO)
??? ??? state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low);
??? else
??? ??? state = !!button->adc_state;
2> is there some MSN group to study linux kernel or discuss it ?
Thanks and Best Regards
Ben Wu
MSN:crayben at yahoo.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/59223f6f/attachment.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* what does it use two "!!"
@ 2013-04-01 7:13 Ben Wu
2013-04-01 7:18 ` anish singh
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ben Wu @ 2013-04-01 7:13 UTC (permalink / raw)
To: kernelnewbies
Dear All?
1> I found some placeuse two "!!", what's means
??? if(button->gpio != INVALID_GPIO)
??? ??? state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low);
??? else
??? ??? state = !!button->adc_state;
2> is there some MSN group to study linux kernel or discuss it ?
Thanks and Best Regards
Ben Wu
MSN:crayben at yahoo.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/92c770c5/attachment.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* what does it use two "!!"
2013-04-01 7:13 what does it use two "!!" Ben Wu
@ 2013-04-01 7:18 ` anish singh
2013-04-01 13:47 ` Christopher Harvey
2013-04-01 23:36 ` Jonathan Neuschäfer
2 siblings, 0 replies; 6+ messages in thread
From: anish singh @ 2013-04-01 7:18 UTC (permalink / raw)
To: kernelnewbies
!! is generally used to make the return bool value.
You can use kernelnewbies and linux kernel mailing list.
On Mon, Apr 1, 2013 at 12:43 PM, Ben Wu <crayben@yahoo.cn> wrote:
>
>
> Dear All?
> 1> I found some placeuse two "!!", what's means
> if(button->gpio != INVALID_GPIO)
> state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^
> button->active_low);
> else
> state = !!button->adc_state;
>
> 2> is there some MSN group to study linux kernel or discuss it ?
>
> Thanks and Best Regards
> Ben Wu
> MSN:crayben at yahoo.cn
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/57917fa7/attachment.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* what does it use two "!!"
2013-04-01 7:10 ` what does it use two "!!" Ben Wu
@ 2013-04-01 9:37 ` Valdis.Kletnieks at vt.edu
0 siblings, 0 replies; 6+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2013-04-01 9:37 UTC (permalink / raw)
To: kernelnewbies
On Mon, 01 Apr 2013 15:10:46 +0800, Ben Wu said:
> 1> I found some placeuse two "!!", what's means
>??? if(button->gpio != INVALID_GPIO)
>??? ??? state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low);
>??? else
Gaah. That line of code fell out of the ugly tree and hit every branch
on the way down.
Use of "!!" *and* "? 1 :0 " in the same line of code to do the same thing.
Ouch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130401/36cad557/attachment.bin
^ permalink raw reply [flat|nested] 6+ messages in thread
* what does it use two "!!"
2013-04-01 7:13 what does it use two "!!" Ben Wu
2013-04-01 7:18 ` anish singh
@ 2013-04-01 13:47 ` Christopher Harvey
2013-04-01 23:36 ` Jonathan Neuschäfer
2 siblings, 0 replies; 6+ messages in thread
From: Christopher Harvey @ 2013-04-01 13:47 UTC (permalink / raw)
To: kernelnewbies
Ben Wu writes:
> Dear All?
> 1> I found some placeuse two "!!", what's means
> if(button->gpio != INVALID_GPIO)
> state = !!((gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low);
> else
> state = !!button->adc_state;
if a = 1010011 then
!a = 0 and
!!a = 1
if a = 000000 then
!a = 1
!! = 0
basically it means if a is non-zero then make a = exactly 1, else leave
it at zero.
> 2> is there some MSN group to study linux kernel or discuss it ?
don't know, but it would be ironic.
> Thanks and Best Regards
>
> Ben Wu
>
> MSN:crayben at yahoo.cn
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 6+ messages in thread
* what does it use two "!!"
2013-04-01 7:13 what does it use two "!!" Ben Wu
2013-04-01 7:18 ` anish singh
2013-04-01 13:47 ` Christopher Harvey
@ 2013-04-01 23:36 ` Jonathan Neuschäfer
2 siblings, 0 replies; 6+ messages in thread
From: Jonathan Neuschäfer @ 2013-04-01 23:36 UTC (permalink / raw)
To: kernelnewbies
On Mon, Apr 01, 2013 at 03:13:06PM +0800, Ben Wu wrote:
> 2> is there some MSN group to study linux kernel or discuss it ?
> MSN:crayben at yahoo.cn
You seem to have a strange notion of "MSN". I guess you don't mean
"Microsoft Network" (which really is what MSN means much of the time),
but e-mail. If you do, then yes, there are a lot of mailing lists about
various aspects of the linux kernel, and kernelnewbies at kernelnewbies.org
is one of them.
Hope that helps,
Jonathan Neusch?fer
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-04-01 23:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-01 7:13 what does it use two "!!" Ben Wu
2013-04-01 7:18 ` anish singh
2013-04-01 13:47 ` Christopher Harvey
2013-04-01 23:36 ` Jonathan Neuschäfer
-- strict thread matches above, loose matches on Subject: below --
2013-04-01 4:12 pci_alloc_consistent doubt Avinash Patil
2013-04-01 7:10 ` what does it use two "!!" Ben Wu
2013-04-01 9:37 ` Valdis.Kletnieks at vt.edu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).