Skip to contentSkip to conversation

Bluetooth: hci_qca: Remove redundant initializations to zero

PATCH Superseded Matthias Kaehlcke 2 participants 2 messages Mar 5, 2019 – Mar 6, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: hci_qca: Remove redundant initializations to zero

The qca_data structure is allocated with kzalloc() and hence zero-initialized. Remove a bunch of unnecessary explicit initializations of struct members to zero.

---
 drivers/bluetooth/hci_qca.c | 19 -------------------
 1 file changed, 19 deletions(-)
drivers/bluetooth/hci_qca.c +0 -19
index 237aea34b69f1..8dccbb934e384 100644
@@ -480,26 +480,7 @@ static int qca_open(struct hci_uart *hu)
 	qca->tx_ibs_state = HCI_IBS_TX_ASLEEP;
 	qca->rx_ibs_state = HCI_IBS_RX_ASLEEP;
 
-	/* clocks actually on, but we start votes off */
-	qca->tx_vote = false;
-	qca->rx_vote = false;
-	qca->flags = 0;
-
-	qca->ibs_sent_wacks = 0;
-	qca->ibs_sent_slps = 0;
-	qca->ibs_sent_wakes = 0;
-	qca->ibs_recv_wacks = 0;
-	qca->ibs_recv_slps = 0;
-	qca->ibs_recv_wakes = 0;
 	qca->vote_last_jif = jiffies;
-	qca->vote_on_ms = 0;
-	qca->vote_off_ms = 0;
-	qca->votes_on = 0;
-	qca->votes_off = 0;
-	qca->tx_votes_on = 0;
-	qca->tx_votes_off = 0;
-	qca->rx_votes_on = 0;
-	qca->rx_votes_off = 0;
 
 	hu->priv = qca;
 
Signature · 1 line
2.21.0.352.gf09ad66450-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Matthias Kaehlcke

The qca_data structure is allocated with kzalloc() and hence zero-initialized. Remove a bunch of unnecessary explicit initializations of struct members to zero.

---
 drivers/bluetooth/hci_qca.c | 19 -------------------
 1 file changed, 19 deletions(-)
drivers/bluetooth/hci_qca.c +0 -11
index 237aea34b69f1..8dccbb934e384 100644
@@ -480,26 +480,7 @@ static int qca_open(struct hci_uart *hu)
 	qca->tx_ibs_state = HCI_IBS_TX_ASLEEP;
 	qca->rx_ibs_state = HCI_IBS_RX_ASLEEP;
 
-	/* clocks actually on, but we start votes off */
-	qca->tx_vote = false;
-	qca->rx_vote = false;
-	qca->flags = 0;
-
-	qca->ibs_sent_wacks = 0;
-	qca->ibs_sent_slps = 0;
-	qca->ibs_sent_wakes = 0;
-	qca->ibs_recv_wacks = 0;
-	qca->ibs_recv_slps = 0;
-	qca->ibs_recv_wakes = 0;
 	qca->vote_last_jif = jiffies;

drivers/bluetooth/hci_qca.c static int qca_open(struct hci_uart *hu) · line 485

Quoted 10 lines
drivers/bluetooth/hci_qca.c +0 -8
-	qca->vote_on_ms = 0;
-	qca->vote_off_ms = 0;
-	qca->votes_on = 0;
-	qca->votes_off = 0;
-	qca->tx_votes_on = 0;
-	qca->tx_votes_off = 0;
-	qca->rx_votes_on = 0;
-	qca->rx_votes_off = 0;
 
 	hu->priv = qca;
Signature · 2 lines
Regards
Balakrishna.