Skip to contentSkip to conversation

Bluetooth: Add missing 6lowpan.h include

PATCH In review [email protected] 2 participants 4 messages Dec 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Bluetooth: Add missing 6lowpan.h include

From: Johan Hedberg <[email protected]>

The 6lowpan.c file was missing an #include statement for 6lowpan.h. Without it we get the following type of warnings:

net/bluetooth/6lowpan.c:320:5: warning: symbol 'bt_6lowpan_recv' was not declared. Should it be static? net/bluetooth/6lowpan.c:737:5: warning: symbol 'bt_6lowpan_add_conn' was not declared. Should it be static? net/bluetooth/6lowpan.c:805:5: warning: symbol 'bt_6lowpan_del_conn' was not declared. Should it be static? net/bluetooth/6lowpan.c:878:5: warning: symbol 'bt_6lowpan_init' was not declared. Should it be static? net/bluetooth/6lowpan.c:883:6: warning: symbol 'bt_6lowpan_cleanup' was not declared. Should it be static?

---
 net/bluetooth/6lowpan.c | 2 ++
 1 file changed, 2 insertions(+)
net/bluetooth/6lowpan.c +2 -0
index ba840fe2c555..3cbb1d14c304 100644
@@ -26,6 +26,8 @@
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/l2cap.h>
 
+#include "6lowpan.h"
+
 #include "../ieee802154/6lowpan.h" /* for the compression support */
 
 #define IFACE_NAME_TEMPLATE "bt%d"
Signature · 1 line
1.8.4.2
#1 lore raw

PATCH 2/2 Bluetooth: Fix test for lookup_dev return value

From: Johan Hedberg <[email protected]>

The condition wouldn't have previously caused -ENOENT to be returned if dev was NULL. The proper condition should be if (!dev || !dev->netdev).

---
 net/bluetooth/6lowpan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/6lowpan.c +1 -1
index 3cbb1d14c304..5ad8b483efa3 100644
@@ -330,7 +330,7 @@ int bt_6lowpan_recv(struct l2cap_conn *conn, struct sk_buff *skb)
 		return -ENOENT;
 
 	dev = lookup_dev(conn);
-	if (dev && !dev->netdev)
+	if (!dev || !dev->netdev)
 		return -ENOENT;
 
 	err = recv_pkt(skb, dev->netdev, conn);
Signature · 1 line
1.8.4.2
maintainer
#2 lore raw

Re: [PATCH 2/2] Bluetooth: Fix test for lookup_dev return value

Hi Johan,

Quoted 7 lines

The condition wouldn't have previously caused -ENOENT to be returned if dev was NULL. The proper condition should be if (!dev || !dev->netdev).

---
net/bluetooth/6lowpan.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

maintainer
#3 lore raw
In reply to [email protected]

Hi Johan,

Quoted 9 lines

The 6lowpan.c file was missing an #include statement for 6lowpan.h. Without it we get the following type of warnings:

net/bluetooth/6lowpan.c:320:5: warning: symbol 'bt_6lowpan_recv' was not declared. Should it be static? net/bluetooth/6lowpan.c:737:5: warning: symbol 'bt_6lowpan_add_conn' was not declared. Should it be static? net/bluetooth/6lowpan.c:805:5: warning: symbol 'bt_6lowpan_del_conn' was not declared. Should it be static? net/bluetooth/6lowpan.c:878:5: warning: symbol 'bt_6lowpan_init' was not declared. Should it be static? net/bluetooth/6lowpan.c:883:6: warning: symbol 'bt_6lowpan_cleanup' was not declared. Should it be static?

Quoted 4 lines

---
net/bluetooth/6lowpan.c | 2 ++

1 file changed, 2 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel