]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod: guard some functions with clang-format off
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)
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 <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>
libkmod/libkmod-config.c
libkmod/libkmod-internal.h
libkmod/libkmod-module.c

index 9fda8535ab5783aa13e83fb21f1bed28e9635f67..21aa6994e625a2ae256f318d6190584310923de6 100644 (file)
@@ -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;
index 5fe7d668de39be6e5bcef1134d038871b2e60ebf..db25f371baaa1579448d270f3e9c677a767a015f 100644 (file)
@@ -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
index 10e58cee4451208603fb6a4c4a9033d447f94688..b4a99a7b42980200a5b7392b793483418168917d 100644 (file)
@@ -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;