Re: [PATCH 1/2] Bluetooth: Add mgmt_device_found event

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

 



Hi Johan,

On Wed, Mar 30, 2011 at 6:18 AM,  <johan.hedberg@xxxxxxxxx> wrote:
> +int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi,
> +                                                               u8 *eir)
> +{
> +       struct mgmt_ev_device_found ev;
> +
> +       memset(&ev, 0, sizeof(ev));
> +
> +       bacpy(&ev.bdaddr, bdaddr);
> +       memcpy(ev.dev_class, dev_class, 3);

What about "sizeof(ev.dev_class)" instead of 3 ?

> +       ev.rssi = rssi;
> +
> +       if (eir)
> +               memcpy(ev.eir, eir, HCI_MAX_EIR_LENGTH);

This could be "sizeof(ev.eir)" as well, although it is already clear
by the #define.

> +
> +       return mgmt_event(MGMT_EV_DEVICE_FOUND, index, &ev, sizeof(ev), NULL);
> +}

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