summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-20 13:37:06 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-22 02:59:41 -0700
commit861d6882b3dfe1710b35dbddf1b395b962061413 (patch)
tree94da0e9d5de2c3ed7643600ba4fe643e5e7c6911 /net/bluetooth
parent876d9484edf77d228adb42aecd4debd58d7739d6 (diff)
[Bluetooth] Remove global conf_mtu variable from L2CAP
After the change to the L2CAP configuration parameter handling the global conf_mtu variable is no longer needed and so remove it. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 6ce693d2e5b..fde1606a4f3 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -508,7 +508,6 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
/* Default config options */
pi->conf_len = 0;
- pi->conf_mtu = L2CAP_DEFAULT_MTU;
pi->flush_to = L2CAP_DEFAULT_FLUSH_TO;
}
@@ -1256,11 +1255,11 @@ static inline int l2cap_get_conf_opt(void **ptr, int *type, int *olen, unsigned
break;
case 2:
- *val = __le16_to_cpu(*((__le16 *)opt->val));
+ *val = __le16_to_cpu(*((__le16 *) opt->val));
break;
case 4:
- *val = __le32_to_cpu(*((__le32 *)opt->val));
+ *val = __le32_to_cpu(*((__le32 *) opt->val));
break;
default:
@@ -1332,6 +1331,7 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
int len = pi->conf_len;
int type, hint, olen;
unsigned long val;
+ u16 mtu = L2CAP_DEFAULT_MTU;
u16 result = L2CAP_CONF_SUCCESS;
BT_DBG("sk %p", sk);
@@ -1344,7 +1344,7 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
switch (type) {
case L2CAP_CONF_MTU:
- pi->conf_mtu = val;
+ mtu = val;
break;
case L2CAP_CONF_FLUSH_TO:
@@ -1368,10 +1368,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void *data)
/* Configure output options and let the other side know
* which ones we don't like. */
- if (pi->conf_mtu < pi->omtu)
+ if (mtu < pi->omtu)
result = L2CAP_CONF_UNACCEPT;
else {
- pi->omtu = pi->conf_mtu;
+ pi->omtu = mtu;
pi->conf_state |= L2CAP_CONF_OUTPUT_DONE;
}