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

Commit b4e17054 authored by Sven Eckelmann's avatar Sven Eckelmann
Browse files

batman-adv: Reduce usage of char



char was used in different places to store information without really
using the characteristics of that data type or by ignoring the fact that
char has not a well defined signedness.

Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent b2c44a53
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ static void aggregate(struct forw_packet *forw_packet_aggr,

void add_bat_packet_to_list(struct bat_priv *bat_priv,
			    unsigned char *packet_buff, int packet_len,
			    struct hard_iface *if_incoming, char own_packet,
			    struct hard_iface *if_incoming, int own_packet,
			    unsigned long send_time)
{
	/**
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ static inline int aggregated_packet(int buff_pos, int packet_len, int num_tt)

void add_bat_packet_to_list(struct bat_priv *bat_priv,
			    unsigned char *packet_buff, int packet_len,
			    struct hard_iface *if_incoming, char own_packet,
			    struct hard_iface *if_incoming, int own_packet,
			    unsigned long send_time);
void receive_aggr_bat_packet(const struct ethhdr *ethhdr,
			     unsigned char *packet_buff, int packet_len,
+2 −2
Original line number Diff line number Diff line
@@ -127,8 +127,8 @@ static void bit_reset_window(unsigned long *seq_bits)
 *  1 if the window was moved (either new or very old)
 *  0 if the window was not moved/shifted.
 */
char bit_get_packet(void *priv, unsigned long *seq_bits,
		    int32_t seq_num_diff, int8_t set_mark)
int bit_get_packet(void *priv, unsigned long *seq_bits,
		    int32_t seq_num_diff, int set_mark)
{
	struct bat_priv *bat_priv = priv;

+2 −2
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@ void bit_mark(unsigned long *seq_bits, int32_t n);

/* receive and process one packet, returns 1 if received seq_num is considered
 * new, 0 if old  */
char bit_get_packet(void *priv, unsigned long *seq_bits,
		    int32_t seq_num_diff, int8_t set_mark);
int bit_get_packet(void *priv, unsigned long *seq_bits,
		   int32_t seq_num_diff, int set_mark);

/* count the hamming weight, how many good packets did we receive? */
int bit_packet_count(const unsigned long *seq_bits);
+1 −1
Original line number Diff line number Diff line
@@ -360,7 +360,7 @@ void gw_node_purge(struct bat_priv *bat_priv)
	struct gw_node *gw_node, *curr_gw;
	struct hlist_node *node, *node_tmp;
	unsigned long timeout = 2 * PURGE_TIMEOUT * HZ;
	char do_deselect = 0;
	int do_deselect = 0;

	curr_gw = gw_get_selected_gw_node(bat_priv);

Loading