Skip to contentSkip to conversation

Bluetooth: ath3k: no need to set same pipe multiple times

PATCH Superseded Adam Lee 2 participants 5 messages May 27, 2014 – Jun 5, 2014 Bluetooth drivers

lore
Share & tools
lore

Adam Lee

author
#0 lore raw

PATCH 1/1 Bluetooth: ath3k: no need to set same pipe multiple times

Invoking usb_sndbulkpipe() on same pipe for same purpose only once is enough.

---
 drivers/bluetooth/ath3k.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bluetooth/ath3k.c +2 -1
index a83b57e..f983806 100644
@@ -193,9 +193,10 @@ static int ath3k_load_firmware(struct usb_device *udev,
 	sent += 20;
 	count -= 20;
 
+	pipe = usb_sndbulkpipe(udev, 0x02);
+
 	while (count) {
 		size = min_t(uint, count, BULK_SIZE);
-		pipe = usb_sndbulkpipe(udev, 0x02);
 		memcpy(send_buf, firmware->data + sent, size);
 
 		err = usb_bulk_msg(udev, pipe, send_buf, size,
Signature · 1 line
2.0.0.rc4
#1 lore raw

Hi Adam,

2014-05-27 Adam Lee <[email protected]>:

Quoted 7 lines

Invoking usb_sndbulkpipe() on same pipe for same purpose only once is enough.

---
 drivers/bluetooth/ath3k.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch has been applied to bluetooth-next. Thanks.

Gustavo

author
#2 lore raw

PATCH v2 1/1 Bluetooth: ath3k: no need to set same pipe multiple times

Invoking usb_sndbulkpipe() on same pipe for same purpose only once is enough.

v2: patch the missing place too, sorry.

---
 drivers/bluetooth/ath3k.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/bluetooth/ath3k.c +4 -3
index a83b57e..9559f74 100644
@@ -193,9 +193,10 @@ static int ath3k_load_firmware(struct usb_device *udev,
 	sent += 20;
 	count -= 20;
 
+	pipe = usb_sndbulkpipe(udev, 0x02);
+
 	while (count) {
 		size = min_t(uint, count, BULK_SIZE);
-		pipe = usb_sndbulkpipe(udev, 0x02);
 		memcpy(send_buf, firmware->data + sent, size);
 
 		err = usb_bulk_msg(udev, pipe, send_buf, size,
@@ -289,10 +290,10 @@ static int ath3k_load_fwfile(struct usb_device *udev,
 	sent += size;
 	count -= size;
 
+	pipe = usb_sndbulkpipe(udev, 0x02);
+
 	while (count) {
 		size = min_t(uint, count, BULK_SIZE);
-		pipe = usb_sndbulkpipe(udev, 0x02);
-
 		memcpy(send_buf, firmware->data + sent, size);
 
 		err = usb_bulk_msg(udev, pipe, send_buf, size,
Signature · 1 line
2.0.0.rc4
author
#3 lore raw

PATCH 1/1 Bluetooth: ath3k: reduce pipe setting times in ath3k_load_fwfile()

In reply to Gustavo Padovan

Invoking usb_sndbulkpipe() on same pipe for same purpose only once is enough.

---
 drivers/bluetooth/ath3k.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bluetooth/ath3k.c +2 -2
index 4aef96b..f938263 100644
@@ -288,10 +288,10 @@ static int ath3k_load_fwfile(struct usb_device *udev,
 	sent += size;
 	count -= size;
 
+	pipe = usb_sndbulkpipe(udev, 0x02);
+
 	while (count) {
 		size = min_t(uint, count, BULK_SIZE);
-		pipe = usb_sndbulkpipe(udev, 0x02);
-
 		memcpy(send_buf, firmware->data + sent, size);
 
 		err = usb_bulk_msg(udev, pipe, send_buf, size,
Signature · 1 line
2.0.0
#4 lore raw

Re: [PATCH] Bluetooth: ath3k: reduce pipe setting times in ath3k_load_fwfile()

Hi Adam,

2014-06-05 Adam Lee <[email protected]>:

Quoted 7 lines

Invoking usb_sndbulkpipe() on same pipe for same purpose only once is enough.

---
 drivers/bluetooth/ath3k.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch has been applied to bluetooth-next. Thanks.

Gustavo