diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2015-06-05 15:40:54 -0700 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2015-06-09 14:56:33 -0700 |
commit | 8e879bf1f524401ccf47431a133f1c14bf8f9a9a (patch) | |
tree | ae8e0d779e1eaa8006325841371f6a629f540969 /patches/collateral-evolutions/network/0054-struct-proto_ops-sig/bluetooth.patch | |
parent | 6dc1eeb208158eb14569fcfce5b5ff70471118b4 (diff) |
patches: provide 0054-struct-proto_ops-sig SmPL patch replacement
This replaces the 436 line of unified diff with 152
lines of grammar Coccinelle SmPL patch. SmPL patch
equivalence proof tests reveals only cosmetic changes
between using Coccinelle SmPL and unified diff as shown
below. The difference shown are the results of two
trees, one in which we applied the SmPL patch, and another
in which the old unified patch series were used. This
gives us an idea of what Coccinelle did differently.
1 3.0.101 [ OK ]
2 3.1.10 [ OK ]
3 3.2.68 [ OK ]
4 3.3.8 [ OK ]
5 3.4.107 [ OK ]
6 3.5.7 [ OK ]
7 3.6.11 [ OK ]
8 3.7.10 [ OK ]
9 3.8.13 [ OK ]
10 3.9.11 [ OK ]
11 3.10.75 [ OK ]
12 3.11.10 [ OK ]
13 3.12.40 [ OK ]
14 3.13.11 [ OK ]
15 3.14.39 [ OK ]
16 3.15.10 [ OK ]
17 3.16.7 [ OK ]
18 3.17.8 [ OK ]
19 3.18.12 [ OK ]
20 3.19.5 [ OK ]
21 4.0.0 [ OK ]
22 4.1-rc1 [ OK ]
mcgrof@ergon ~/backports (git::master)$ time \
./gentree.py --clean --prove-cocci \
patches/collateral-evolutions/network/0054-struct-proto_ops-sig.cocci \
/home/mcgrof/linux-next/ /home/mcgrof/build/backports-20150525
Copy original source files ...
Applying patches from patches to
/home/mcgrof/build/backports-20150525 ...
Proving Coccinelle SmPL patch: 0054-struct-proto_ops-sig.cocci
Aggregating patch for Coccinelle SmPL 0054-struct-proto_ops-sig proof: ieee802154.patch
Aggregating patch for Coccinelle SmPL 0054-struct-proto_ops-sig proof: nfc.patch
Aggregating patch for Coccinelle SmPL 0054-struct-proto_ops-sig proof: bluetooth.patch
Review the difference between what the tree looks like
by applying your SmPL patch, then reverting that and
only applying your the patches in the patch series.
Change directory to /home/mcgrof/build/backports-20150525 and run 'git diff'
diff stat of the changes:
net/bluetooth/hci_sock.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
Done!
real 0m21.965s
user 0m45.947s
sys 0m4.072s
Now when I change directory to /home/mcgrof/build/backports-20150525 and
run 'git diff' I get:
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 9326bc8..9ca0166 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -956,7 +956,8 @@ static int hci_sock_recvmsg(struct socket *sock,
struct msghdr *msg, size_t len,
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
static int backport_hci_sock_recvmsg(struct kiocb *iocb, struct socket
*sock,
struct msghdr *msg, size_t len,
- int flags){
+ int flags)
+{
return hci_sock_recvmsg(sock, msg, len, flags);
}
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */
@@ -1198,7 +1199,8 @@ drop:
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
static int backport_hci_sock_sendmsg(struct kiocb *iocb, struct socket
*sock,
- struct msghdr *msg, size_t len){
+ struct msghdr *msg, size_t len)
+{
return hci_sock_sendmsg(sock, msg, len);
}
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */
@@ -1360,12 +1362,9 @@ static const struct proto_ops hci_sock_ops = {
.getname = hci_sock_getname,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
.sendmsg = hci_sock_sendmsg,
-#else
- .sendmsg = backport_hci_sock_sendmsg,
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
.recvmsg = hci_sock_recvmsg,
#else
+ .sendmsg = backport_hci_sock_sendmsg,
.recvmsg = backport_hci_sock_recvmsg,
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */
.ioctl = hci_sock_ioctl,
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Diffstat (limited to 'patches/collateral-evolutions/network/0054-struct-proto_ops-sig/bluetooth.patch')
-rw-r--r-- | patches/collateral-evolutions/network/0054-struct-proto_ops-sig/bluetooth.patch | 187 |
1 files changed, 0 insertions, 187 deletions
diff --git a/patches/collateral-evolutions/network/0054-struct-proto_ops-sig/bluetooth.patch b/patches/collateral-evolutions/network/0054-struct-proto_ops-sig/bluetooth.patch deleted file mode 100644 index 2cf5a9ec..00000000 --- a/patches/collateral-evolutions/network/0054-struct-proto_ops-sig/bluetooth.patch +++ /dev/null @@ -1,187 +0,0 @@ ---- a/net/bluetooth/hci_sock.c -+++ b/net/bluetooth/hci_sock.c -@@ -953,6 +953,14 @@ static int hci_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, - - return err ? : copied; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) -+static int backport_hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, -+ struct msghdr *msg, size_t len, -+ int flags) -+{ -+ return hci_sock_recvmsg(sock, msg, len, flags); -+} -+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ - - static int hci_mgmt_cmd(struct hci_mgmt_chan *chan, struct sock *sk, - struct msghdr *msg, size_t msglen) -@@ -1189,6 +1196,13 @@ drop: - kfree_skb(skb); - goto done; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) -+static int backport_hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, -+ struct msghdr *msg, size_t len) -+{ -+ return hci_sock_sendmsg(sock, msg, len); -+} -+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ - - static int hci_sock_setsockopt(struct socket *sock, int level, int optname, - char __user *optval, unsigned int len) -@@ -1345,8 +1358,13 @@ static const struct proto_ops hci_sock_ops = { - .release = hci_sock_release, - .bind = hci_sock_bind, - .getname = hci_sock_getname, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) - .sendmsg = hci_sock_sendmsg, - .recvmsg = hci_sock_recvmsg, -+#else -+ .sendmsg = backport_hci_sock_sendmsg, -+ .recvmsg = backport_hci_sock_recvmsg, -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */ - .ioctl = hci_sock_ioctl, - .poll = datagram_poll, - .listen = sock_no_listen, ---- a/net/bluetooth/l2cap_sock.c -+++ b/net/bluetooth/l2cap_sock.c -@@ -975,6 +975,13 @@ static int l2cap_sock_sendmsg(struct socket *sock, struct msghdr *msg, - - return err; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) -+static int backport_l2cap_sock_sendmsg(struct kiocb *iocb, -+ struct socket *sock, -+ struct msghdr *msg, size_t len){ -+ return l2cap_sock_sendmsg(sock, msg, len); -+} -+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ - - static int l2cap_sock_recvmsg(struct socket *sock, struct msghdr *msg, - size_t len, int flags) -@@ -1036,6 +1043,14 @@ done: - release_sock(sk); - return err; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) -+static int backport_l2cap_sock_recvmsg(struct kiocb *iocb, -+ struct socket *sock, -+ struct msghdr *msg, size_t len, -+ int flags){ -+ return l2cap_sock_recvmsg(sock, msg, len, flags); -+} -+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ - - /* Kill socket (only if zapped and orphan) - * Must be called on unlocked socket. -@@ -1618,8 +1633,16 @@ static const struct proto_ops l2cap_sock_ops = { - .listen = l2cap_sock_listen, - .accept = l2cap_sock_accept, - .getname = l2cap_sock_getname, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) - .sendmsg = l2cap_sock_sendmsg, -+#else -+ .sendmsg = backport_l2cap_sock_sendmsg, -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) - .recvmsg = l2cap_sock_recvmsg, -+#else -+ .recvmsg = backport_l2cap_sock_recvmsg, -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */ - .poll = bt_sock_poll, - .ioctl = bt_sock_ioctl, - .mmap = sock_no_mmap, ---- a/net/bluetooth/rfcomm/sock.c -+++ b/net/bluetooth/rfcomm/sock.c -@@ -622,6 +622,13 @@ done: - - return sent; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) -+static int backport_rfcomm_sock_sendmsg(struct kiocb *iocb, -+ struct socket *sock, -+ struct msghdr *msg, size_t len){ -+ return rfcomm_sock_sendmsg(sock, msg, len); -+} -+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ - - static int rfcomm_sock_recvmsg(struct socket *sock, struct msghdr *msg, - size_t size, int flags) -@@ -647,6 +654,14 @@ static int rfcomm_sock_recvmsg(struct socket *sock, struct msghdr *msg, - - return len; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) -+static int backport_rfcomm_sock_recvmsg(struct kiocb *iocb, -+ struct socket *sock, -+ struct msghdr *msg, size_t len, -+ int flags){ -+ return rfcomm_sock_recvmsg(sock, msg, len, flags); -+} -+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ - - static int rfcomm_sock_setsockopt_old(struct socket *sock, int optname, char __user *optval, unsigned int optlen) - { -@@ -1044,8 +1059,16 @@ static const struct proto_ops rfcomm_sock_ops = { - .listen = rfcomm_sock_listen, - .accept = rfcomm_sock_accept, - .getname = rfcomm_sock_getname, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) - .sendmsg = rfcomm_sock_sendmsg, -+#else -+ .sendmsg = backport_rfcomm_sock_sendmsg, -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) - .recvmsg = rfcomm_sock_recvmsg, -+#else -+ .recvmsg = backport_rfcomm_sock_recvmsg, -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */ - .shutdown = rfcomm_sock_shutdown, - .setsockopt = rfcomm_sock_setsockopt, - .getsockopt = rfcomm_sock_getsockopt, ---- a/net/bluetooth/sco.c -+++ b/net/bluetooth/sco.c -@@ -713,6 +713,12 @@ static int sco_sock_sendmsg(struct socket *sock, struct msghdr *msg, - release_sock(sk); - return err; - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) -+static int backport_sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock, -+ struct msghdr *msg, size_t len){ -+ return sco_sock_sendmsg(sock, msg, len); -+} -+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ - - static void sco_conn_defer_accept(struct hci_conn *conn, u16 setting) - { -@@ -779,6 +785,13 @@ static int sco_sock_recvmsg(struct socket *sock, struct msghdr *msg, - - return bt_sock_recvmsg(sock, msg, len, flags); - } -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) -+static int backport_sco_sock_recvmsg(struct kiocb *iocb, struct socket *sock, -+ struct msghdr *msg, size_t len, -+ int flags){ -+ return sco_sock_recvmsg(sock, msg, len, flags); -+} -+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ - - static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) - { -@@ -1178,8 +1191,16 @@ static const struct proto_ops sco_sock_ops = { - .listen = sco_sock_listen, - .accept = sco_sock_accept, - .getname = sco_sock_getname, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) - .sendmsg = sco_sock_sendmsg, -+#else -+ .sendmsg = backport_sco_sock_sendmsg, -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) - .recvmsg = sco_sock_recvmsg, -+#else -+ .recvmsg = backport_sco_sock_recvmsg, -+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) */ - .poll = bt_sock_poll, - .ioctl = bt_sock_ioctl, - .mmap = sock_no_mmap, |