summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2014-10-03 01:41:42 -0300
committerLucas De Marchi <lucas.demarchi@intel.com>2014-10-03 01:43:15 -0300
commitc2e4286bb98c6bec77575ac0c6f862e7ddf6394f (patch)
tree17ccffbb9bed156e4c75de36adae521cf9ffed35
parent0db718edcfca1bdaf1369d3cf3773b52fcea1406 (diff)
downloadkmod-c2e4286bb98c6bec77575ac0c6f862e7ddf6394f.tar.gz
kmod-c2e4286bb98c6bec77575ac0c6f862e7ddf6394f.tar.bz2
kmod-c2e4286bb98c6bec77575ac0c6f862e7ddf6394f.zip
Reorder and reorganize header files
Let the includes in the following order: < system headers > < libkmod > < tool > < local headers >
-rw-r--r--libkmod/libkmod-config.c12
-rw-r--r--libkmod/libkmod-elf.c4
-rw-r--r--libkmod/libkmod-file.c17
-rw-r--r--libkmod/libkmod-index.c10
-rw-r--r--libkmod/libkmod-module.c23
-rw-r--r--libkmod/libkmod-signature.c2
-rw-r--r--libkmod/libkmod-util.c8
-rw-r--r--libkmod/libkmod.c16
-rw-r--r--shared/array.c10
-rw-r--r--shared/hash.c2
-rw-r--r--shared/util.c10
-rw-r--r--testsuite/delete_module.c10
-rw-r--r--testsuite/init_module.c12
-rw-r--r--testsuite/path.c12
-rw-r--r--testsuite/test-blacklist.c9
-rw-r--r--testsuite/test-dependencies.c10
-rw-r--r--testsuite/test-depmod.c8
-rw-r--r--testsuite/test-hash.c4
-rw-r--r--testsuite/test-init.c6
-rw-r--r--testsuite/test-loaded.c9
-rw-r--r--testsuite/test-modinfo.c8
-rw-r--r--testsuite/test-modprobe.c8
-rw-r--r--testsuite/test-new-module.c9
-rw-r--r--testsuite/test-testsuite.c7
-rw-r--r--testsuite/test-util.c5
-rw-r--r--testsuite/testsuite.c7
-rw-r--r--testsuite/uname.c6
-rw-r--r--tools/depmod.c31
-rw-r--r--tools/insmod.c7
-rw-r--r--tools/kmod.c6
-rw-r--r--tools/log.c3
-rw-r--r--tools/lsmod.c9
-rw-r--r--tools/modinfo.c15
-rw-r--r--tools/modprobe.c16
-rw-r--r--tools/rmmod.c12
-rw-r--r--tools/static-nodes.c12
36 files changed, 186 insertions, 169 deletions
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 3bbc866..e248d3c 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -19,17 +19,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
#include <string.h>
-#include <ctype.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <dirent.h>
#include <shared/util.h>
diff --git a/libkmod/libkmod-elf.c b/libkmod/libkmod-elf.c
index 5144099..9a7b12c 100644
--- a/libkmod/libkmod-elf.c
+++ b/libkmod/libkmod-elf.c
@@ -18,11 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <assert.h>
#include <elf.h>
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
-#include <errno.h>
#include <shared/util.h>
diff --git a/libkmod/libkmod-file.c b/libkmod/libkmod-file.c
index f32ce2a..45ae4a3 100644
--- a/libkmod/libkmod-file.c
+++ b/libkmod/libkmod-file.c
@@ -18,21 +18,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <errno.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
-
-#include <shared/util.h>
-
-#include "libkmod.h"
-#include "libkmod-internal.h"
-
#ifdef ENABLE_XZ
#include <lzma.h>
#endif
@@ -40,6 +34,11 @@
#include <zlib.h>
#endif
+#include <shared/util.h>
+
+#include "libkmod.h"
+#include "libkmod-internal.h"
+
struct kmod_file;
struct file_ops {
int (*load)(struct kmod_file *file);
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c
index db431d2..e8e8032 100644
--- a/libkmod/libkmod-index.c
+++ b/libkmod/libkmod-index.c
@@ -18,14 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <arpa/inet.h> /* htonl */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <arpa/inet.h>
+#include <assert.h>
#include <errno.h>
#include <fnmatch.h>
-#include <assert.h>
#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <shared/macro.h>
#include <shared/util.h>
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index b22f400..ac6b71a 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -19,24 +19,23 @@
*/
#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <fnmatch.h>
#include <inttypes.h>
#include <limits.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/mman.h>
+#include <sys/stat.h>
#include <sys/syscall.h>
+#include <sys/types.h>
#include <sys/wait.h>
-#include <fnmatch.h>
-
#ifdef HAVE_LINUX_MODULE_H
#include <linux/module.h>
#endif
diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
index 96712e4..b7ef5f4 100644
--- a/libkmod/libkmod-signature.c
+++ b/libkmod/libkmod-signature.c
@@ -20,9 +20,9 @@
#include <endian.h>
#include <stdint.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
#include <shared/missing.h>
#include <shared/util.h>
diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c
index ea90bbb..fd43838 100644
--- a/libkmod/libkmod-util.c
+++ b/libkmod/libkmod-util.c
@@ -20,13 +20,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <ctype.h>
+#include <stdarg.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <unistd.h>
#include <string.h>
-#include <ctype.h>
+#include <unistd.h>
#include <shared/util.h>
diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
index 3dc5a2b..040a810 100644
--- a/libkmod/libkmod.c
+++ b/libkmod/libkmod.c
@@ -19,18 +19,18 @@
*/
#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <limits.h>
-#include <unistd.h>
+#include <ctype.h>
#include <errno.h>
#include <fnmatch.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
-#include <sys/utsname.h>
+#include <unistd.h>
#include <sys/stat.h>
+#include <sys/utsname.h>
#include <shared/hash.h>
#include <shared/util.h>
diff --git a/shared/array.c b/shared/array.c
index b37e54e..865b3e8 100644
--- a/shared/array.c
+++ b/shared/array.c
@@ -18,14 +18,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <shared/array.h>
-
-#include "libkmod.h"
-
#include <assert.h>
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <errno.h>
+
+#include <shared/array.h>
+
+#include <libkmod.h>
/* basic pointer array growing in steps */
diff --git a/shared/hash.c b/shared/hash.c
index d2f5a78..99057ef 100644
--- a/shared/hash.c
+++ b/shared/hash.c
@@ -18,10 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
-#include <errno.h>
#include <shared/hash.h>
#include <shared/util.h>
diff --git a/shared/util.c b/shared/util.c
index 2d44107..0113967 100644
--- a/shared/util.c
+++ b/shared/util.c
@@ -21,14 +21,14 @@
*/
#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
#include <string.h>
-#include <ctype.h>
+#include <unistd.h>
#include <shared/util.h>
diff --git a/testsuite/delete_module.c b/testsuite/delete_module.c
index 9718894..8cb9d73 100644
--- a/testsuite/delete_module.c
+++ b/testsuite/delete_module.c
@@ -17,18 +17,18 @@
*/
#include <assert.h>
-#include <errno.h>
#include <dirent.h>
-#include <fcntl.h>
#include <dlfcn.h>
+#include <errno.h>
+#include <fcntl.h>
#include <limits.h>
-#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
-#include <string.h>
#include <stdio.h>
-#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include "testsuite.h"
diff --git a/testsuite/init_module.c b/testsuite/init_module.c
index edbba07..2af1828 100644
--- a/testsuite/init_module.c
+++ b/testsuite/init_module.c
@@ -22,23 +22,23 @@
#endif
#include <assert.h>
+#include <dirent.h>
+#include <dlfcn.h>
#include <elf.h>
#include <errno.h>
-#include <dirent.h>
#include <fcntl.h>
-#include <dlfcn.h>
#include <limits.h>
-#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
-#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/mman.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/syscall.h>
+#include <sys/types.h>
#include <sys/utsname.h>
-#include <unistd.h>
#include <shared/util.h>
diff --git a/testsuite/path.c b/testsuite/path.c
index f87f5c5..c27fabe 100644
--- a/testsuite/path.c
+++ b/testsuite/path.c
@@ -17,18 +17,18 @@
*/
#include <assert.h>
-#include <errno.h>
#include <dirent.h>
-#include <fcntl.h>
#include <dlfcn.h>
+#include <errno.h>
+#include <fcntl.h>
#include <limits.h>
-#include <stdlib.h>
#include <stdarg.h>
-#include <string.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include "testsuite.h"
diff --git a/testsuite/test-blacklist.c b/testsuite/test-blacklist.c
index 5b88caf..0937391 100644
--- a/testsuite/test-blacklist.c
+++ b/testsuite/test-blacklist.c
@@ -16,13 +16,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
#include <errno.h>
-#include <unistd.h>
#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+
#include <libkmod.h>
/* good luck bulding a kmod_list outside of the library... makes this blacklist
diff --git a/testsuite/test-dependencies.c b/testsuite/test-dependencies.c
index cdd8066..98e8f76 100644
--- a/testsuite/test-dependencies.c
+++ b/testsuite/test-dependencies.c
@@ -16,16 +16,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
#include <errno.h>
-#include <unistd.h>
#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+
#include <libkmod.h>
#include "testsuite.h"
+
#define TEST_UNAME "4.0.20-kmod"
static int test_dependencies(const struct test *t)
diff --git a/testsuite/test-depmod.c b/testsuite/test-depmod.c
index ae53753..ca9633c 100644
--- a/testsuite/test-depmod.c
+++ b/testsuite/test-depmod.c
@@ -16,13 +16,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
#include <errno.h>
-#include <unistd.h>
#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "testsuite.h"
diff --git a/testsuite/test-hash.c b/testsuite/test-hash.c
index 61260d9..236dd72 100644
--- a/testsuite/test-hash.c
+++ b/testsuite/test-hash.c
@@ -16,11 +16,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <errno.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stddef.h>
#include <string.h>
-#include <errno.h>
#include <unistd.h>
#include <shared/hash.h>
diff --git a/testsuite/test-init.c b/testsuite/test-init.c
index d2aa4bd..06c67d0 100644
--- a/testsuite/test-init.c
+++ b/testsuite/test-init.c
@@ -16,12 +16,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <errno.h>
+#include <inttypes.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stddef.h>
#include <string.h>
-#include <errno.h>
#include <unistd.h>
+
#include <libkmod.h>
#include "testsuite.h"
diff --git a/testsuite/test-loaded.c b/testsuite/test-loaded.c
index 4b50813..8f7b449 100644
--- a/testsuite/test-loaded.c
+++ b/testsuite/test-loaded.c
@@ -16,13 +16,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
#include <errno.h>
-#include <unistd.h>
#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+
#include <libkmod.h>
#include "testsuite.h"
diff --git a/testsuite/test-modinfo.c b/testsuite/test-modinfo.c
index 918ed3a..5427cdc 100644
--- a/testsuite/test-modinfo.c
+++ b/testsuite/test-modinfo.c
@@ -16,13 +16,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
#include <errno.h>
-#include <unistd.h>
#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "testsuite.h"
diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c
index d7663e6..5bc18f8 100644
--- a/testsuite/test-modprobe.c
+++ b/testsuite/test-modprobe.c
@@ -16,13 +16,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
#include <errno.h>
-#include <unistd.h>
#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "testsuite.h"
diff --git a/testsuite/test-new-module.c b/testsuite/test-new-module.c
index 0892507..1658422 100644
--- a/testsuite/test-new-module.c
+++ b/testsuite/test-new-module.c
@@ -16,13 +16,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
#include <errno.h>
-#include <unistd.h>
#include <inttypes.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+
#include <libkmod.h>
#include "testsuite.h"
diff --git a/testsuite/test-testsuite.c b/testsuite/test-testsuite.c
index a22911d..44495c2 100644
--- a/testsuite/test-testsuite.c
+++ b/testsuite/test-testsuite.c
@@ -16,16 +16,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <dirent.h>
+#include <errno.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stddef.h>
#include <string.h>
-#include <dirent.h>
-#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
+
#include <libkmod.h>
#include "testsuite.h"
diff --git a/testsuite/test-util.c b/testsuite/test-util.c
index 8b6474b..17f2422 100644
--- a/testsuite/test-util.c
+++ b/testsuite/test-util.c
@@ -20,11 +20,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <libkmod.h>
#include <shared/util.h>
-#include "libkmod-util.h"
+#include <libkmod.h>
+#include <libkmod-util.h>
+
#include "testsuite.h"
static int alias_1(const struct test *t)
diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c
index 54b662b..d8acf68 100644
--- a/testsuite/testsuite.c
+++ b/testsuite/testsuite.c
@@ -16,13 +16,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <limits.h>
-#include <dirent.h>
-#include <stdio.h>
#include <stdarg.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -34,7 +34,8 @@
#include <shared/util.h>
-#include "libkmod-util.h"
+#include <libkmod-util.h>
+
#include "testsuite.h"
static const char *ANSI_HIGHLIGHT_GREEN_ON = "\x1B[1;32m";
diff --git a/testsuite/uname.c b/testsuite/uname.c
index f55c435..750abf5 100644
--- a/testsuite/uname.c
+++ b/testsuite/uname.c
@@ -16,13 +16,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <errno.h>
#include <dlfcn.h>
-#include <sys/utsname.h>
+#include <errno.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
#include <unistd.h>
+#include <sys/utsname.h>
#include "testsuite.h"
diff --git a/tools/depmod.c b/tools/depmod.c
index 69c3f3f..cb46e0c 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -16,27 +16,28 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "libkmod.h"
-#include "libkmod-util.h"
+
+#include <assert.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <errno.h>
+#include <getopt.h>
+#include <limits.h>
+#include <regex.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/utsname.h>
#include <shared/array.h>
#include <shared/hash.h>
#include <shared/macro.h>
#include <shared/util.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <errno.h>
-#include <string.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/utsname.h>
-#include <sys/stat.h>
-#include <regex.h>
-#include <assert.h>
-#include <unistd.h>
-#include <ctype.h>
+#include <libkmod.h>
+#include <libkmod-util.h>
#include "kmod.h"
diff --git a/tools/insmod.c b/tools/insmod.c
index a795d89..c3be4e4 100644
--- a/tools/insmod.c
+++ b/tools/insmod.c
@@ -17,12 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
-#include <getopt.h>
-#include <errno.h>
#include <string.h>
-#include "libkmod.h"
+
+#include <libkmod.h>
#include "kmod.h"
diff --git a/tools/kmod.c b/tools/kmod.c
index 347bb7d..4239027 100644
--- a/tools/kmod.c
+++ b/tools/kmod.c
@@ -17,12 +17,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <errno.h>
#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
+
#include <libkmod.h>
+
#include "kmod.h"
static const char options_s[] = "+hV";
diff --git a/tools/log.c b/tools/log.c
index 05f6b77..05ff96f 100644
--- a/tools/log.c
+++ b/tools/log.c
@@ -22,7 +22,8 @@
#include <stdlib.h>
#include <syslog.h>
-#include "libkmod.h"
+#include <libkmod.h>
+
#include "kmod.h"
static bool log_use_syslog;
diff --git a/tools/lsmod.c b/tools/lsmod.c
index b00a9cd..2821639 100644
--- a/tools/lsmod.c
+++ b/tools/lsmod.c
@@ -17,13 +17,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stddef.h>
-#include <errno.h>
-#include <unistd.h>
#include <string.h>
-#include "libkmod.h"
+#include <unistd.h>
+
+#include <libkmod.h>
#include "kmod.h"
diff --git a/tools/modinfo.c b/tools/modinfo.c
index 9a60d71..72ac03c 100644
--- a/tools/modinfo.c
+++ b/tools/modinfo.c
@@ -17,17 +17,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
+#include <getopt.h>
+#include <limits.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdbool.h>
-#include <getopt.h>
-#include <errno.h>
#include <string.h>
-#include <limits.h>
-#include <sys/utsname.h>
#include <sys/stat.h>
-#include "libkmod.h"
-#include "libkmod-util.h"
+#include <sys/utsname.h>
+
+#include <libkmod.h>
+#include <libkmod-util.h>
#include "kmod.h"
diff --git a/tools/modprobe.c b/tools/modprobe.c
index 5799271..b826255 100644
--- a/tools/modprobe.c
+++ b/tools/modprobe.c
@@ -18,24 +18,24 @@
*/
#include <assert.h>
+#include <errno.h>
+#include <getopt.h>
+#include <limits.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdbool.h>
-#include <getopt.h>
-#include <errno.h>
#include <string.h>
-#include <sys/types.h>
+#include <unistd.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/wait.h>
-#include <unistd.h>
-#include <limits.h>
-
-#include "libkmod.h"
#include <shared/array.h>
#include <shared/macro.h>
+#include <libkmod.h>
+
#include "kmod.h"
static int log_priority = LOG_CRIT;
diff --git a/tools/rmmod.c b/tools/rmmod.c
index 8a3c22e..c6f1aee 100644
--- a/tools/rmmod.c
+++ b/tools/rmmod.c
@@ -17,17 +17,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
+#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
-#include <getopt.h>
-#include <errno.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <unistd.h>
-#include "libkmod.h"
+#include <sys/stat.h>
+#include <sys/types.h>
+
#include <shared/macro.h>
+#include <libkmod.h>
+
#include "kmod.h"
#define DEFAULT_VERBOSE LOG_ERR
diff --git a/tools/static-nodes.c b/tools/static-nodes.c
index b7ea232..d1e3b6e 100644
--- a/tools/static-nodes.c
+++ b/tools/static-nodes.c
@@ -19,17 +19,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
+#include <getopt.h>
+#include <limits.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stddef.h>
-#include <getopt.h>
-#include <errno.h>
-#include <unistd.h>
#include <string.h>
-#include <limits.h>
-#include <sys/utsname.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/utsname.h>
#include <shared/util.h>