Commit 58ed9442 authored by Jon Paul Maloy's avatar Jon Paul Maloy Committed by David S. Miller

tipc: align usage of variable names and macros in socket

The practice of naming variables in TIPC is inconistent, sometimes
even within the same file.

In this commit we align variable names and declarations within
socket.c, and function and macro names within socket.h. We also
reduce the number of conversion macros to two, in order to make
usage less obsure.

These changes are purely cosmetic.
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3b4f302d
...@@ -193,7 +193,7 @@ void tipc_port_mcast_rcv(struct sk_buff *buf, struct tipc_port_list *dp) ...@@ -193,7 +193,7 @@ void tipc_port_mcast_rcv(struct sk_buff *buf, struct tipc_port_list *dp)
void tipc_port_wakeup(struct tipc_port *port) void tipc_port_wakeup(struct tipc_port *port)
{ {
tipc_sk_wakeup(tipc_port_to_sk(port)); tipc_sock_wakeup(tipc_port_to_sock(port));
} }
/* tipc_port_init - intiate TIPC port and lock it /* tipc_port_init - intiate TIPC port and lock it
...@@ -776,7 +776,7 @@ int tipc_port_rcv(struct sk_buff *buf) ...@@ -776,7 +776,7 @@ int tipc_port_rcv(struct sk_buff *buf)
/* validate destination & pass to port, otherwise reject message */ /* validate destination & pass to port, otherwise reject message */
p_ptr = tipc_port_lock(destport); p_ptr = tipc_port_lock(destport);
if (likely(p_ptr)) { if (likely(p_ptr)) {
err = tipc_sk_rcv(tipc_port_to_sk(p_ptr), buf); err = tipc_sk_rcv(&tipc_port_to_sock(p_ptr)->sk, buf);
tipc_port_unlock(p_ptr); tipc_port_unlock(p_ptr);
if (likely(!err)) if (likely(!err))
return dsz; return dsz;
......
This diff is collapsed.
...@@ -57,19 +57,14 @@ static inline struct tipc_sock *tipc_sk(const struct sock *sk) ...@@ -57,19 +57,14 @@ static inline struct tipc_sock *tipc_sk(const struct sock *sk)
return container_of(sk, struct tipc_sock, sk); return container_of(sk, struct tipc_sock, sk);
} }
static inline struct tipc_port *tipc_sk_port(const struct sock *sk) static inline struct tipc_sock *tipc_port_to_sock(const struct tipc_port *port)
{ {
return &(tipc_sk(sk)->port); return container_of(port, struct tipc_sock, port);
} }
static inline struct sock *tipc_port_to_sk(const struct tipc_port *port) static inline void tipc_sock_wakeup(struct tipc_sock *tsk)
{ {
return &(container_of(port, struct tipc_sock, port))->sk; tsk->sk.sk_write_space(&tsk->sk);
}
static inline void tipc_sk_wakeup(struct sock *sk)
{
sk->sk_write_space(sk);
} }
u32 tipc_sk_rcv(struct sock *sk, struct sk_buff *buf); u32 tipc_sk_rcv(struct sock *sk, struct sk_buff *buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment