* [PATCH] Net: core: stream.c: coding style fixes
@ 2015-09-11 20:13 Krzysztof Majzerowicz-Jaszcz
2015-09-11 20:24 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Majzerowicz-Jaszcz @ 2015-09-11 20:13 UTC (permalink / raw)
To: davem; +Cc: edumazet, netdev, Krzysztof Majzerowicz-Jaszcz
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(-)
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, ¤t_timeo, sk->sk_err ||
- (sk->sk_shutdown & SEND_SHUTDOWN) ||
- (sk_stream_memory_free(sk) &&
- !vm_wait));
+ sk_wait_event(sk, ¤t_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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Net: core: stream.c: coding style fixes
2015-09-11 20:13 [PATCH] Net: core: stream.c: coding style fixes Krzysztof Majzerowicz-Jaszcz
@ 2015-09-11 20:24 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2015-09-11 20:24 UTC (permalink / raw)
To: Krzysztof Majzerowicz-Jaszcz; +Cc: davem, edumazet, netdev
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-11 20:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11 20:13 [PATCH] Net: core: stream.c: coding style fixes Krzysztof Majzerowicz-Jaszcz
2015-09-11 20:24 ` Stephen Hemminger
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).