git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
net
/
bluetooth
/
rfcomm
/
tty.c
diff --git
a/net/bluetooth/rfcomm/tty.c
b/net/bluetooth/rfcomm/tty.c
index
ed8abef
..
6d68920
100644
(file)
--- a/
net/bluetooth/rfcomm/tty.c
+++ b/
net/bluetooth/rfcomm/tty.c
@@
-77,7
+77,7
@@
struct rfcomm_dev {
};
static LIST_HEAD(rfcomm_dev_list);
};
static LIST_HEAD(rfcomm_dev_list);
-static
rwlock_t rfcomm_dev_lock = RW_LOCK_UNLOCKED
;
+static
DEFINE_RWLOCK(rfcomm_dev_lock)
;
static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb);
static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err);
static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb);
static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err);
@@
-645,32
+645,26
@@
static void rfcomm_tty_close(struct tty_struct *tty, struct file *filp)
rfcomm_dev_put(dev);
}
rfcomm_dev_put(dev);
}
-static int rfcomm_tty_write(struct tty_struct *tty,
int from_user,
const unsigned char *buf, int count)
+static int rfcomm_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
{
struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
struct rfcomm_dlc *dlc = dev->dlc;
struct sk_buff *skb;
int err = 0, sent = 0, size;
{
struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
struct rfcomm_dlc *dlc = dev->dlc;
struct sk_buff *skb;
int err = 0, sent = 0, size;
- BT_DBG("tty %p
from_user %d count %d", tty, from_user
, count);
+ BT_DBG("tty %p
count %d", tty
, count);
while (count) {
size = min_t(uint, count, dlc->mtu);
while (count) {
size = min_t(uint, count, dlc->mtu);
- if (from_user)
- skb = rfcomm_wmalloc(dev, size + RFCOMM_SKB_RESERVE, GFP_KERNEL);
- else
- skb = rfcomm_wmalloc(dev, size + RFCOMM_SKB_RESERVE, GFP_ATOMIC);
+ skb = rfcomm_wmalloc(dev, size + RFCOMM_SKB_RESERVE, GFP_ATOMIC);
if (!skb)
break;
skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE);
if (!skb)
break;
skb_reserve(skb, RFCOMM_SKB_HEAD_RESERVE);
- if (from_user)
- copy_from_user(skb_put(skb, size), buf + sent, size);
- else
- memcpy(skb_put(skb, size), buf + sent, size);
+ memcpy(skb_put(skb, size), buf + sent, size);
if ((err = rfcomm_dlc_send(dlc, skb)) < 0) {
kfree_skb(skb);
if ((err = rfcomm_dlc_send(dlc, skb)) < 0) {
kfree_skb(skb);