aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/cocci
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2017-05-16 14:51:32 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2017-05-16 14:51:32 +0200
commitfca143f059a0bddd7d47b8dc2df646a891b0eb0f (patch)
tree4bfeadc905c977e45e54a90c42330553b8942e4e /scripts/cocci
parentce3d555e43e3795b5d9507fcfc76b7a0a92fd0d6 (diff)
Imported Upstream version 17.05
Diffstat (limited to 'scripts/cocci')
-rw-r--r--scripts/cocci/mtod-offset.cocci76
1 files changed, 0 insertions, 76 deletions
diff --git a/scripts/cocci/mtod-offset.cocci b/scripts/cocci/mtod-offset.cocci
deleted file mode 100644
index 13134e9d..00000000
--- a/scripts/cocci/mtod-offset.cocci
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// Replace explicit packet offset computations with rte_pktmbuf_mtod_offset().
-//
-@disable paren@
-typedef uint8_t;
-expression M, O;
-@@
-(
-- rte_pktmbuf_mtod(M, char *) + O
-+ rte_pktmbuf_mtod_offset(M, char *, O)
-|
-- rte_pktmbuf_mtod(M, char *) - O
-+ rte_pktmbuf_mtod_offset(M, char *, -O)
-|
-- rte_pktmbuf_mtod(M, unsigned char *) + O
-+ rte_pktmbuf_mtod_offset(M, unsigned char *, O)
-|
-- rte_pktmbuf_mtod(M, unsigned char *) - O
-+ rte_pktmbuf_mtod_offset(M, unsigned char *, -O)
-|
-- rte_pktmbuf_mtod(M, uint8_t *) + O
-+ rte_pktmbuf_mtod_offset(M, uint8_t *, O)
-|
-- rte_pktmbuf_mtod(M, uint8_t *) - O
-+ rte_pktmbuf_mtod_offset(M, uint8_t *, -O)
-)
-
-
-//
-// Fold subsequent offset terms into pre-existing offset used in
-// rte_pktmbuf_mtod_offset().
-//
-@disable paren@
-expression M, O1, O2;
-@@
-(
-- rte_pktmbuf_mtod_offset(M, char *, O1) + O2
-+ rte_pktmbuf_mtod_offset(M, char *, O1 + O2)
-|
-- rte_pktmbuf_mtod_offset(M, char *, O1) - O2
-+ rte_pktmbuf_mtod_offset(M, char *, O1 - O2)
-|
-- rte_pktmbuf_mtod_offset(M, unsigned char *, O1) + O2
-+ rte_pktmbuf_mtod_offset(M, unsigned char *, O1 + O2)
-|
-- rte_pktmbuf_mtod_offset(M, unsigned char *, O1) - O2
-+ rte_pktmbuf_mtod_offset(M, unsigned char *, O1 - O2)
-|
-- rte_pktmbuf_mtod_offset(M, uint8_t *, O1) + O2
-+ rte_pktmbuf_mtod_offset(M, uint8_t *, O1 + O2)
-|
-- rte_pktmbuf_mtod_offset(M, uint8_t *, O1) - O2
-+ rte_pktmbuf_mtod_offset(M, uint8_t *, O1 - O2)
-)
-
-
-//
-// Cleanup rules. Fold in double casts, remove unnecessary paranthesis, etc.
-//
-@disable paren@
-expression M, O;
-type C, T;
-@@
-(
-- (C)rte_pktmbuf_mtod_offset(M, T, O)
-+ rte_pktmbuf_mtod_offset(M, C, O)
-|
-- (rte_pktmbuf_mtod_offset(M, T, O))
-+ rte_pktmbuf_mtod_offset(M, T, O)
-|
-- (C)rte_pktmbuf_mtod(M, T)
-+ rte_pktmbuf_mtod(M, C)
-|
-- (rte_pktmbuf_mtod(M, T))
-+ rte_pktmbuf_mtod(M, T)
-)