From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <aburakov@ecsmtp.ir.intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 2A2E5B0A9
 for <dev@dpdk.org>; Wed, 28 May 2014 19:32:40 +0200 (CEST)
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga102.fm.intel.com with ESMTP; 28 May 2014 10:32:50 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.98,929,1392192000"; d="scan'208";a="546285452"
Received: from irvmail001.ir.intel.com ([163.33.26.43])
 by fmsmga002.fm.intel.com with ESMTP; 28 May 2014 10:32:49 -0700
Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com
 [10.237.217.46])
 by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id
 s4SHWmkD004034; Wed, 28 May 2014 18:32:48 +0100
Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1])
 by sivswdev02.ir.intel.com with ESMTP id s4SHWmql031675;
 Wed, 28 May 2014 18:32:48 +0100
Received: (from aburakov@localhost)
 by sivswdev02.ir.intel.com with  id s4SHWmlM031671;
 Wed, 28 May 2014 18:32:48 +0100
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Date: Wed, 28 May 2014 18:32:37 +0100
Message-Id: <53a88bb9ed1c4bc53edb821a08be496886362868.1401298292.git.anatoly.burakov@intel.com>
X-Mailer: git-send-email 1.7.0.7
In-Reply-To: <cover.1401298292.git.anatoly.burakov@intel.com>
References: <cover.1401298292.git.anatoly.burakov@intel.com>
In-Reply-To: <cover.1401298292.git.anatoly.burakov@intel.com>
References: <cover.1401298292.git.anatoly.burakov@intel.com>
Subject: [dpdk-dev] [PATCH 03/13] Fixing issues reported by checkpatch
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 28 May 2014 17:32:43 -0000


Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_ip_frag/rte_ipv4_fragmentation.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
index 2d33a7b..5f67417 100644
--- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c
+++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
@@ -60,7 +60,7 @@ if (!(exp))	{							\
 
 #else /*RTE_IPV4_FRAG_DEBUG*/
 
-#define RTE_IPV4_FRAG_ASSERT(exp)	do { } while(0)
+#define RTE_IPV4_FRAG_ASSERT(exp)	do { } while (0)
 
 #endif /*RTE_IPV4_FRAG_DEBUG*/
 
@@ -135,19 +135,19 @@ rte_ipv4_fragmentation(struct rte_mbuf *pkt_in,
 
 	/* Fragment size should be a multiply of 8. */
 	RTE_IPV4_FRAG_ASSERT(IPV4_MAX_FRAGS_PER_PACKET * frag_size >=
-	    (uint16_t)(pkt_in->pkt.pkt_len - sizeof (struct ipv4_hdr)));
+	    (uint16_t)(pkt_in->pkt.pkt_len - sizeof(struct ipv4_hdr)));
 
-	in_hdr = (struct ipv4_hdr*) pkt_in->pkt.data;
+	in_hdr = (struct ipv4_hdr *) pkt_in->pkt.data;
 	flag_offset = rte_cpu_to_be_16(in_hdr->fragment_offset);
 
 	/* If Don't Fragment flag is set */
 	if (unlikely ((flag_offset & IPV4_HDR_DF_MASK) != 0))
-		return (-ENOTSUP);
+		return -ENOTSUP;
 
 	/* Check that pkts_out is big enough to hold all fragments */
-	if (unlikely (frag_size * nb_pkts_out <
+	if (unlikely(frag_size * nb_pkts_out <
 	    (uint16_t)(pkt_in->pkt.pkt_len - sizeof (struct ipv4_hdr))))
-		return (-EINVAL);
+		return -EINVAL;
 
 	in_seg = pkt_in;
 	in_seg_data_pos = sizeof(struct ipv4_hdr);
@@ -164,7 +164,7 @@ rte_ipv4_fragmentation(struct rte_mbuf *pkt_in,
 		out_pkt = rte_pktmbuf_alloc(pool_direct);
 		if (unlikely(out_pkt == NULL)) {
 			__free_fragments(pkts_out, out_pkt_pos);
-			return (-ENOMEM);
+			return -ENOMEM;
 		}
 
 		/* Reserve space for the IP header that will be built later */
@@ -182,7 +182,7 @@ rte_ipv4_fragmentation(struct rte_mbuf *pkt_in,
 			if (unlikely(out_seg == NULL)) {
 				rte_pktmbuf_free(out_pkt);
 				__free_fragments(pkts_out, out_pkt_pos);
-				return (-ENOMEM);
+				return -ENOMEM;
 			}
 			out_seg_prev->pkt.next = out_seg;
 			out_seg_prev = out_seg;
@@ -201,18 +201,16 @@ rte_ipv4_fragmentation(struct rte_mbuf *pkt_in,
 			in_seg_data_pos += len;
 
 			/* Current output packet (i.e. fragment) done ? */
-			if (unlikely(out_pkt->pkt.pkt_len >= mtu_size)) {
+			if (unlikely(out_pkt->pkt.pkt_len >= mtu_size))
 				more_out_segs = 0;
-			}
 
 			/* Current input segment done ? */
 			if (unlikely(in_seg_data_pos == in_seg->pkt.data_len)) {
 				in_seg = in_seg->pkt.next;
 				in_seg_data_pos = 0;
 
-				if (unlikely(in_seg == NULL)) {
+				if (unlikely(in_seg == NULL))
 					more_in_segs = 0;
-				}
 			}
 		}
 
@@ -235,5 +233,5 @@ rte_ipv4_fragmentation(struct rte_mbuf *pkt_in,
 		out_pkt_pos ++;
 	}
 
-	return (out_pkt_pos);
+	return out_pkt_pos;
 }
-- 
1.8.1.4