All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@openbossa.org>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [RFC 3/4] Bluetooth: Move is_identity_address() to hci_core.h
Date: Wed, 25 Jun 2014 20:48:39 -0300	[thread overview]
Message-ID: <CACJA=fUB=kKfzuD5a6NuBDk-qtywW495Z+VrhqXx-1+aFDUiWA@mail.gmail.com> (raw)
In-Reply-To: <8886F344-FB0A-407C-955F-C0DB2BE08647@holtmann.org>

Hi Marcel,

On Wed, Jun 25, 2014 at 5:16 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Andre,
>
>> This patch adds the prefix hci_ to is_identity_address() helper and
>> moves it to hci_core.h so it can be reused in other files.
>>
>> Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
>> ---
>> include/net/bluetooth/hci_core.h | 12 ++++++++++++
>> net/bluetooth/hci_core.c         | 14 +-------------
>> 2 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
>> index 016d262..b6b1c86 100644
>> --- a/include/net/bluetooth/hci_core.h
>> +++ b/include/net/bluetooth/hci_core.h
>> @@ -1164,6 +1164,18 @@ static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type)
>>       return false;
>> }
>>
>> +static inline bool hci_is_identity_address(bdaddr_t *addr, u8 addr_type)
>> +{
>> +     if (addr_type == ADDR_LE_DEV_PUBLIC)
>> +             return true;
>> +
>> +     /* Check for Random Static address type */
>> +     if ((addr->b[5] & 0xc0) == 0xc0)
>> +             return true;
>> +
>> +     return false;
>> +}
>> +
>> static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
>>                                         bdaddr_t *bdaddr, u8 addr_type)
>> {
>> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
>> index 9852449..b8b901c 100644
>> --- a/net/bluetooth/hci_core.c
>> +++ b/net/bluetooth/hci_core.c
>> @@ -3369,18 +3369,6 @@ static bool is_connected(struct hci_dev *hdev, bdaddr_t *addr, u8 type)
>>       return true;
>> }
>>
>> -static bool is_identity_address(bdaddr_t *addr, u8 addr_type)
>> -{
>> -     if (addr_type == ADDR_LE_DEV_PUBLIC)
>> -             return true;
>> -
>> -     /* Check for Random Static address type */
>> -     if ((addr->b[5] & 0xc0) == 0xc0)
>> -             return true;
>> -
>> -     return false;
>> -}
>> -
>> /* This function requires the caller holds hdev->lock */
>> int hci_conn_params_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
>>                       u8 auto_connect, u16 conn_min_interval,
>> @@ -3388,7 +3376,7 @@ int hci_conn_params_add(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
>> {
>>       struct hci_conn_params *params;
>>
>> -     if (!is_identity_address(addr, addr_type))
>> +     if (!hci_is_identity_address(addr, addr_type))
>>               return -EINVAL;
>
> I do not really get the logic here. Why do we need to do this.

Forget about this patch. It became pointless after your comment on patch 4.

Regards,

Andre

  reply	other threads:[~2014-06-25 23:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25 19:48 [RFC 0/4] New Connection Parameter Event Andre Guedes
2014-06-25 19:48 ` [RFC 1/4] Bluetooth: Connection parameters check helper Andre Guedes
2014-06-25 19:48 ` [RFC 2/4] Bluetooth: Connection Parameter Update Procedure Andre Guedes
2014-06-25 20:18   ` Marcel Holtmann
2014-06-25 23:48     ` Andre Guedes
2014-06-25 19:48 ` [RFC 3/4] Bluetooth: Move is_identity_address() to hci_core.h Andre Guedes
2014-06-25 20:16   ` Marcel Holtmann
2014-06-25 23:48     ` Andre Guedes [this message]
2014-06-25 19:48 ` [RFC 4/4] Bluetooth: Introduce "New Connection Parameter" Event Andre Guedes
2014-06-25 20:14   ` Marcel Holtmann
2014-06-25 23:48     ` Andre Guedes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACJA=fUB=kKfzuD5a6NuBDk-qtywW495Z+VrhqXx-1+aFDUiWA@mail.gmail.com' \
    --to=andre.guedes@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.