Skip to contentSkip to conversation

Bluetooth: hci_ll: Use skb_put_u8 instead of struct hcill_cmd

PATCH Applied Marcel Holtmann 2 participants 2 messages Mar 20, 2018 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: hci_ll: Use skb_put_u8 instead of struct hcill_cmd

The struct hcill_cmd to create an skb with a single u8 is pointless. So just use skb_put_u8 instead.

---
 drivers/bluetooth/hci_ll.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/bluetooth/hci_ll.c +1 -7
index 2f30dcad96bd..7c55a9f77808 100644
@@ -82,10 +82,6 @@ enum hcill_states_e {
 	HCILL_AWAKE_TO_ASLEEP
 };
 
-struct hcill_cmd {
-	u8 cmd;
-} __packed;
-
 struct ll_device {
 	struct hci_uart hu;
 	struct serdev_device *serdev;
@@ -113,7 +109,6 @@ static int send_hcill_cmd(u8 cmd, struct hci_uart *hu)
 	int err = 0;
 	struct sk_buff *skb = NULL;
 	struct ll_struct *ll = hu->priv;
-	struct hcill_cmd *hcill_packet;
 
 	BT_DBG("hu %p cmd 0x%x", hu, cmd);
 
@@ -126,8 +121,7 @@ static int send_hcill_cmd(u8 cmd, struct hci_uart *hu)
 	}
 
 	/* prepare packet */
-	hcill_packet = skb_put(skb, 1);
-	hcill_packet->cmd = cmd;
+	skb_put_u8(skb, cmd);
 
 	/* send packet */
 	skb_queue_tail(&ll->txq, skb);
Signature · 1 line
2.14.3
#1 lore raw

Hi Marcel,

Quoted 7 lines · Marcel Holtmann

The struct hcill_cmd to create an skb with a single u8 is pointless. So just use skb_put_u8 instead.

---
 drivers/bluetooth/hci_ll.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Applied to bluetooth-next. Thanks.

Johan