Skip to content

Commit

Permalink
all: use defines for attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
thom311 committed Apr 22, 2024
1 parent 522e110 commit 6561b12
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions include/base/nl-base-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 { \
Expand Down
2 changes: 1 addition & 1 deletion lib/route/cls/ematch/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/route/nh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/xfrm/sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/xfrm/sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 6561b12

Please sign in to comment.