diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-24 17:07:38 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-09 16:29:10 -0500 |
| commit | 17836394e578b8d6475ecdb309ad1356bbcf37a2 (patch) | |
| tree | 0a96321812719cff97012d161bcdf4d47b4740ea /include | |
| parent | c0371da6047abd261bc483c744dbc7d81a116172 (diff) | |
first fruits - kill l2cap ->memcpy_fromiovec()
Just use copy_from_iter(). That's what this method is trying to do
in all cases, in a very convoluted fashion.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/bluetooth/l2cap.h | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index bca6fc0a3196..692f786bebe2 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -606,10 +606,6 @@ struct l2cap_ops { | |||
| 606 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 606 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
| 607 | unsigned long hdr_len, | 607 | unsigned long hdr_len, |
| 608 | unsigned long len, int nb); | 608 | unsigned long len, int nb); |
| 609 | int (*memcpy_fromiovec) (struct l2cap_chan *chan, | ||
| 610 | unsigned char *kdata, | ||
| 611 | struct msghdr *msg, | ||
| 612 | int len); | ||
| 613 | }; | 609 | }; |
| 614 | 610 | ||
| 615 | struct l2cap_conn { | 611 | struct l2cap_conn { |
| @@ -903,31 +899,6 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan) | |||
| 903 | return 0; | 899 | return 0; |
| 904 | } | 900 | } |
| 905 | 901 | ||
| 906 | static inline int l2cap_chan_no_memcpy_fromiovec(struct l2cap_chan *chan, | ||
| 907 | unsigned char *kdata, | ||
| 908 | struct msghdr *msg, | ||
| 909 | int len) | ||
| 910 | { | ||
| 911 | /* Following is safe since for compiler definitions of kvec and | ||
| 912 | * iovec are identical, yielding the same in-core layout and alignment | ||
| 913 | */ | ||
| 914 | struct kvec *vec = (struct kvec *)msg->msg_iter.iov; | ||
| 915 | |||
| 916 | while (len > 0) { | ||
| 917 | if (vec->iov_len) { | ||
| 918 | int copy = min_t(unsigned int, len, vec->iov_len); | ||
| 919 | memcpy(kdata, vec->iov_base, copy); | ||
| 920 | len -= copy; | ||
| 921 | kdata += copy; | ||
| 922 | vec->iov_base += copy; | ||
| 923 | vec->iov_len -= copy; | ||
| 924 | } | ||
| 925 | vec++; | ||
| 926 | } | ||
| 927 | |||
| 928 | return 0; | ||
| 929 | } | ||
| 930 | |||
| 931 | extern bool disable_ertm; | 902 | extern bool disable_ertm; |
| 932 | 903 | ||
| 933 | int l2cap_init_sockets(void); | 904 | int l2cap_init_sockets(void); |
