Commit dc6b9b78 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: include/net/sock.h cleanup

bool/const conversions where possible

__inline__ -> inline

space cleanups
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1f352920
This diff is collapsed.
...@@ -848,7 +848,7 @@ int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -848,7 +848,7 @@ int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
default: default:
dccp_pr_debug("packet_type=%s\n", dccp_pr_debug("packet_type=%s\n",
dccp_packet_name(dh->dccph_type)); dccp_packet_name(dh->dccph_type));
sk_eat_skb(sk, skb, 0); sk_eat_skb(sk, skb, false);
} }
verify_sock_status: verify_sock_status:
if (sock_flag(sk, SOCK_DONE)) { if (sock_flag(sk, SOCK_DONE)) {
...@@ -905,7 +905,7 @@ int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -905,7 +905,7 @@ int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
len = skb->len; len = skb->len;
found_fin_ok: found_fin_ok:
if (!(flags & MSG_PEEK)) if (!(flags & MSG_PEEK))
sk_eat_skb(sk, skb, 0); sk_eat_skb(sk, skb, false);
break; break;
} while (1); } while (1);
out: out:
......
...@@ -1473,11 +1473,11 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, ...@@ -1473,11 +1473,11 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
break; break;
} }
if (tcp_hdr(skb)->fin) { if (tcp_hdr(skb)->fin) {
sk_eat_skb(sk, skb, 0); sk_eat_skb(sk, skb, false);
++seq; ++seq;
break; break;
} }
sk_eat_skb(sk, skb, 0); sk_eat_skb(sk, skb, false);
if (!desc->count) if (!desc->count)
break; break;
tp->copied_seq = seq; tp->copied_seq = seq;
...@@ -1513,7 +1513,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -1513,7 +1513,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
int target; /* Read at least this many bytes */ int target; /* Read at least this many bytes */
long timeo; long timeo;
struct task_struct *user_recv = NULL; struct task_struct *user_recv = NULL;
int copied_early = 0; bool copied_early = false;
struct sk_buff *skb; struct sk_buff *skb;
u32 urg_hole = 0; u32 urg_hole = 0;
...@@ -1801,7 +1801,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -1801,7 +1801,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); dma_async_memcpy_issue_pending(tp->ucopy.dma_chan);
if ((offset + used) == skb->len) if ((offset + used) == skb->len)
copied_early = 1; copied_early = true;
} else } else
#endif #endif
...@@ -1835,7 +1835,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -1835,7 +1835,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
goto found_fin_ok; goto found_fin_ok;
if (!(flags & MSG_PEEK)) { if (!(flags & MSG_PEEK)) {
sk_eat_skb(sk, skb, copied_early); sk_eat_skb(sk, skb, copied_early);
copied_early = 0; copied_early = false;
} }
continue; continue;
...@@ -1844,7 +1844,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -1844,7 +1844,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
++*seq; ++*seq;
if (!(flags & MSG_PEEK)) { if (!(flags & MSG_PEEK)) {
sk_eat_skb(sk, skb, copied_early); sk_eat_skb(sk, skb, copied_early);
copied_early = 0; copied_early = false;
} }
break; break;
} while (len > 0); } while (len > 0);
......
...@@ -838,7 +838,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -838,7 +838,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
if (!(flags & MSG_PEEK)) { if (!(flags & MSG_PEEK)) {
spin_lock_irqsave(&sk->sk_receive_queue.lock, cpu_flags); spin_lock_irqsave(&sk->sk_receive_queue.lock, cpu_flags);
sk_eat_skb(sk, skb, 0); sk_eat_skb(sk, skb, false);
spin_unlock_irqrestore(&sk->sk_receive_queue.lock, cpu_flags); spin_unlock_irqrestore(&sk->sk_receive_queue.lock, cpu_flags);
*seq = 0; *seq = 0;
} }
...@@ -861,7 +861,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -861,7 +861,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
if (!(flags & MSG_PEEK)) { if (!(flags & MSG_PEEK)) {
spin_lock_irqsave(&sk->sk_receive_queue.lock, cpu_flags); spin_lock_irqsave(&sk->sk_receive_queue.lock, cpu_flags);
sk_eat_skb(sk, skb, 0); sk_eat_skb(sk, skb, false);
spin_unlock_irqrestore(&sk->sk_receive_queue.lock, cpu_flags); spin_unlock_irqrestore(&sk->sk_receive_queue.lock, cpu_flags);
*seq = 0; *seq = 0;
} }
......
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