[PATCH v2 1/3] lib/vsprintf: Sort headers alphabetically

From: Andy Shevchenko
Date: Sat Aug 05 2023 - 13:49:38 EST


Sorting headers alphabetically helps locating duplicates, and
make it easier to figure out where to insert new headers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
lib/test_printf.c | 17 +++++++----------
lib/vsprintf.c | 38 ++++++++++++++++++++------------------
2 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/lib/test_printf.c b/lib/test_printf.c
index 7677ebccf3c3..2ab09a0dc841 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -5,24 +5,21 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

+#include <linux/bitmap.h>
+#include <linux/dcache.h>
+#include <linux/gfp.h>
+#include <linux/in.h>
#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/mm.h>
#include <linux/module.h>
#include <linux/printk.h>
+#include <linux/property.h>
#include <linux/random.h>
#include <linux/rtc.h>
#include <linux/slab.h>
-#include <linux/string.h>
-
-#include <linux/bitmap.h>
-#include <linux/dcache.h>
#include <linux/socket.h>
-#include <linux/in.h>
-
-#include <linux/gfp.h>
-#include <linux/mm.h>
-
-#include <linux/property.h>
+#include <linux/string.h>

#include "../tools/testing/selftests/kselftest_module.h"

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 40f560959b16..b17e0744a7bc 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -17,42 +17,44 @@
* - scnprintf and vscnprintf
*/

-#include <linux/stdarg.h>
#include <linux/build_bug.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
-#include <linux/errname.h>
-#include <linux/module.h> /* for KSYM_SYMBOL_LEN */
-#include <linux/types.h>
-#include <linux/string.h>
+#include <linux/compiler.h>
+#include <linux/cred.h>
#include <linux/ctype.h>
-#include <linux/kernel.h>
+#include <linux/dcache.h>
+#include <linux/errname.h>
+#include <linux/ioport.h>
#include <linux/kallsyms.h>
+#include <linux/kernel.h>
#include <linux/math64.h>
-#include <linux/uaccess.h>
-#include <linux/ioport.h>
-#include <linux/dcache.h>
-#include <linux/cred.h>
+#include <linux/module.h> /* for KSYM_SYMBOL_LEN */
+#include <linux/notifier.h>
+#include <linux/of.h>
+#include <linux/property.h>
#include <linux/rtc.h>
+#include <linux/siphash.h>
+#include <linux/stdarg.h>
+#include <linux/string.h>
+#include <linux/string_helpers.h>
#include <linux/time.h>
+#include <linux/types.h>
+#include <linux/uaccess.h>
#include <linux/uuid.h>
-#include <linux/of.h>
-#include <net/addrconf.h>
-#include <linux/siphash.h>
-#include <linux/compiler.h>
-#include <linux/property.h>
-#include <linux/notifier.h>
+
#ifdef CONFIG_BLOCK
#include <linux/blkdev.h>
#endif

+#include <net/addrconf.h>
+
#include "../mm/internal.h" /* For the trace_print_flags arrays */

-#include <asm/page.h> /* for PAGE_SIZE */
#include <asm/byteorder.h> /* cpu_to_le16 */
+#include <asm/page.h> /* for PAGE_SIZE */
#include <asm/unaligned.h>

-#include <linux/string_helpers.h>
#include "kstrtox.h"

/* Disable pointer hashing if requested */
--
2.40.0.1.gaa8946217a0b