netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Majzerowicz-Jaszcz <cristos@vipserv.org>
To: davem@davemloft.net
Cc: edumazet@google.com, netdev@vger.kernel.org,
	Krzysztof Majzerowicz-Jaszcz <cristos@vipserv.org>
Subject: [PATCH v2] Net: core: stream.c: coding style fixes
Date: Sat, 12 Sep 2015 09:24:32 +0200	[thread overview]
Message-ID: <1442042672-20108-1-git-send-email-cristos@vipserv.org> (raw)

Fixed coding style issues reported by checkpatch.pl

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

diff --git a/net/core/stream.c b/net/core/stream.c
index d70f77a..c089589 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -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;
-- 
2.5.1

                 reply	other threads:[~2015-09-12  7:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442042672-20108-1-git-send-email-cristos@vipserv.org \
    --to=cristos@vipserv.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).