Skip to content

Commit

Permalink
bfdd: fix some CI warnings
Browse files Browse the repository at this point in the history
Use `static` functions for file local functions to please `check_patch.pl`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
  • Loading branch information
rzalamena committed Jul 2, 2019
1 parent fdf8ac8 commit 307fc42
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
16 changes: 8 additions & 8 deletions bfdd/bfd.c
Expand Up @@ -1289,8 +1289,6 @@ static unsigned int bfd_key_hash_do(const void *p);

static void _bfd_free(struct hash_bucket *hb,
void *arg __attribute__((__unused__)));
int _bfd_session_next(struct hash_bucket *hb, void *arg);
void _bfd_session_remove_manual(struct hash_bucket *hb, void *arg);

/* BFD hash for our discriminator. */
static unsigned int bfd_id_hash_do(const void *p)
Expand Down Expand Up @@ -1343,9 +1341,10 @@ struct bfd_key_walk_partial_lookup {
};

/* ignore some parameters */
static int bfd_key_lookup_ignore_partial_walker(struct hash_bucket *b, void *data)
static int bfd_key_lookup_ignore_partial_walker(struct hash_bucket *b,
void *data)
{
struct bfd_key_walk_partial_lookup *ctx =
struct bfd_key_walk_partial_lookup *ctx =
(struct bfd_key_walk_partial_lookup *)data;
struct bfd_session *given = ctx->given;
struct bfd_session *parsed = b->data;
Expand All @@ -1354,7 +1353,8 @@ static int bfd_key_lookup_ignore_partial_walker(struct hash_bucket *b, void *dat
return HASHWALK_CONTINUE;
if (given->key.mhop != parsed->key.mhop)
return HASHWALK_CONTINUE;
if (memcmp(&given->key.peer, &parsed->key.peer, sizeof(struct in6_addr)))
if (memcmp(&given->key.peer, &parsed->key.peer,
sizeof(struct in6_addr)))
return HASHWALK_CONTINUE;
if (memcmp(given->key.vrfname, parsed->key.vrfname, MAXNAMELEN))
return HASHWALK_CONTINUE;
Expand Down Expand Up @@ -1538,7 +1538,7 @@ struct bfd_session_iterator {
const struct bfd_session *bsi_bs;
};

int _bfd_session_next(struct hash_bucket *hb, void *arg)
static int _bfd_session_next(struct hash_bucket *hb, void *arg)
{
struct bfd_session_iterator *bsi = arg;
struct bfd_session *bs = hb->data;
Expand Down Expand Up @@ -1588,8 +1588,8 @@ const struct bfd_session *bfd_session_next(const struct bfd_session *bs,
return bsi.bsi_bs;
}

void _bfd_session_remove_manual(struct hash_bucket *hb,
void *arg __attribute__((__unused__)))
static void _bfd_session_remove_manual(struct hash_bucket *hb,
void *arg __attribute__((__unused__)))
{
struct bfd_session *bs = hb->data;

Expand Down
22 changes: 6 additions & 16 deletions bfdd/bfdd_northbound.c
Expand Up @@ -27,21 +27,11 @@

#include "bfd.h"

/*
* Prototypes.
*/
void bfd_session_get_key(bool mhop, const struct lyd_node *dnode,
struct bfd_key *bk);
int bfd_session_create(enum nb_event event, const struct lyd_node *dnode,
union nb_resource *resource, bool mhop);
int bfd_session_destroy(enum nb_event event, const struct lyd_node *dnode,
bool mhop);

/*
* Helpers.
*/
void bfd_session_get_key(bool mhop, const struct lyd_node *dnode,
struct bfd_key *bk)
static void bfd_session_get_key(bool mhop, const struct lyd_node *dnode,
struct bfd_key *bk)
{
const char *ifname = NULL, *vrfname = NULL;
struct sockaddr_any psa, lsa;
Expand All @@ -64,8 +54,8 @@ void bfd_session_get_key(bool mhop, const struct lyd_node *dnode,
gen_bfd_key(bk, &psa, &lsa, mhop, ifname, vrfname);
}

int bfd_session_create(enum nb_event event, const struct lyd_node *dnode,
union nb_resource *resource, bool mhop)
static int bfd_session_create(enum nb_event event, const struct lyd_node *dnode,
union nb_resource *resource, bool mhop)
{
struct bfd_session *bs;
struct bfd_key bk;
Expand Down Expand Up @@ -126,8 +116,8 @@ int bfd_session_create(enum nb_event event, const struct lyd_node *dnode,
return NB_OK;
}

int bfd_session_destroy(enum nb_event event, const struct lyd_node *dnode,
bool mhop)
static int bfd_session_destroy(enum nb_event event,
const struct lyd_node *dnode, bool mhop)
{
struct bfd_session *bs;
struct bfd_key bk;
Expand Down

0 comments on commit 307fc42

Please sign in to comment.