Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756082Ab3GKTls (ORCPT ); Thu, 11 Jul 2013 15:41:48 -0400 Received: from mail-ea0-f177.google.com ([209.85.215.177]:61486 "EHLO mail-ea0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159Ab3GKTlp (ORCPT ); Thu, 11 Jul 2013 15:41:45 -0400 From: Dragos Foianu To: wensong@linux-vs.org Cc: horms@verge.net.au, ja@ssi.bg, pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, davem@davemloft.net, netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, netfilter@vger.kernel.org, coreteam@netfilter.org, linux-kernel@vger.kernel.org, Dragos Foianu Subject: [PATCH] ipvs: fixed style errors and warnings in ip_vs_conn Date: Thu, 11 Jul 2013 22:41:35 +0300 Message-Id: <1373571695-24933-1-git-send-email-dragos.foianu@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3563 Lines: 107 found with the help of checkpatch.pl Signed-off-by: Dragos Foianu --- net/netfilter/ipvs/ip_vs_conn.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c index 4c8e5c0..4927a52 100644 --- a/net/netfilter/ipvs/ip_vs_conn.c +++ b/net/netfilter/ipvs/ip_vs_conn.c @@ -77,8 +77,7 @@ static unsigned int ip_vs_conn_rnd __read_mostly; #define CT_LOCKARRAY_SIZE (1<flags & IP_VS_CONN_F_TEMPLATE)) { /* It is a normal connection, so decrease the inactconns or activeconns counter */ - if (cp->flags & IP_VS_CONN_F_INACTIVE) { + if (cp->flags & IP_VS_CONN_F_INACTIVE) atomic_dec(&dest->inactconns); - } else { + else atomic_dec(&dest->activeconns); - } } else { /* It is a persistent connection/template, so decrease the persistent connection counter */ @@ -817,7 +815,7 @@ static void ip_vs_conn_expire(unsigned long data) return; } - expire_later: +expire_later: IP_VS_DBG(7, "delayed: conn->refcnt=%d conn->n_control=%d\n", atomic_read(&cp->refcnt), atomic_read(&cp->n_control)); @@ -988,7 +986,7 @@ static void *ip_vs_conn_seq_start(struct seq_file *seq, loff_t *pos) iter->l = NULL; rcu_read_lock(); - return *pos ? ip_vs_conn_array(seq, *pos - 1) :SEQ_START_TOKEN; + return *pos ? ip_vs_conn_array(seq, *pos - 1) : SEQ_START_TOKEN; } static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -1189,10 +1187,13 @@ static inline int todrop_entry(struct ip_vs_conn *cp) /* Don't drop the entry if its number of incoming packets is not located in [0, 8] */ i = atomic_read(&cp->in_pkts); - if (i > 8 || i < 0) return 0; + if (i > 8 || i < 0) + return 0; - if (!todrop_rate[i]) return 0; - if (--todrop_counter[i] > 0) return 0; + if (!todrop_rate[i]) + return 0; + if (--todrop_counter[i] > 0) + return 0; todrop_counter[i] = todrop_rate[i]; return 1; @@ -1218,7 +1219,7 @@ void ip_vs_random_dropentry(struct net *net) if (!ip_vs_conn_net_eq(cp, net)) continue; if (cp->protocol == IPPROTO_TCP) { - switch(cp->state) { + switch (cp->state) { case IP_VS_TCP_S_SYN_RECV: case IP_VS_TCP_S_SYNACK: break; @@ -1357,9 +1358,8 @@ int __init ip_vs_conn_init(void) for (idx = 0; idx < ip_vs_conn_tab_size; idx++) INIT_HLIST_HEAD(&ip_vs_conn_tab[idx]); - for (idx = 0; idx < CT_LOCKARRAY_SIZE; idx++) { + for (idx = 0; idx < CT_LOCKARRAY_SIZE; idx++) spin_lock_init(&__ip_vs_conntbl_lock_array[idx].l); - } /* calculate the random value for connection hash */ get_random_bytes(&ip_vs_conn_rnd, sizeof(ip_vs_conn_rnd)); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/