Re: what does it use two "!!"

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

 



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.

Attachment: pgp8FICPETVy_.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[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