]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
tools: reformat and clang-format off arrays
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 9 Sep 2024 04:39:19 +0000 (23:39 -0500)
For some arrays, clang-format does far than ideal jobs reformatting. Do
so manually and ban clang-format from interfering.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/depmod.c
tools/kmod.c
tools/rmmod.c

index d177646b97fcf700d6f3d9305a3255165ab8b511..aa7331fc4a2a5b778bb4d3bf8477d687fb086e5d 100644 (file)
@@ -39,12 +39,14 @@ static int verbose = DEFAULT_VERBOSE;
 static const char CFG_BUILTIN_KEY[] = "built-in";
 static const char CFG_EXTERNAL_KEY[] = "external";
 static const char *const default_cfg_paths[] = {
+       // clang-format off
        SYSCONFDIR "/depmod.d",
        "/run/depmod.d",
        "/usr/local/lib/depmod.d",
        DISTCONFDIR "/depmod.d",
        "/lib/depmod.d",
        NULL,
+       // clang-format on
 };
 
 static const char cmdopts_s[] = "aAb:o:C:E:F:euqrvnP:wmVh";
index e5314f6cbf6a60a081b8e4e8eed66b07f99069ea..25a3c408387076934420b57f7e516de0f1520d3b 100644 (file)
@@ -32,12 +32,14 @@ static const struct kmod_cmd *kmod_cmds[] = {
 };
 
 static const struct kmod_cmd *kmod_compat_cmds[] = {
+       // clang-format off
        &kmod_cmd_compat_lsmod,
        &kmod_cmd_compat_rmmod,
        &kmod_cmd_compat_insmod,
        &kmod_cmd_compat_modinfo,
        &kmod_cmd_compat_modprobe,
        &kmod_cmd_compat_depmod,
+       // clang-format on
 };
 
 static int kmod_help(int argc, char *argv[])
index 7dacab948cb2b8916ff4e843e8af72aa82297630..c353fdbfdb3911df67cfa0f42298d94d7d881155 100644 (file)
@@ -26,12 +26,14 @@ static int use_syslog;
 
 static const char cmdopts_s[] = "fsvVwh";
 static const struct option cmdopts[] = {
-       {"force", no_argument, 0, 'f'},
-       {"syslog", no_argument, 0, 's'},
-       {"verbose", no_argument, 0, 'v'},
-       {"version", no_argument, 0, 'V'},
-       {"help", no_argument, 0, 'h'},
-       {NULL, 0, 0, 0},
+       // clang-format off
+       { "force", no_argument, 0, 'f' },
+       { "syslog", no_argument, 0, 's' },
+       { "verbose", no_argument, 0, 'v' },
+       { "version", no_argument, 0, 'V' },
+       { "help", no_argument, 0, 'h' },
+       { NULL, 0, 0, 0 },
+       // clang-format on
 };
 
 static void help(void)