summaryrefslogtreecommitdiff
path: root/lib/librte_port
diff options
context:
space:
mode:
authorCyril Chemparathy <cchemparathy@ezchip.com>2015-06-22 11:34:23 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-06-24 12:01:14 +0200
commit82be8d544253a4b5c49b778babf717e5e63f3dc1 (patch)
tree1d9c9300f80d01bdee7b53e944ac9aeb816d6090 /lib/librte_port
parent3790a7fcf0c3a7548b95927b566240738e2df7ce (diff)
downloaddpdk-next-eventdev-82be8d544253a4b5c49b778babf717e5e63f3dc1.zip
dpdk-next-eventdev-82be8d544253a4b5c49b778babf717e5e63f3dc1.tar.gz
dpdk-next-eventdev-82be8d544253a4b5c49b778babf717e5e63f3dc1.tar.xz
mbuf: use offset macro
This patch simply applies the transform previously committed in scripts/cocci/mtod-offset.cocci. No other modifications have been made here. Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'lib/librte_port')
-rw-r--r--lib/librte_port/rte_port_ras.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/librte_port/rte_port_ras.c b/lib/librte_port/rte_port_ras.c
index 2c1822a..6bd0f8c 100644
--- a/lib/librte_port/rte_port_ras.c
+++ b/lib/librte_port/rte_port_ras.c
@@ -180,8 +180,7 @@ static void
process_ipv4(struct rte_port_ring_writer_ras *p, struct rte_mbuf *pkt)
{
/* Assume there is no ethernet header */
- struct ipv4_hdr *pkt_hdr = (struct ipv4_hdr *)
- (rte_pktmbuf_mtod(pkt, unsigned char *));
+ struct ipv4_hdr *pkt_hdr = rte_pktmbuf_mtod(pkt, struct ipv4_hdr *);
/* Get "Do not fragment" flag and fragment offset */
uint16_t frag_field = rte_be_to_cpu_16(pkt_hdr->fragment_offset);
@@ -210,8 +209,7 @@ static void
process_ipv6(struct rte_port_ring_writer_ras *p, struct rte_mbuf *pkt)
{
/* Assume there is no ethernet header */
- struct ipv6_hdr *pkt_hdr = (struct ipv6_hdr *)
- (rte_pktmbuf_mtod(pkt, unsigned char *));
+ struct ipv6_hdr *pkt_hdr = rte_pktmbuf_mtod(pkt, struct ipv6_hdr *);
struct ipv6_extension_fragment *frag_hdr;
frag_hdr = rte_ipv6_frag_get_ipv6_fragment_header(pkt_hdr);