Skip to contentSkip to conversation

bluetooth: fix sparse & gcc warnings

PATCH In review Johannes Berg 2 participants 2 messages Jun 1, 2011

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

PATCH 1/1 bluetooth: fix sparse & gcc warnings

From: Johannes Berg <[email protected]>

sparse complains about a few things that should
be static, and I also noticed another warning
from gcc about a set but unused variable.

---
 net/bluetooth/l2cap_core.c  |    6 +++---
 net/bluetooth/mgmt.c        |    2 +-
 net/bluetooth/rfcomm/sock.c |    3 ---
 3 files changed, 4 insertions(+), 7 deletions(-)
net/bluetooth/l2cap_core.c +3 -3
@@ -62,8 +62,8 @@ static u8 l2cap_fixed_chan[8] = { 0x02,
 
 static struct workqueue_struct *_busy_wq;
 
-LIST_HEAD(chan_list);
-DEFINE_RWLOCK(chan_list_lock);
+static LIST_HEAD(chan_list);
+static DEFINE_RWLOCK(chan_list_lock);
 
 static void l2cap_busy_work(struct work_struct *work);
 
@@ -371,7 +371,7 @@ static inline int l2cap_check_security(s
 	return hci_conn_security(conn->hcon, chan->sec_level, auth_type);
 }
 
-u8 l2cap_get_ident(struct l2cap_conn *conn)
+static u8 l2cap_get_ident(struct l2cap_conn *conn)
 {
 	u8 id;
 
net/bluetooth/mgmt.c +1 -1
@@ -41,7 +41,7 @@ struct pending_cmd {
 	void *user_data;
 };
 
-LIST_HEAD(cmd_list);
+static LIST_HEAD(cmd_list);
 
 static int cmd_status(struct sock *sk, u16 index, u16 cmd, u8 status)
 {
net/bluetooth/rfcomm/sock.c +0 -3
@@ -741,7 +741,6 @@ static int rfcomm_sock_setsockopt(struct
 static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen)
 {
 	struct sock *sk = sock->sk;
-	struct sock *l2cap_sk;
 	struct rfcomm_conninfo cinfo;
 	struct l2cap_conn *conn = l2cap_pi(sk)->chan->conn;
 	int len, err = 0;
@@ -786,8 +785,6 @@ static int rfcomm_sock_getsockopt_old(st
 			break;
 		}
 
-		l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk;
-
 		cinfo.hci_handle = conn->hcon->handle;
 		memcpy(cinfo.dev_class, conn->hcon->dev_class, 3);
 
#1 lore raw

Hi Johannes,

Quoted 6 lines · Johannes Berg

From: Johannes Berg <[email protected]>

sparse complains about a few things that should
be static, and I also noticed another warning
from gcc about a set but unused variable.

Quoted 6 lines
---
 net/bluetooth/l2cap_core.c  |    6 +++---
 net/bluetooth/mgmt.c        |    2 +-
 net/bluetooth/rfcomm/sock.c |    3 ---
 3 files changed, 4 insertions(+), 7 deletions(-)

I applied the sparse part as set but unused variable warnings are all fixed, thanks for the patch.

Signature · 2 lines
Gustavo F. Padovan
http://profusion.mobi