From: Emil Velikov Date: Sun, 8 Sep 2024 10:38:12 +0000 (+0100) Subject: tools: reformat and clang-format off arrays X-Git-Tag: v34~389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0180cb0e465767c330aa062dcfc4d515de8fdc5;p=thirdparty%2Fkmod.git tools: reformat and clang-format off arrays 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 Link: https://github.com/kmod-project/kmod/pull/118 Signed-off-by: Lucas De Marchi --- diff --git a/tools/depmod.c b/tools/depmod.c index d177646b..aa7331fc 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -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"; diff --git a/tools/kmod.c b/tools/kmod.c index e5314f6c..25a3c408 100644 --- a/tools/kmod.c +++ b/tools/kmod.c @@ -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[]) diff --git a/tools/rmmod.c b/tools/rmmod.c index 7dacab94..c353fdbf 100644 --- a/tools/rmmod.c +++ b/tools/rmmod.c @@ -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)