summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2024-04-22 08:06:49 (GMT)
committerThomas Haller <thaller@redhat.com>2024-04-22 08:29:47 (GMT)
commit5873497482022167393f3e193d187340df4acf99 (patch)
tree9bbf0d9f17b89f3cb8e7f6c486ab3d4cd50f361a
parent0c16c9cbd66b068dc010d4944d73f94e8faea389 (diff)
downloadlibnl-5873497482022167393f3e193d187340df4acf99.zip
libnl-5873497482022167393f3e193d187340df4acf99.tar.gz
libnl-5873497482022167393f3e193d187340df4acf99.tar.bz2
all: use defines for attributes
We have those defines. Use them throughout.
-rw-r--r--include/base/nl-base-utils.h4
-rw-r--r--lib/route/cls/ematch/container.c2
-rw-r--r--lib/route/nh.c2
-rw-r--r--lib/xfrm/sa.c4
-rw-r--r--lib/xfrm/sp.c6
5 files changed, 9 insertions, 9 deletions
diff --git a/include/base/nl-base-utils.h b/include/base/nl-base-utils.h
index 03d568e..a155bba 100644
--- a/include/base/nl-base-utils.h
+++ b/include/base/nl-base-utils.h
@@ -816,8 +816,8 @@ static inline void nl_write_unlock(pthread_rwlock_t *lock)
}
#else
-#define NL_LOCK(NAME) int __unused_lock_##NAME __attribute__((unused))
-#define NL_RW_LOCK(NAME) int __unused_lock_##NAME __attribute__((unused))
+#define NL_LOCK(NAME) int __unused_lock_##NAME _nl_unused
+#define NL_RW_LOCK(NAME) int __unused_lock_##NAME _nl_unused
#define nl_lock(LOCK) \
do { \
diff --git a/lib/route/cls/ematch/container.c b/lib/route/cls/ematch/container.c
index ea2d166..d7e5a3a 100644
--- a/lib/route/cls/ematch/container.c
+++ b/lib/route/cls/ematch/container.c
@@ -10,7 +10,7 @@
#include "nl-route.h"
-static int container_parse(struct rtnl_ematch *e, void *data, size_t len __attribute__((unused)))
+static int container_parse(struct rtnl_ematch *e, void *data, size_t len)
{
/*
The kernel may provide more than 4 bytes of data in the future and we want
diff --git a/lib/route/nh.c b/lib/route/nh.c
index 1072172..40ce5d4 100644
--- a/lib/route/nh.c
+++ b/lib/route/nh.c
@@ -176,7 +176,7 @@ static void nexthop_keygen(struct nl_object *obj, uint32_t *hashkey,
unsigned int lkey_sz;
struct nexthop_hash_key {
uint32_t nh_id;
- } __attribute__((packed)) lkey;
+ } _nl_packed lkey;
lkey_sz = sizeof(lkey);
lkey.nh_id = nexthop->nh_id;
diff --git a/lib/xfrm/sa.c b/lib/xfrm/sa.c
index 0c89c71..2fe387d 100644
--- a/lib/xfrm/sa.c
+++ b/lib/xfrm/sa.c
@@ -2372,12 +2372,12 @@ static struct nl_cache_ops xfrmnl_sa_ops = {
* @{
*/
-static void __attribute__ ((constructor)) xfrm_sa_init(void)
+static void _nl_init xfrm_sa_init(void)
{
nl_cache_mngt_register(&xfrmnl_sa_ops);
}
-static void __attribute__ ((destructor)) xfrm_sa_exit(void)
+static void _nl_exit xfrm_sa_exit(void)
{
nl_cache_mngt_unregister(&xfrmnl_sa_ops);
}
diff --git a/lib/xfrm/sp.c b/lib/xfrm/sp.c
index 3491fd7..642fbcb 100644
--- a/lib/xfrm/sp.c
+++ b/lib/xfrm/sp.c
@@ -1281,7 +1281,7 @@ int xfrmnl_sp_get_sec_ctx (struct xfrmnl_sp* sp, unsigned int* len, unsigned int
*
* @return 0 if sucessfull, else -1
*/
-int xfrmnl_sp_set_sec_ctx (struct xfrmnl_sp* sp, unsigned int len __attribute__((unused)), unsigned int exttype, unsigned int alg, unsigned int doi, unsigned int ctx_len, char* ctx_str)
+int xfrmnl_sp_set_sec_ctx (struct xfrmnl_sp* sp, unsigned int len, unsigned int exttype, unsigned int alg, unsigned int doi, unsigned int ctx_len, char* ctx_str)
{
/* Free up the old context string and allocate new one */
if (sp->sec_ctx)
@@ -1450,12 +1450,12 @@ static struct nl_cache_ops xfrmnl_sp_ops = {
* @{
*/
-static void __attribute__ ((constructor)) xfrm_sp_init(void)
+static void _nl_init xfrm_sp_init(void)
{
nl_cache_mngt_register(&xfrmnl_sp_ops);
}
-static void __attribute__ ((destructor)) xfrm_sp_exit(void)
+static void _nl_exit xfrm_sp_exit(void)
{
nl_cache_mngt_unregister(&xfrmnl_sp_ops);
}