Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] bluetooth: hci_nokia: Save a few cycles in 'nokia_enqueue()'
@ 2019-09-19 19:52 Christophe JAILLET
  2019-09-26  6:34 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2019-09-19 19:52 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: linux-bluetooth, linux-kernel, kernel-janitors, Christophe JAILLET

'skb_pad()' a few lines above already initializes the "padded" byte to 0.
So there is no need to do it twice.

All what is needed is to increase the len of the skb. So 'skb_put(..., 1)'
is enough here.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/bluetooth/hci_nokia.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bluetooth/hci_nokia.c b/drivers/bluetooth/hci_nokia.c
index 6463350b7977..05f7f6de6863 100644
--- a/drivers/bluetooth/hci_nokia.c
+++ b/drivers/bluetooth/hci_nokia.c
@@ -520,7 +520,7 @@ static int nokia_enqueue(struct hci_uart *hu, struct sk_buff *skb)
 		err = skb_pad(skb, 1);
 		if (err)
 			return err;
-		skb_put_u8(skb, 0x00);
+		skb_put(skb, 1);
 	}
 
 	skb_queue_tail(&btdev->txq, skb);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] bluetooth: hci_nokia: Save a few cycles in 'nokia_enqueue()'
  2019-09-19 19:52 [PATCH] bluetooth: hci_nokia: Save a few cycles in 'nokia_enqueue()' Christophe JAILLET
@ 2019-09-26  6:34 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-09-26  6:34 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Johan Hedberg, linux-bluetooth, linux-kernel, kernel-janitors

Hi Christophe,

> 'skb_pad()' a few lines above already initializes the "padded" byte to 0.
> So there is no need to do it twice.
> 
> All what is needed is to increase the len of the skb. So 'skb_put(..., 1)'
> is enough here.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/bluetooth/hci_nokia.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 19:52 [PATCH] bluetooth: hci_nokia: Save a few cycles in 'nokia_enqueue()' Christophe JAILLET
2019-09-26  6:34 ` Marcel Holtmann

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox