* [PATCH] bluetooth: fix sparse & gcc warnings
@ 2011-06-01 6:54 Johannes Berg
2011-06-01 19:48 ` Gustavo F. Padovan
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2011-06-01 6:54 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Gustavo F. Padovan, linux-bluetooth
From: Johannes Berg <johannes.berg@intel.com>
sparse complains about a few things that should
be static, and I also noticed another warning
from gcc about a set but unused variable.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/bluetooth/l2cap_core.c | 6 +++---
net/bluetooth/mgmt.c | 2 +-
net/bluetooth/rfcomm/sock.c | 3 ---
3 files changed, 4 insertions(+), 7 deletions(-)
--- a/net/bluetooth/l2cap_core.c 2011-06-01 08:42:43.000000000 +0200
+++ b/net/bluetooth/l2cap_core.c 2011-06-01 08:45:04.000000000 +0200
@@ -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;
--- a/net/bluetooth/mgmt.c 2011-06-01 08:42:24.000000000 +0200
+++ b/net/bluetooth/mgmt.c 2011-06-01 08:42:28.000000000 +0200
@@ -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)
{
--- a/net/bluetooth/rfcomm/sock.c 2011-06-01 08:50:06.000000000 +0200
+++ b/net/bluetooth/rfcomm/sock.c 2011-06-01 08:50:23.000000000 +0200
@@ -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);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] bluetooth: fix sparse & gcc warnings
2011-06-01 6:54 [PATCH] bluetooth: fix sparse & gcc warnings Johannes Berg
@ 2011-06-01 19:48 ` Gustavo F. Padovan
0 siblings, 0 replies; 2+ messages in thread
From: Gustavo F. Padovan @ 2011-06-01 19:48 UTC (permalink / raw)
To: Johannes Berg; +Cc: John W. Linville, linux-wireless, linux-bluetooth
Hi Johannes,
* Johannes Berg <johannes@sipsolutions.net> [2011-06-01 08:54:45 +0200]:
> From: Johannes Berg <johannes.berg@intel.com>
>
> sparse complains about a few things that should
> be static, and I also noticed another warning
> from gcc about a set but unused variable.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> 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.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-01 19:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-01 6:54 [PATCH] bluetooth: fix sparse & gcc warnings Johannes Berg
2011-06-01 19:48 ` Gustavo F. Padovan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).