]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Remove _always_inline_ attribute
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 16 Jun 2025 20:52:16 +0000 (21:52 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 8 Jul 2025 12:17:14 +0000 (07:17 -0500)
We have a single _always_inline_ instance in-tree, which lives in a
header file. Just make it a "static inline", which will practically do
the same thing and what we already have elsewhere in-tree.

While in there drop the CAPS from ALIGN_POWER2 - it's a function, so we
don't need the shouting.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/376
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
.clang-format
shared/hash.c
shared/macro.h
shared/util.h

index fba64f87e03faebf7ea1b8f075fb88fc65812544..a2655e8de14a678caa2ccfdbc1bccb6cb4af5dbf 100644 (file)
@@ -81,7 +81,6 @@ AttributeMacros:
   - KMOD_EXPORT
   - TS_EXPORT
   - _alignedptr_
-  - _always_inline_
   - _clang_suppress_alloc_
   - _cleanup_
   - _cleanup_free_
index 600900494222bd2ccee84f9ba67563ee00b751b7..9e1f5ea43a23b7eda89d4d61ce1b0cb8cbdc6baa 100644 (file)
@@ -34,7 +34,7 @@ struct hash *hash_new(unsigned int n_buckets, void (*free_value)(void *value))
 {
        struct hash *hash;
 
-       n_buckets = ALIGN_POWER2(n_buckets);
+       n_buckets = align_power2(n_buckets);
        hash = calloc(1, sizeof(struct hash) + n_buckets * sizeof(struct hash_bucket));
        if (hash == NULL)
                return NULL;
index 0ad5fddc640f4444917525622b3376ce8ecce977..77cc27e40537283438c16da1b4425a456fea344f 100644 (file)
@@ -44,7 +44,6 @@
 #define _maybe_unused_ __attribute__((unused))
 #define _must_check_ __attribute__((warn_unused_result))
 #define _printf_format_(a, b) __attribute__((format(printf, a, b)))
-#define _always_inline_ __inline__ __attribute__((always_inline))
 #define _sentinel_ __attribute__((sentinel))
 #define _used_ __attribute__((used))
 #define _retain_ __attribute__((retain))
index 718ecb8a0366b0f83605c84d178c76d1768cbbed..bf3f1009f3eba16153babba08fe1e53739d63b84 100644 (file)
@@ -88,7 +88,7 @@ unsigned long long get_backoff_delta_msec(unsigned long long tend,
                __p->__v = (val);                \
        } while (0)
 
-static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u)
+static inline unsigned int align_power2(unsigned int u)
 {
        return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1));
 }