The malloc type argument is unused and should be NULL. This script finds and fixes those places.
Signed-off-by: Stephen Hemminger <step...@networkplumber.org> --- devtools/cocci/malloc-type.cocci | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 devtools/cocci/malloc-type.cocci diff --git a/devtools/cocci/malloc-type.cocci b/devtools/cocci/malloc-type.cocci new file mode 100644 index 0000000000..d1101927e0 --- /dev/null +++ b/devtools/cocci/malloc-type.cocci @@ -0,0 +1,27 @@ +// +// The allocation name field in malloc routines was never +// implemented and should be NULL +// +@@ +expression T != NULL; +expression num, socket, size, align; +@@ +( +- rte_malloc(T, size, align) ++ rte_malloc(NULL, size, align) +| +- rte_zmalloc(T, size, align) ++ rte_zmalloc(NULL, size, align) +| +- rte_calloc(T, num, size, align) ++ rte_calloc(NULL, num, size, align) +| +- rte_malloc_socket(T, size, align, socket) ++ rte_malloc_socket(NULL, size, align, socket) +| +- rte_zmalloc_socket(T, size, align, socket) ++ rte_zmalloc_socket(NULL, size, align, socket) +| +- rte_calloc_socket(T, num, size, align, socket) ++ rte_calloc_socket(NULL, num, size, align, socket) +) -- 2.43.0