Re: [PATCH 3/5] Bluetooth: Add enable_le module parameter

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

 



Hi Andrei,

On Fri, Jul 1, 2011 at 5:09 AM, Andrei Emeltchenko
<andrei.emeltchenko.news@xxxxxxxxx> wrote:
>> +static void hci_set_le_support(struct hci_dev *hdev)
>> +{
>> +     struct hci_cp_write_le_host_supported cp;
>> +
>> +     memset(&cp, 0, sizeof(cp));
>> +
>> +     if (enable_le) {
>> +             cp.le = 1;
>> +             cp.simul = !!(hdev->features[6] & LMP_SIMUL_LE_BR);
>
> Typo?

Usually this is a trick (used in other parts of the kernel) to assign
only 0 or 1 to a variable based on a value where non-zero means
"true". It is equivalent to:

if (hdev->features[6] & LMP_SIMUL_LE_BR)
    cp.simul = 1;
else
    cp.simul = 0;

(yes, I came across this same feeling when I saw this for the first
time on bluetooth kernel code)

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux