From: Emil Velikov Date: Sun, 8 Sep 2024 10:38:12 +0000 (+0100) Subject: libkmod: guard some functions with clang-format off X-Git-Tag: v34~391 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8335c8c81fc95057898c3690334fb4a38bd20954;p=thirdparty%2Fkmod.git libkmod: guard some functions with clang-format off 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 Link: https://github.com/kmod-project/kmod/pull/118 Signed-off-by: Lucas De Marchi --- diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c index 9fda8535..21aa6994 100644 --- a/libkmod/libkmod-config.c +++ b/libkmod/libkmod-config.c @@ -1226,7 +1226,9 @@ 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; @@ -1234,7 +1236,9 @@ KMOD_EXPORT struct kmod_config_iter *kmod_config_get_install_commands(const stru 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; diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h index 5fe7d668..db25f371 100644 --- a/libkmod/libkmod-internal.h +++ b/libkmod/libkmod-internal.h @@ -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); @@ -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 diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index 10e58cee..b4a99a7b 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -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; @@ -2346,7 +2348,9 @@ list_error: 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;