[v3,5/5] lib/eal: remove unneeded header includes

Message ID 20211007102557.188739-6-sean.morrissey@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series introduce IWYU |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues
ci/github-robot: build success github build: passed

Commit Message

Sean Morrissey Oct. 7, 2021, 10:25 a.m. UTC
These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>

Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
---
 lib/eal/common/eal_common_dev.c        |  5 -----
 lib/eal/common/eal_common_devargs.c    |  1 -
 lib/eal/common/eal_common_errno.c      |  4 ----
 lib/eal/common/eal_common_fbarray.c    |  3 ---
 lib/eal/common/eal_common_hexdump.c    |  3 ---
 lib/eal/common/eal_common_launch.c     |  6 ------
 lib/eal/common/eal_common_lcore.c      |  7 +------
 lib/eal/common/eal_common_log.c        |  2 --
 lib/eal/common/eal_common_memalloc.c   |  3 ---
 lib/eal/common/eal_common_memory.c     |  5 -----
 lib/eal/common/eal_common_memzone.c    |  4 ----
 lib/eal/common/eal_common_options.c    |  2 --
 lib/eal/common/eal_common_proc.c       |  2 --
 lib/eal/common/eal_common_string_fns.c |  2 --
 lib/eal/common/eal_common_tailqs.c     | 11 -----------
 lib/eal/common/eal_common_thread.c     |  3 ---
 lib/eal/common/eal_common_timer.c      |  6 ------
 lib/eal/common/eal_common_trace.c      |  1 -
 lib/eal/common/hotplug_mp.h            |  1 -
 lib/eal/common/malloc_elem.c           |  6 ------
 lib/eal/common/malloc_heap.c           |  5 -----
 lib/eal/common/malloc_mp.c             |  1 -
 lib/eal/common/malloc_mp.h             |  2 --
 lib/eal/common/rte_malloc.c            |  6 ------
 lib/eal/common/rte_random.c            |  3 ---
 lib/eal/common/rte_service.c           |  6 ------
 lib/eal/include/rte_version.h          |  2 --
 lib/eal/linux/eal.c                    | 10 ----------
 lib/eal/linux/eal_alarm.c              |  7 -------
 lib/eal/linux/eal_cpuflags.c           |  2 --
 lib/eal/linux/eal_debug.c              |  5 -----
 lib/eal/linux/eal_dev.c                |  4 ----
 lib/eal/linux/eal_hugepage_info.c      |  8 --------
 lib/eal/linux/eal_interrupts.c         |  8 --------
 lib/eal/linux/eal_lcore.c              |  7 -------
 lib/eal/linux/eal_log.c                | 11 +----------
 lib/eal/linux/eal_memalloc.c           |  8 --------
 lib/eal/linux/eal_memory.c             |  9 ---------
 lib/eal/linux/eal_thread.c             |  5 -----
 lib/eal/linux/eal_timer.c              | 15 ---------------
 lib/eal/linux/eal_vfio_mp_sync.c       |  1 -
 lib/eal/unix/eal_file.c                |  1 -
 lib/eal/unix/rte_thread.c              |  1 -
 lib/eal/x86/rte_cycles.c               |  1 -
 44 files changed, 2 insertions(+), 203 deletions(-)
  

Patch

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 148a23830a..12bf3d3c22 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -5,20 +5,15 @@ 
 
 #include <stdio.h>
 #include <string.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 
-#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_class.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
-#include <rte_debug.h>
 #include <rte_errno.h>
-#include <rte_kvargs.h>
 #include <rte_log.h>
 #include <rte_spinlock.h>
-#include <rte_malloc.h>
 #include <rte_string_fns.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c
index 7ab9e71b2a..f4beb35591 100644
--- a/lib/eal/common/eal_common_devargs.c
+++ b/lib/eal/common/eal_common_devargs.c
@@ -12,7 +12,6 @@ 
 
 #include <rte_bus.h>
 #include <rte_class.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_errno.h>
diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index f86802705a..1091065568 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -5,15 +5,11 @@ 
 /* Use XSI-compliant portable version of strerror_r() */
 #undef _GNU_SOURCE
 
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 
 #include <rte_per_lcore.h>
 #include <rte_errno.h>
-#include <rte_string_fns.h>
 
 #ifdef RTE_EXEC_ENV_WINDOWS
 #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 3a28a53247..f11f87979f 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -2,7 +2,6 @@ 
  * Copyright(c) 2017-2018 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <stdint.h>
@@ -14,9 +13,7 @@ 
 #include <rte_eal_paging.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 #include "eal_filesystem.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_hexdump.c b/lib/eal/common/eal_common_hexdump.c
index 2d2179d411..63bbbdcf0a 100644
--- a/lib/eal/common/eal_common_hexdump.c
+++ b/lib/eal/common/eal_common_hexdump.c
@@ -1,10 +1,7 @@ 
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2010-2014 Intel Corporation
  */
-#include <stdlib.h>
 #include <stdio.h>
-#include <errno.h>
-#include <stdint.h>
 #include <rte_hexdump.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
index 34f854ad80..2a20b32a77 100644
--- a/lib/eal/common/eal_common_launch.c
+++ b/lib/eal/common/eal_common_launch.c
@@ -3,16 +3,10 @@ 
  */
 
 #include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/queue.h>
 
 #include <rte_launch.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_atomic.h>
 #include <rte_pause.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index 66d6bad1a7..c747353b17 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -2,19 +2,14 @@ 
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <unistd.h>
-#include <limits.h>
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_debug.h>
-#include <rte_eal.h>
+#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_rwlock.h>
 
-#include "eal_memcfg.h"
 #include "eal_private.h"
 #include "eal_thread.h"
 
diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index ec8fe23a7f..24afb57c89 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -11,9 +11,7 @@ 
 #include <regex.h>
 #include <fnmatch.h>
 
-#include <rte_eal.h>
 #include <rte_log.h>
-#include <rte_os_shim.h>
 #include <rte_per_lcore.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/common/eal_common_memalloc.c b/lib/eal/common/eal_common_memalloc.c
index e872c6533b..f8770ff835 100644
--- a/lib/eal/common/eal_common_memalloc.c
+++ b/lib/eal/common/eal_common_memalloc.c
@@ -5,12 +5,9 @@ 
 #include <string.h>
 
 #include <rte_errno.h>
-#include <rte_lcore.h>
 #include <rte_fbarray.h>
-#include <rte_memzone.h>
 #include <rte_memory.h>
 #include <rte_string_fns.h>
-#include <rte_rwlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index f83b75092e..bb0da9e50a 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -2,16 +2,11 @@ 
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
 #include <string.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
 
 #include <rte_fbarray.h>
 #include <rte_memory.h>
diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c
index 7c21aa921e..67dcaaafbf 100644
--- a/lib/eal/common/eal_common_memzone.c
+++ b/lib/eal/common/eal_common_memzone.c
@@ -2,20 +2,16 @@ 
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/queue.h>
 
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_common.h>
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index eaef57312f..1eb51be09c 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -4,7 +4,6 @@ 
  */
 
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <syslog.h>
@@ -17,7 +16,6 @@ 
 #include <dlfcn.h>
 #include <libgen.h>
 #endif
-#include <sys/types.h>
 #include <sys/stat.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index ebd0f6673b..575b4ca24d 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -15,7 +15,6 @@ 
 #include <string.h>
 #include <sys/file.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -27,7 +26,6 @@ 
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_tailq.h>
 
 #include "eal_memcfg.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_string_fns.c b/lib/eal/common/eal_common_string_fns.c
index ddd1891656..0236ae4023 100644
--- a/lib/eal/common/eal_common_string_fns.c
+++ b/lib/eal/common/eal_common_string_fns.c
@@ -2,9 +2,7 @@ 
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 
 #include <rte_string_fns.h>
diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c
index ead06897b8..580fbf24bc 100644
--- a/lib/eal/common/eal_common_tailqs.c
+++ b/lib/eal/common/eal_common_tailqs.c
@@ -3,24 +3,13 @@ 
  */
 
 #include <sys/queue.h>
-#include <stdint.h>
-#include <errno.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
-#include <inttypes.h>
 
-#include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_memcfg.h"
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 1a52f42a2b..cfa6a69ad4 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -4,10 +4,7 @@ 
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <pthread.h>
-#include <signal.h>
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
diff --git a/lib/eal/common/eal_common_timer.c b/lib/eal/common/eal_common_timer.c
index 86f8429847..5686a5102b 100644
--- a/lib/eal/common/eal_common_timer.c
+++ b/lib/eal/common/eal_common_timer.c
@@ -2,16 +2,10 @@ 
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <time.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
 #include <rte_pause.h>
diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
index 7bff1cd2ce..036f6ac348 100644
--- a/lib/eal/common/eal_common_trace.c
+++ b/lib/eal/common/eal_common_trace.c
@@ -3,7 +3,6 @@ 
  */
 
 #include <fnmatch.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 #include <regex.h>
 
diff --git a/lib/eal/common/hotplug_mp.h b/lib/eal/common/hotplug_mp.h
index 8fcf9b52e2..066494ff27 100644
--- a/lib/eal/common/hotplug_mp.h
+++ b/lib/eal/common/hotplug_mp.h
@@ -6,7 +6,6 @@ 
 #define _HOTPLUG_MP_H_
 
 #include "rte_dev.h"
-#include "rte_bus.h"
 
 #define EAL_DEV_MP_ACTION_REQUEST      "eal_dev_mp_request"
 #define EAL_DEV_MP_ACTION_RESPONSE     "eal_dev_mp_response"
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index c2c9461f1d..4c6e6f4910 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -6,17 +6,11 @@ 
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/queue.h>
 
 #include <rte_memory.h>
 #include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_debug.h>
 #include <rte_common.h>
-#include <rte_spinlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index ee400f38ec..61f0a5d84f 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -5,7 +5,6 @@ 
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <sys/queue.h>
 
@@ -13,15 +12,11 @@ 
 #include <rte_errno.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_atomic.h>
 #include <rte_fbarray.h>
 
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index 2e597a17a2..801b2e7fbd 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -5,7 +5,6 @@ 
 #include <string.h>
 #include <sys/time.h>
 
-#include <rte_alarm.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/malloc_mp.h b/lib/eal/common/malloc_mp.h
index 0095062b72..fb10817e13 100644
--- a/lib/eal/common/malloc_mp.h
+++ b/lib/eal/common/malloc_mp.h
@@ -10,8 +10,6 @@ 
 
 #include <rte_common.h>
 #include <rte_random.h>
-#include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 /* forward declarations */
 struct malloc_heap;
diff --git a/lib/eal/common/rte_malloc.c b/lib/eal/common/rte_malloc.c
index 9d39e58c08..6c69a2cf3b 100644
--- a/lib/eal/common/rte_malloc.c
+++ b/lib/eal/common/rte_malloc.c
@@ -6,18 +6,12 @@ 
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
 
 #include <rte_errno.h>
 #include <rte_memcpy.h>
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_branch_prediction.h>
-#include <rte_debug.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c
index ce21c2242a..4535cc980c 100644
--- a/lib/eal/common/rte_random.c
+++ b/lib/eal/common/rte_random.c
@@ -5,14 +5,11 @@ 
 #ifdef __RDSEED__
 #include <x86intrin.h>
 #endif
-#include <stdlib.h>
 #include <unistd.h>
 
 #include <rte_branch_prediction.h>
 #include <rte_cycles.h>
-#include <rte_eal.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_random.h>
 
 struct rte_rand_state {
diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index bd8fb72e78..ef31b1f63c 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -3,22 +3,16 @@ 
  */
 
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <limits.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_service.h>
 #include <rte_service_component.h>
 
-#include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_debug.h>
 #include <rte_cycles.h>
 #include <rte_atomic.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/include/rte_version.h b/lib/eal/include/rte_version.h
index b06a62e7a2..414b6167f2 100644
--- a/lib/eal/include/rte_version.h
+++ b/lib/eal/include/rte_version.h
@@ -14,10 +14,8 @@ 
 extern "C" {
 #endif
 
-#include <stdint.h>
 #include <string.h>
 #include <stdio.h>
-#include <rte_common.h>
 #include <rte_compat.h>
 
 /**
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 3577eaeaa4..f55d1860d8 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -7,10 +7,8 @@ 
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <syslog.h>
 #include <getopt.h>
 #include <sys/file.h>
 #include <dirent.h>
@@ -20,32 +18,24 @@ 
 #include <errno.h>
 #include <limits.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 #if defined(RTE_ARCH_X86)
 #include <sys/io.h>
 #endif
 #include <linux/version.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_errno.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_service_component.h>
 #include <rte_log.h>
-#include <rte_random.h>
-#include <rte_cycles.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
-#include <rte_interrupts.h>
 #include <rte_bus.h>
-#include <rte_dev.h>
-#include <rte_devargs.h>
 #include <rte_version.h>
 #include <malloc_heap.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c
index 3252c6fa59..43f6bb14f2 100644
--- a/lib/eal/linux/eal_alarm.c
+++ b/lib/eal/linux/eal_alarm.c
@@ -3,21 +3,14 @@ 
  */
 #include <stdio.h>
 #include <stdint.h>
-#include <signal.h>
 #include <errno.h>
-#include <string.h>
 #include <sys/queue.h>
 #include <sys/time.h>
 #include <sys/timerfd.h>
 
-#include <rte_memory.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_common.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_cpuflags.c b/lib/eal/linux/eal_cpuflags.c
index d38296e1e5..c684940e1d 100644
--- a/lib/eal/linux/eal_cpuflags.c
+++ b/lib/eal/linux/eal_cpuflags.c
@@ -5,8 +5,6 @@ 
 #include <elf.h>
 #include <fcntl.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c
index 64dab4e0da..b0ecf5a9dc 100644
--- a/lib/eal/linux/eal_debug.c
+++ b/lib/eal/linux/eal_debug.c
@@ -5,16 +5,11 @@ 
 #ifdef RTE_BACKTRACE
 #include <execinfo.h>
 #endif
-#include <stdarg.h>
-#include <signal.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_common.h>
-#include <rte_eal.h>
 
 #define BACKTRACE_SIZE 256
 
diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index 3b905e18f5..0a654e5b50 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -4,20 +4,16 @@ 
 
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 
 #include <rte_string_fns.h>
 #include <rte_log.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
-#include <rte_malloc.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_bus.h>
-#include <rte_eal.h>
 #include <rte_spinlock.h>
 #include <rte_errno.h>
 
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index d97792cade..b3e4c40ee7 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -3,7 +3,6 @@ 
  */
 
 #include <string.h>
-#include <sys/types.h>
 #include <sys/file.h>
 #include <dirent.h>
 #include <fcntl.h>
@@ -12,19 +11,12 @@ 
 #include <stdio.h>
 #include <fnmatch.h>
 #include <inttypes.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
-#include <sys/stat.h>
 
 #include <linux/mman.h> /* for hugetlb-related flags */
 
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_debug.h>
 #include <rte_log.h>
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 22b3b7bcd9..1d5c9b272c 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -7,13 +7,10 @@ 
 #include <stdlib.h>
 #include <pthread.h>
 #include <sys/queue.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <inttypes.h>
 #include <sys/epoll.h>
-#include <sys/signalfd.h>
 #include <sys/ioctl.h>
 #include <sys/eventfd.h>
 #include <assert.h>
@@ -21,9 +18,6 @@ 
 
 #include <rte_common.h>
 #include <rte_interrupts.h>
-#include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
@@ -36,8 +30,6 @@ 
 #include <rte_eal_trace.h>
 
 #include "eal_private.h"
-#include "eal_vfio.h"
-#include "eal_thread.h"
 
 #define EAL_INTR_EPOLL_WAIT_FOREVER (-1)
 #define NB_OTHER_INTR               1
diff --git a/lib/eal/linux/eal_lcore.c b/lib/eal/linux/eal_lcore.c
index bc8965844c..2e6a350603 100644
--- a/lib/eal/linux/eal_lcore.c
+++ b/lib/eal/linux/eal_lcore.c
@@ -4,15 +4,8 @@ 
 
 #include <unistd.h>
 #include <limits.h>
-#include <string.h>
-#include <dirent.h>
 
 #include <rte_log.h>
-#include <rte_eal.h>
-#include <rte_lcore.h>
-#include <rte_common.h>
-#include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_filesystem.h"
diff --git a/lib/eal/linux/eal_log.c b/lib/eal/linux/eal_log.c
index c0aa1007c4..9e72412e2b 100644
--- a/lib/eal/linux/eal_log.c
+++ b/lib/eal/linux/eal_log.c
@@ -2,19 +2,10 @@ 
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <sys/types.h>
 #include <syslog.h>
-#include <sys/queue.h>
-
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_spinlock.h>
+
 #include <rte_log.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 0ec8542283..e3aba10107 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -3,23 +3,17 @@ 
  */
 
 #include <errno.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <unistd.h>
 #include <limits.h>
 #include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
@@ -36,9 +30,7 @@ 
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_eal.h>
-#include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_spinlock.h>
 
 #include "eal_filesystem.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 03a4f2dd2d..40ec9663d0 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -5,7 +5,6 @@ 
 
 #include <errno.h>
 #include <fcntl.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -13,19 +12,14 @@ 
 #include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <limits.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
-#include <linux/memfd.h>
 #define MEMFD_SUPPORTED
 #endif
 #ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
@@ -36,12 +30,9 @@ 
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_string_fns.h>
 
 #include "eal_private.h"
 #include "eal_memalloc.h"
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index 83c2034b93..60fa64ea55 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -4,20 +4,15 @@ 
 
 #include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <sched.h>
-#include <sys/queue.h>
 #include <sys/syscall.h>
 
 #include <rte_debug.h>
 #include <rte_atomic.h>
 #include <rte_launch.h>
 #include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c
index 7cf15cabac..620baf038d 100644
--- a/lib/eal/linux/eal_timer.c
+++ b/lib/eal/linux/eal_timer.c
@@ -3,28 +3,13 @@ 
  * Copyright(c) 2012-2013 6WIND S.A.
  */
 
-#include <string.h>
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <sys/mman.h>
-#include <sys/queue.h>
-#include <pthread.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_log.h>
 #include <rte_cycles.h>
-#include <rte_lcore.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
-#include "eal_internal_cfg.h"
 
 enum timer_source eal_timer_source = EAL_TIMER_HPET;
 
diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c
index a2accfab3a..e1776166af 100644
--- a/lib/eal/linux/eal_vfio_mp_sync.c
+++ b/lib/eal/linux/eal_vfio_mp_sync.c
@@ -5,7 +5,6 @@ 
 #include <unistd.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/unix/eal_file.c b/lib/eal/unix/eal_file.c
index ec554e0096..f04f5fbcbc 100644
--- a/lib/eal/unix/eal_file.c
+++ b/lib/eal/unix/eal_file.c
@@ -3,7 +3,6 @@ 
  */
 
 #include <sys/file.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 
diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c
index c72d619ec1..c34ede9186 100644
--- a/lib/eal/unix/rte_thread.c
+++ b/lib/eal/unix/rte_thread.c
@@ -7,7 +7,6 @@ 
 #include <stdlib.h>
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_thread.h>
diff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c
index edd9621abb..0e695caf28 100644
--- a/lib/eal/x86/rte_cycles.c
+++ b/lib/eal/x86/rte_cycles.c
@@ -6,7 +6,6 @@ 
 #include <unistd.h>
 #include <cpuid.h>
 
-#include <rte_common.h>
 
 #include "eal_private.h"