* [PATCH] Bluetooth:hci_qca: Changed unsigned long to bool
@ 2015-09-28 6:29 Mutharaju, Prasanna (P.)
2015-09-28 7:15 ` Szymon Janc
0 siblings, 1 reply; 3+ messages in thread
From: Mutharaju, Prasanna (P.) @ 2015-09-28 6:29 UTC (permalink / raw)
To: marcel@holtmann.org, gustavo@padovan.org, johan.hedberg@gmail.com
Cc: linux-bluetooth@vger.kernel.org
From: Prasanna Karthik <mkarthi3@visteon.com>
'retransmit' being set in HCI_IBS_TX_WAKING case,
using bool would be efficient.
Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
---
drivers/bluetooth/hci_qca.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 21f4ea4..3fdb17d 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -347,7 +347,7 @@ static void hci_ibs_wake_retrans_timeout(unsigned long =
arg)
struct hci_uart *hu =3D (struct hci_uart *)arg;
struct qca_data *qca =3D hu->priv;
unsigned long flags, retrans_delay;
- unsigned long retransmit =3D 0;
+ bool retransmit;
=20
BT_DBG("hu %p wake retransmit timeout in %d state",
hu, qca->tx_ibs_state);
@@ -358,7 +358,7 @@ static void hci_ibs_wake_retrans_timeout(unsigned long =
arg)
switch (qca->tx_ibs_state) {
case HCI_IBS_TX_WAKING:
/* No WAKE_ACK, retransmit WAKE */
- retransmit =3D 1;
+ retransmit =3D true;
if (send_hci_ibs_cmd(HCI_IBS_WAKE_IND, hu) < 0) {
BT_ERR("Failed to acknowledge device wake up");
break;
--=20
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Bluetooth:hci_qca: Changed unsigned long to bool
2015-09-28 6:29 [PATCH] Bluetooth:hci_qca: Changed unsigned long to bool Mutharaju, Prasanna (P.)
@ 2015-09-28 7:15 ` Szymon Janc
2015-09-28 7:58 ` Mutharaju, Prasanna (P.)
0 siblings, 1 reply; 3+ messages in thread
From: Szymon Janc @ 2015-09-28 7:15 UTC (permalink / raw)
To: Mutharaju, Prasanna (P.)
Cc: marcel@holtmann.org, gustavo@padovan.org, johan.hedberg@gmail.com,
linux-bluetooth@vger.kernel.org
Hi,
On Monday 28 of September 2015 06:29:07 Mutharaju, Prasanna wrote:
> From: Prasanna Karthik <mkarthi3@visteon.com>
>
> 'retransmit' being set in HCI_IBS_TX_WAKING case,
> using bool would be efficient.
>
> Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
> ---
> drivers/bluetooth/hci_qca.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index 21f4ea4..3fdb17d 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -347,7 +347,7 @@ static void hci_ibs_wake_retrans_timeout(unsigned long
> arg) struct hci_uart *hu = (struct hci_uart *)arg;
> struct qca_data *qca = hu->priv;
> unsigned long flags, retrans_delay;
> - unsigned long retransmit = 0;
> + bool retransmit;
>
> BT_DBG("hu %p wake retransmit timeout in %d state",
> hu, qca->tx_ibs_state);
> @@ -358,7 +358,7 @@ static void hci_ibs_wake_retrans_timeout(unsigned long
> arg) switch (qca->tx_ibs_state) {
> case HCI_IBS_TX_WAKING:
> /* No WAKE_ACK, retransmit WAKE */
> - retransmit = 1;
> + retransmit = true;
> if (send_hci_ibs_cmd(HCI_IBS_WAKE_IND, hu) < 0) {
> BT_ERR("Failed to acknowledge device wake up");
> break;
Isn't this patch giving you a warning about retransmit being used
uninitialized? (it is never set to false)
--
BR
Szymon Janc
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Bluetooth:hci_qca: Changed unsigned long to bool
2015-09-28 7:15 ` Szymon Janc
@ 2015-09-28 7:58 ` Mutharaju, Prasanna (P.)
0 siblings, 0 replies; 3+ messages in thread
From: Mutharaju, Prasanna (P.) @ 2015-09-28 7:58 UTC (permalink / raw)
To: Szymon Janc
Cc: marcel@holtmann.org, gustavo@padovan.org, johan.hedberg@gmail.com,
linux-bluetooth@vger.kernel.org
On Mon, Sep 28, 2015 at 09:15:47AM +0200, Szymon Janc wrote:
> Hi,
>=20
> On Monday 28 of September 2015 06:29:07 Mutharaju, Prasanna wrote:
> > From: Prasanna Karthik <mkarthi3@visteon.com>
> >=20
> > 'retransmit' being set in HCI_IBS_TX_WAKING case,
> > using bool would be efficient.
> >=20
> > Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
> > ---
> > drivers/bluetooth/hci_qca.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >=20
> > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> > index 21f4ea4..3fdb17d 100644
> > --- a/drivers/bluetooth/hci_qca.c
> > +++ b/drivers/bluetooth/hci_qca.c
> > @@ -347,7 +347,7 @@ static void hci_ibs_wake_retrans_timeout(unsigned l=
ong
> > arg) struct hci_uart *hu =3D (struct hci_uart *)arg;
> > struct qca_data *qca =3D hu->priv;
> > unsigned long flags, retrans_delay;
> > - unsigned long retransmit =3D 0;
> > + bool retransmit;
> >=20
> > BT_DBG("hu %p wake retransmit timeout in %d state",
> > hu, qca->tx_ibs_state);
> > @@ -358,7 +358,7 @@ static void hci_ibs_wake_retrans_timeout(unsigned l=
ong
> > arg) switch (qca->tx_ibs_state) {
> > case HCI_IBS_TX_WAKING:
> > /* No WAKE_ACK, retransmit WAKE */
> > - retransmit =3D 1;
> > + retransmit =3D true;
> > if (send_hci_ibs_cmd(HCI_IBS_WAKE_IND, hu) < 0) {
> > BT_ERR("Failed to acknowledge device wake up");
> > break;
>=20
> Isn't this patch giving you a warning about retransmit being used=20
> uninitialized? (it is never set to false)
>=20
> --=20
> BR
> Szymon Janc
Nope, It doesn't show compiler warning, bool will be initialized to false
by default by the compiler. I will send a V2 of the patch with retransmit
set to false if needed. =
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-28 7:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-28 6:29 [PATCH] Bluetooth:hci_qca: Changed unsigned long to bool Mutharaju, Prasanna (P.)
2015-09-28 7:15 ` Szymon Janc
2015-09-28 7:58 ` Mutharaju, Prasanna (P.)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).