2015-11-26 14:49:33

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 1/2] Bluetooth: Use hexadecimal notation for mask

From: Andrei Emeltchenko <[email protected]>

Using hexadecimal notation for mask makes code easier to read

Signed-off-by: Andrei Emeltchenko <[email protected]>
---
drivers/bluetooth/hci_h5.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index db039f2..fc1a499 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -317,7 +317,7 @@ static void h5_handle_internal_rx(struct hci_uart *hu)
h5_link_control(hu, conf_req, 3);
} else if (memcmp(data, conf_rsp, 2) == 0) {
if (H5_HDR_LEN(hdr) > 2)
- h5->tx_win = (data[2] & 7);
+ h5->tx_win = (data[2] & 0x07);
BT_DBG("Three-wire init complete. tx_win %u", h5->tx_win);
h5->state = H5_ACTIVE;
hci_uart_init_ready(hu);
--
2.5.0



2015-11-26 14:53:29

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 1/2] Bluetooth: Use hexadecimal notation for mask

Hi Andrei,

> Using hexadecimal notation for mask makes code easier to read
>
> Signed-off-by: Andrei Emeltchenko <[email protected]>
> ---
> drivers/bluetooth/hci_h5.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


2015-11-26 14:53:27

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 2/2] Bluetooth: Simplify setting Configuration Field

Hi Andrei,

> Only Sliding Window Size is used at the moment for H5 Bluetooth
> Configuration messages.
>
> Signed-off-by: Andrei Emeltchenko <[email protected]>
> ---
> drivers/bluetooth/hci_h5.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


2015-11-26 14:49:34

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH 2/2] Bluetooth: Simplify setting Configuration Field

From: Andrei Emeltchenko <[email protected]>

Only Sliding Window Size is used at the moment for H5 Bluetooth
Configuration messages.

Signed-off-by: Andrei Emeltchenko <[email protected]>
---
drivers/bluetooth/hci_h5.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index fc1a499..2d1c9f6 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -116,12 +116,8 @@ static void h5_link_control(struct hci_uart *hu, const void *data, size_t len)

static u8 h5_cfg_field(struct h5 *h5)
{
- u8 field = 0;
-
/* Sliding window size (first 3 bits) */
- field |= (h5->tx_win & 0x07);
-
- return field;
+ return h5->tx_win & 0x07;
}

static void h5_timed_event(unsigned long arg)
--
2.5.0