Skip to content

Commit

Permalink
tools: reformat and clang-format off arrays
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: #118
Signed-off-by: Lucas De Marchi <[email protected]>
  • Loading branch information
evelikov authored and lucasdemarchi committed Sep 9, 2024
1 parent 7c7b6d6 commit e0180cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tools/depmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions tools/kmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[])
Expand Down
14 changes: 8 additions & 6 deletions tools/rmmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e0180cb

Please sign in to comment.