diff mbox

Net: core: stream.c: coding style fixes

Message ID 1442002380-15526-1-git-send-email-cristos@vipserv.org
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Krzysztof Majzerowicz-Jaszcz Sept. 11, 2015, 8:13 p.m. UTC
Fixed coding style issues reported by checkpatch.pl

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <cristos@vipserv.org>
---
 net/core/stream.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

Comments

Stephen Hemminger Sept. 11, 2015, 8:24 p.m. UTC | #1
On Fri, 11 Sep 2015 22:13:00 +0200
Krzysztof Majzerowicz-Jaszcz <cristos@vipserv.org> wrote:

>   *     So we (will) share it here.
>   *
> - *     Authors:        Arnaldo Carvalho de Melo <acme@conectiva.com.br>
> - *                     (from old tcp.c code)
> - *                     Alan Cox <alan@lxorguk.ukuu.org.uk> (Borrowed comments 8-))
> + *     Authors:    Arnaldo Carvalho de Melo <acme@conectiva.com.br>
> + *                 (from old tcp.c code)
> + *                 Alan Cox <alan@lxorguk.ukuu.org.uk> (Borrowed comments 8-))
>   */
>  
>  #incl

Leave the comments alone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/stream.c b/net/core/stream.c
index d70f77a..f169de8 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -7,9 +7,9 @@ 
  *     identical sendmsg() and recvmsg() code.
  *     So we (will) share it here.
  *
- *     Authors:        Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *                     (from old tcp.c code)
- *                     Alan Cox <alan@lxorguk.ukuu.org.uk> (Borrowed comments 8-))
+ *     Authors:    Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *                 (from old tcp.c code)
+ *                 Alan Cox <alan@lxorguk.ukuu.org.uk> (Borrowed comments 8-))
  */
 
 #include <linux/module.h>
@@ -60,6 +60,7 @@  int sk_stream_wait_connect(struct sock *sk, long *timeo_p)
 
 	do {
 		int err = sock_error(sk);
+
 		if (err)
 			return err;
 		if ((1 << sk->sk_state) & ~(TCPF_SYN_SENT | TCPF_SYN_RECV))
@@ -122,9 +123,10 @@  int sk_stream_wait_memory(struct sock *sk, long *timeo_p)
 	bool noblock = (*timeo_p ? false : true);
 	DEFINE_WAIT(wait);
 
-	if (sk_stream_memory_free(sk))
-		current_timeo = vm_wait = (prandom_u32() % (HZ / 5)) + 2;
-
+	if (sk_stream_memory_free(sk)) {
+		vm_wait = (prandom_u32() % (HZ / 5)) + 2;
+		current_timeo = vm_wait;
+	}
 	while (1) {
 		set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
 
@@ -145,18 +147,19 @@  int sk_stream_wait_memory(struct sock *sk, long *timeo_p)
 
 		set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
 		sk->sk_write_pending++;
-		sk_wait_event(sk, &current_timeo, sk->sk_err ||
-						  (sk->sk_shutdown & SEND_SHUTDOWN) ||
-						  (sk_stream_memory_free(sk) &&
-						  !vm_wait));
+		sk_wait_event(sk, &current_timeo,
+			      sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN) ||
+			      (sk_stream_memory_free(sk) && !vm_wait));
 		sk->sk_write_pending--;
 
 		if (vm_wait) {
 			vm_wait -= current_timeo;
 			current_timeo = *timeo_p;
-			if (current_timeo != MAX_SCHEDULE_TIMEOUT &&
-			    (current_timeo -= vm_wait) < 0)
-				current_timeo = 0;
+			if (current_timeo != MAX_SCHEDULE_TIMEOUT) {
+				current_timeo -= vm_wait;
+				if (current_timeo < 0)
+					current_timeo = 0;
+			}
 			vm_wait = 0;
 		}
 		*timeo_p = current_timeo;