Skip to content

Commit

Permalink
libkmod: guard some functions with clang-format off
Browse files Browse the repository at this point in the history
Running this through clang-format results in a massacre. In some cases
we get function names starting at column 1, in others, every argument is
on separate line.

Just block the lot, so things are somewhat sane and consistent.

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 6bfd74a commit 8335c8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions libkmod/libkmod-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,15 +1226,19 @@ KMOD_EXPORT struct kmod_config_iter *kmod_config_get_blacklists(const struct kmo
return kmod_config_iter_new(ctx, CONFIG_TYPE_BLACKLIST);
}

// clang-format off
KMOD_EXPORT struct kmod_config_iter *kmod_config_get_install_commands(const struct kmod_ctx *ctx)
// clang-format on
{
if (ctx == NULL)
return NULL;

return kmod_config_iter_new(ctx, CONFIG_TYPE_INSTALL);
}

// clang-format ofr
KMOD_EXPORT struct kmod_config_iter *kmod_config_get_remove_commands(const struct kmod_ctx *ctx)
// clang-format on
{
if (ctx == NULL)
return NULL;
Expand Down
8 changes: 4 additions & 4 deletions libkmod/libkmod-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ enum kmod_file_compression_type {
KMOD_FILE_COMPRESSION_ZLIB,
};

// clang-format off
_must_check_ _nonnull_(2) struct kmod_list *kmod_list_append(struct kmod_list *list, const void *data);
_must_check_ _nonnull_(2) struct kmod_list *kmod_list_prepend(struct kmod_list *list, const void *data);
_must_check_ struct kmod_list *kmod_list_remove(struct kmod_list *list);
_must_check_ _nonnull_(2) struct kmod_list *kmod_list_remove_data(struct kmod_list *list,
const void *data);
_must_check_ struct kmod_list *kmod_list_remove_n_latest(struct kmod_list *list,
unsigned int n);
_must_check_ _nonnull_(2) struct kmod_list *kmod_list_remove_data(struct kmod_list *list, const void *data);
_must_check_ struct kmod_list *kmod_list_remove_n_latest(struct kmod_list *list, unsigned int n);
_nonnull_(2) struct kmod_list *kmod_list_insert_after(struct kmod_list *list, const void *data);
_nonnull_(2) struct kmod_list *kmod_list_insert_before(struct kmod_list *list, const void *data);
_must_check_ struct kmod_list *kmod_list_append_list(struct kmod_list *list1, struct kmod_list *list2);
Expand Down Expand Up @@ -211,3 +210,4 @@ _nonnull_all_ void kmod_module_signature_info_free(struct kmod_signature_info *s

/* libkmod-builtin.c */
_nonnull_all_ ssize_t kmod_builtin_get_modinfo(struct kmod_ctx *ctx, const char *modname, char ***modinfo);
// clang-format on
4 changes: 4 additions & 0 deletions libkmod/libkmod-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2275,7 +2275,9 @@ struct kmod_module_dependency_symbol {
char symbol[];
};

// clang-format off
static struct kmod_module_dependency_symbol *kmod_module_dependency_symbols_new(uint64_t crc, uint8_t bind, const char *symbol)
// clang-format on
{
struct kmod_module_dependency_symbol *mv;
size_t symbollen = strlen(symbol) + 1;
Expand Down Expand Up @@ -2346,7 +2348,9 @@ KMOD_EXPORT int kmod_module_get_dependency_symbols(const struct kmod_module *mod
return ret;
}

// clang-format off
KMOD_EXPORT const char *kmod_module_dependency_symbol_get_symbol(const struct kmod_list *entry)
// clang-format on
{
struct kmod_module_dependency_symbol *dependency_symbol;

Expand Down

0 comments on commit 8335c8c

Please sign in to comment.