* with non-socket interfaces.
* See net.c for description of locking policy.
*/
-static void sock_lock(struct tipc_sock* tsock)
+static inline void sock_lock(struct tipc_sock* tsock)
{
spin_lock_bh(tsock->p->lock);
}
/*
* sock_unlock(): Unlock a port/socket pair
*/
-static void sock_unlock(struct tipc_sock* tsock)
+static inline void sock_unlock(struct tipc_sock* tsock)
{
spin_unlock_bh(tsock->p->lock);
}
* Returns pollmask value
*/
-static u32 pollmask(struct socket *sock)
+static inline u32 pollmask(struct socket *sock)
{
u32 mask;
* @tsock: TIPC socket
*/
-static void advance_queue(struct tipc_sock *tsock)
+static inline void advance_queue(struct tipc_sock *tsock)
{
sock_lock(tsock);
buf_discard(skb_dequeue(&tsock->sk.sk_receive_queue));
if (unlikely(protocol != 0))
return -EPROTONOSUPPORT;
- ref = tipc_createport_raw(NULL, &dispatch, &wakeupdispatch, TIPC_LOW_IMPORTANCE);
+ ref = tipc_createport_raw(0, &dispatch, &wakeupdispatch, TIPC_LOW_IMPORTANCE);
if (unlikely(!ref))
return -ENOMEM;
sock_lock(tsock);
buf = skb_dequeue(&sk->sk_receive_queue);
if (!buf)
- tsock->p->usr_handle = NULL;
+ tsock->p->usr_handle = 0;
sock_unlock(tsock);
if (!buf)
break;
return -ERESTARTSYS;
if (unlikely(!uaddr_len)) {
- res = tipc_withdraw(tsock->p->ref, 0, NULL);
+ res = tipc_withdraw(tsock->p->ref, 0, 0);
goto exit;
}
* Returns 0 if permission is granted, otherwise errno
*/
-static int dest_name_check(struct sockaddr_tipc *dest, struct msghdr *m)
+static inline int dest_name_check(struct sockaddr_tipc *dest, struct msghdr *m)
{
struct tipc_cfg_msg_hdr hdr;
* Note: Address is not captured if not requested by receiver.
*/
-static void set_orig_addr(struct msghdr *m, struct tipc_msg *msg)
+static inline void set_orig_addr(struct msghdr *m, struct tipc_msg *msg)
{
struct sockaddr_tipc *addr = (struct sockaddr_tipc *)m->msg_name;
* Returns 0 if successful, otherwise errno
*/
-static int anc_data_recv(struct msghdr *m, struct tipc_msg *msg,
+static inline int anc_data_recv(struct msghdr *m, struct tipc_msg *msg,
struct tipc_port *tport)
{
u32 anc_data[3];
{
struct tipc_sock *tsock = tipc_sk(sock->sk);
struct sockaddr_tipc *dst = (struct sockaddr_tipc *)dest;
- struct msghdr m = {NULL,};
+ struct msghdr m = {0,};
struct sk_buff *buf;
struct tipc_msg *msg;
int res;
/* Send a 'SYN-' to destination */
m.msg_name = dest;
- if ((res = send_msg(NULL, sock, &m, 0)) < 0) {
+ if ((res = send_msg(0, sock, &m, 0)) < 0) {
sock->state = SS_DISCONNECTING;
return res;
}
msg_dbg(msg,"<ACC<: ");
if (!msg_data_sz(msg)) {
- struct msghdr m = {NULL,};
+ struct msghdr m = {0,};
- send_packet(NULL, newsock, &m, 0);
+ send_packet(0, newsock, &m, 0);
advance_queue(tsock);
} else {
sock_lock(tsock);