netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dragos Foianu <dragos.foianu@gmail.com>
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 <dragos.foianu@gmail.com>
Subject: [PATCH] ipvs: fixed style errors and warnings in ip_vs_conn
Date: Thu, 11 Jul 2013 22:41:35 +0300	[thread overview]
Message-ID: <1373571695-24933-1-git-send-email-dragos.foianu@gmail.com> (raw)

found with the help of checkpatch.pl

Signed-off-by: Dragos Foianu <dragos.foianu@gmail.com>
---
 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<<CT_LOCKARRAY_BITS)
 #define CT_LOCKARRAY_MASK  (CT_LOCKARRAY_SIZE-1)
 
-struct ip_vs_aligned_lock
-{
+struct ip_vs_aligned_lock {
 	spinlock_t	l;
 } __attribute__((__aligned__(SMP_CACHE_BYTES)));
 
@@ -395,7 +394,7 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p)
 struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p)
 {
 	unsigned int hash;
-	struct ip_vs_conn *cp, *ret=NULL;
+	struct ip_vs_conn *cp, *ret = NULL;
 
 	/*
 	 *	Check for "full" addressed entries
@@ -680,11 +679,10 @@ static inline void ip_vs_unbind_dest(struct ip_vs_conn *cp)
 	if (!(cp->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


                 reply	other threads:[~2013-07-11 19:41 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=1373571695-24933-1-git-send-email-dragos.foianu@gmail.com \
    --to=dragos.foianu@gmail.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=horms@verge.net.au \
    --cc=ja@ssi.bg \
    --cc=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvs-devel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=wensong@linux-vs.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).