Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42fa1b92 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Greg Kroah-Hartman
Browse files

Staging: batman-adv: Mark locally used symbols as static



Functions and variables which are used only inside one object file can
be declared as static. This helped to find unused functions/variables

 * mainIfAddr_default
 * main_if_was_up

and functions with declarations but missing definitions

 * hash_debug
 * orig_find
 * send_own_packet_work

Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 516c9a77
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ void bit_mark(TYPE_OF_WORD *seq_bits, int32_t n)
}

/* shift the packet array by n places. */
void bit_shift(TYPE_OF_WORD *seq_bits, int32_t n)
static void bit_shift(TYPE_OF_WORD *seq_bits, int32_t n)
{
	int32_t word_offset, word_num;
	int32_t i;
+0 −3
Original line number Diff line number Diff line
@@ -32,9 +32,6 @@ uint8_t get_bit_status(TYPE_OF_WORD *seq_bits, uint16_t last_seqno,
/* turn corresponding bit on, so we can remember that we got the packet */
void bit_mark(TYPE_OF_WORD *seq_bits, int32_t n);

/* shift the packet array by n places. */
void bit_shift(TYPE_OF_WORD *seq_bits, int32_t n);


/* receive and process one packet, returns 1 if received seq_num is considered
 * new, 0 if old  */
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include "hash.h"

/* clears the hash */
void hash_init(struct hashtable_t *hash)
static void hash_init(struct hashtable_t *hash)
{
	int i;

+0 −6
Original line number Diff line number Diff line
@@ -56,9 +56,6 @@ struct hashtable_t {
				     * argument and the size the second */
};

/* clears the hash */
void hash_init(struct hashtable_t *hash);

/* allocates and clears the hash */
struct hashtable_t *hash_new(int size, hashdata_compare_cb compare,
			     hashdata_choose_cb choose);
@@ -98,7 +95,4 @@ struct hashtable_t *hash_resize(struct hashtable_t *hash, int size);
 * the returned iterator to access the elements until hash_it_t returns NULL. */
struct hash_it_t *hash_iterate(struct hashtable_t *hash,
			       struct hash_it_t *iter_in);

/* print the hash table for debugging */
void hash_debug(struct hashtable_t *hash);
#endif
+16 −16
Original line number Diff line number Diff line
@@ -56,21 +56,6 @@ int originator_init(void)
	return 0;
}

void originator_free(void)
{
	unsigned long flags;

	if (!orig_hash)
		return;

	cancel_delayed_work_sync(&purge_orig_wq);

	spin_lock_irqsave(&orig_hash_lock, flags);
	hash_delete(orig_hash, free_orig_node);
	orig_hash = NULL;
	spin_unlock_irqrestore(&orig_hash_lock, flags);
}

struct neigh_node *
create_neighbor(struct orig_node *orig_node, struct orig_node *orig_neigh_node,
		uint8_t *neigh, struct batman_if *if_incoming)
@@ -93,7 +78,7 @@ create_neighbor(struct orig_node *orig_node, struct orig_node *orig_neigh_node,
	return neigh_node;
}

void free_orig_node(void *data)
static void free_orig_node(void *data)
{
	struct list_head *list_pos, *list_pos_tmp;
	struct neigh_node *neigh_node;
@@ -114,6 +99,21 @@ void free_orig_node(void *data)
	kfree(orig_node);
}

void originator_free(void)
{
	unsigned long flags;

	if (!orig_hash)
		return;

	cancel_delayed_work_sync(&purge_orig_wq);

	spin_lock_irqsave(&orig_hash_lock, flags);
	hash_delete(orig_hash, free_orig_node);
	orig_hash = NULL;
	spin_unlock_irqrestore(&orig_hash_lock, flags);
}

/* this function finds or creates an originator entry for the given
 * address if it does not exits */
struct orig_node *get_orig_node(uint8_t *addr)
Loading