diff options
author | Joe Perches <joe@perches.com> | 2012-06-03 13:41:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-04 11:45:11 -0400 |
commit | e3192690a3c889767d1161b228374f4926d92af0 (patch) | |
tree | a2acbe06cc2efedb6002055f9d4ffd7f2ba6ec75 /net/tipc | |
parent | 29a6b6c060445eb46528785d51a2d8b0e6d898c4 (diff) |
net: Remove casts to same type
Adding casts of objects to the same type is unnecessary
and confusing for a human reader.
For example, this cast:
int y;
int *p = (int *)&y;
I used the coccinelle script below to find and remove these
unnecessary casts. I manually removed the conversions this
script produces of casts with __force and __user.
@@
type T;
T *p;
@@
- (T *)p
+ p
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/port.c | 9 | ||||
-rw-r--r-- | net/tipc/socket.c | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c index 2ad37a4db37..a1e828989d7 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c | |||
@@ -909,8 +909,8 @@ int tipc_createport(void *usr_handle, | |||
909 | warn("Port creation failed, no memory\n"); | 909 | warn("Port creation failed, no memory\n"); |
910 | return -ENOMEM; | 910 | return -ENOMEM; |
911 | } | 911 | } |
912 | p_ptr = (struct tipc_port *)tipc_createport_raw(NULL, port_dispatcher, | 912 | p_ptr = tipc_createport_raw(NULL, port_dispatcher, port_wakeup, |
913 | port_wakeup, importance); | 913 | importance); |
914 | if (!p_ptr) { | 914 | if (!p_ptr) { |
915 | kfree(up_ptr); | 915 | kfree(up_ptr); |
916 | return -ENOMEM; | 916 | return -ENOMEM; |
@@ -1078,8 +1078,7 @@ int tipc_disconnect_port(struct tipc_port *tp_ptr) | |||
1078 | if (tp_ptr->connected) { | 1078 | if (tp_ptr->connected) { |
1079 | tp_ptr->connected = 0; | 1079 | tp_ptr->connected = 0; |
1080 | /* let timer expire on it's own to avoid deadlock! */ | 1080 | /* let timer expire on it's own to avoid deadlock! */ |
1081 | tipc_nodesub_unsubscribe( | 1081 | tipc_nodesub_unsubscribe(&tp_ptr->subscription); |
1082 | &((struct tipc_port *)tp_ptr)->subscription); | ||
1083 | res = 0; | 1082 | res = 0; |
1084 | } else { | 1083 | } else { |
1085 | res = -ENOTCONN; | 1084 | res = -ENOTCONN; |
@@ -1099,7 +1098,7 @@ int tipc_disconnect(u32 ref) | |||
1099 | p_ptr = tipc_port_lock(ref); | 1098 | p_ptr = tipc_port_lock(ref); |
1100 | if (!p_ptr) | 1099 | if (!p_ptr) |
1101 | return -EINVAL; | 1100 | return -EINVAL; |
1102 | res = tipc_disconnect_port((struct tipc_port *)p_ptr); | 1101 | res = tipc_disconnect_port(p_ptr); |
1103 | tipc_port_unlock(p_ptr); | 1102 | tipc_port_unlock(p_ptr); |
1104 | return res; | 1103 | return res; |
1105 | } | 1104 | } |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 5577a447f53..11a863d8142 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -54,7 +54,7 @@ struct tipc_sock { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | #define tipc_sk(sk) ((struct tipc_sock *)(sk)) | 56 | #define tipc_sk(sk) ((struct tipc_sock *)(sk)) |
57 | #define tipc_sk_port(sk) ((struct tipc_port *)(tipc_sk(sk)->p)) | 57 | #define tipc_sk_port(sk) (tipc_sk(sk)->p) |
58 | 58 | ||
59 | #define tipc_rx_ready(sock) (!skb_queue_empty(&sock->sk->sk_receive_queue) || \ | 59 | #define tipc_rx_ready(sock) (!skb_queue_empty(&sock->sk->sk_receive_queue) || \ |
60 | (sock->state == SS_DISCONNECTING)) | 60 | (sock->state == SS_DISCONNECTING)) |