Fix all the warnings generated by the 2.6.29 checkpatch script about
violations of the Linux coding style in the hash.[ch] files.
Signed-off-by: Andrew Lunn <andrew.lunn(a)ascom.ch>
Index: batman-adv-kernelland/hash.c
===================================================================
--- batman-adv-kernelland/hash.c (revision 1343)
+++ batman-adv-kernelland/hash.c (working copy)
@@ -17,15 +17,9 @@
*
*/
-
-
-
-
#include "main.h"
#include "hash.h"
-
-
/* clears the hash */
void hash_init(struct hashtable_t *hash)
{
@@ -37,9 +31,9 @@
hash->table[i] = NULL;
}
-/* remove the hash structure. if hashdata_free_cb != NULL,
- * this function will be called to remove the elements inside of the hash.
- * if you don't remove the elements, memory might be leaked. */
+/* remove the hash structure. if hashdata_free_cb != NULL, this function will be
+ * called to remove the elements inside of the hash. if you don't remove the
+ * elements, memory might be leaked. */
void hash_delete(struct hashtable_t *hash, hashdata_free_cb free_cb)
{
struct element_t *bucket, *last_bucket;
@@ -56,7 +50,6 @@
bucket = bucket->next;
kfree(last_bucket);
}
-
}
hash_destroy(hash);
@@ -69,9 +62,10 @@
kfree(hash);
}
-/* iterate though the hash. first element is selected with iter_in NULL.
- * use 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)
+/* iterate though the hash. first element is selected with iter_in NULL. use
+ * 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)
{
struct hash_it_t *iter;
@@ -81,19 +75,22 @@
iter->bucket = NULL;
iter->prev_bucket = NULL;
} else {
- iter= iter_in;
+ iter = iter_in;
}
- /* sanity checks first (if our bucket got deleted in the last iteration): */
+ /* sanity checks first (if our bucket got deleted in the last
+ * iteration): */
if (iter->bucket != NULL) {
if (iter->first_bucket != NULL) {
- /* we're on the first element and it got removed after the last iteration. */
+ /* we're on the first element and it got removed after
+ * the last iteration. */
if ((*iter->first_bucket) != iter->bucket) {
/* there are still other elements in the list */
if ((*iter->first_bucket) != NULL) {
iter->prev_bucket = NULL;
iter->bucket = (*iter->first_bucket);
- iter->first_bucket = &hash->table[iter->index];
+ iter->first_bucket =
+ &hash->table[iter->index];
return iter;
} else {
iter->bucket = NULL;
@@ -101,9 +98,10 @@
}
} else if (iter->prev_bucket != NULL) {
/*
- * we're not on the first element, and the bucket got removed after the last iteration.
- * the last bucket's next pointer is not pointing to our actual bucket anymore.
- * select the next.
+ * we're not on the first element, and the bucket got
+ * removed after the last iteration. the last bucket's
+ * next pointer is not pointing to our actual bucket
+ * anymore. select the next.
*/
if (iter->prev_bucket->next != iter->bucket)
iter->bucket = iter->prev_bucket;
@@ -120,11 +118,12 @@
}
}
- /* if not returned yet, we've reached the last one on the index and have to search forward */
+ /* if not returned yet, we've reached the last one on the index and have
+ * to search forward */
iter->index++;
/* go through the entries of the hash table */
while (iter->index < hash->size) {
- if ((hash->table[iter->index]) != NULL){
+ if ((hash->table[iter->index]) != NULL) {
iter->prev_bucket = NULL;
iter->bucket = hash->table[iter->index];
iter->first_bucket = &hash->table[iter->index];
@@ -140,7 +139,8 @@
}
/* allocates and clears the hash */
-struct hashtable_t *hash_new(int size, hashdata_compare_cb compare, hashdata_choose_cb choose)
+struct hashtable_t *hash_new(int size, hashdata_compare_cb compare,
+ hashdata_choose_cb choose)
{
struct hashtable_t *hash;
@@ -183,7 +183,7 @@
}
/* found the tail of the list, add new element */
- bucket = kmalloc(sizeof(struct element_t),GFP_ATOMIC);
+ bucket = kmalloc(sizeof(struct element_t), GFP_ATOMIC);
if (bucket == NULL)
return -1;
@@ -201,7 +201,8 @@
return 0;
}
-/* finds data, based on the key in keydata. returns the found data on success, or NULL on error */
+/* finds data, based on the key in keydata. returns the found data on success,
+ * or NULL on error */
void *hash_find(struct hashtable_t *hash, void *keydata)
{
int index;
@@ -220,9 +221,10 @@
return NULL;
}
-/* remove bucket (this might be used in hash_iterate() if you already found the bucket
- * you want to delete and don't need the overhead to find it again with hash_remove().
- * But usually, you don't want to use this function, as it fiddles with hash-internals. */
+/* remove bucket (this might be used in hash_iterate() if you already found the
+ * bucket you want to delete and don't need the overhead to find it again with
+ * hash_remove(). But usually, you don't want to use this function, as it
+ * fiddles with hash-internals. */
void *hash_remove_bucket(struct hashtable_t *hash, struct hash_it_t *hash_it_t)
{
void *data_save;
@@ -240,10 +242,10 @@
return data_save;
}
-/* removes data from hash, if found. returns pointer do data on success,
- * so you can remove the used structure yourself, or NULL on error .
- * data could be the structure you use with just the key filled,
- * we just need the key for comparing. */
+/* removes data from hash, if found. returns pointer do data on success, so you
+ * can remove the used structure yourself, or NULL on error . data could be the
+ * structure you use with just the key filled, we just need the key for
+ * comparing. */
void *hash_remove(struct hashtable_t *hash, void *data)
{
struct hash_it_t hash_it_t;
@@ -254,18 +256,22 @@
while (hash_it_t.bucket != NULL) {
if (hash->compare(hash_it_t.bucket->data, data)) {
- hash_it_t.first_bucket = (hash_it_t.bucket == hash->table[hash_it_t.index] ? &hash->table[ hash_it_t.index ] : NULL);
+ hash_it_t.first_bucket =
+ (hash_it_t.bucket ==
+ hash->table[hash_it_t.index] ?
+ &hash->table[hash_it_t.index] : NULL);
return hash_remove_bucket(hash, &hash_it_t);
}
hash_it_t.prev_bucket = hash_it_t.bucket;
- hash_it_t.bucket= hash_it_t.bucket->next;
+ hash_it_t.bucket = hash_it_t.bucket->next;
}
return NULL;
}
-/* resize the hash, returns the pointer to the new hash or NULL on error. removes the old hash on success. */
+/* resize the hash, returns the pointer to the new hash or NULL on
+ * error. removes the old hash on success. */
struct hashtable_t *hash_resize(struct hashtable_t *hash, int size)
{
struct hashtable_t *new_hash;
@@ -288,7 +294,8 @@
}
}
- /* remove hash and eventual overflow buckets but not the content itself. */
+ /* remove hash and eventual overflow buckets but not the content
+ * itself. */
hash_delete(hash, NULL);
return new_hash;
Index: batman-adv-kernelland/hash.h
===================================================================
--- batman-adv-kernelland/hash.h (revision 1343)
+++ batman-adv-kernelland/hash.h (working copy)
@@ -17,22 +17,16 @@
*
*/
-
-
-
-
#ifndef _BATMAN_HASH_H
#define _BATMAN_HASH_H
-
-
typedef int (*hashdata_compare_cb)(void *, void *);
typedef int (*hashdata_choose_cb)(void *, int);
typedef void (*hashdata_free_cb)(void *);
struct element_t {
- void *data; /* pointer to the data */
- struct element_t *next; /* overflow bucket pointer */
+ void *data; /* pointer to the data */
+ struct element_t *next; /* overflow bucket pointer */
};
struct hash_it_t {
@@ -43,56 +37,61 @@
};
struct hashtable_t {
- struct element_t **table; /* the hashtable itself, with the buckets */
- int elements; /* number of elements registered */
- int size; /* size of hashtable */
- hashdata_compare_cb compare; /* callback to a compare function.
- * should compare 2 element datas for their keys,
- * return 0 if same and not 0 if not same */
- hashdata_choose_cb choose; /* the hashfunction, should return an index based
- * on the key in the data of the first argument
- * and the size the second */
+ struct element_t **table; /* the hashtable itself, with the buckets */
+ int elements; /* number of elements registered */
+ int size; /* size of hashtable */
+ hashdata_compare_cb compare;/* callback to a compare function. should
+ * compare 2 element datas for their keys,
+ * return 0 if same and not 0 if not
+ * same */
+ hashdata_choose_cb choose; /* the hashfunction, should return an index
+ * based on the key in the data of the first
+ * argument and the size the second */
};
/* clears the hash */
-void hash_init(struct hashtable_t *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);
+struct hashtable_t *hash_new(int size, hashdata_compare_cb compare,
+ hashdata_choose_cb choose);
-/* remove bucket (this might be used in hash_iterate() if you already found the bucket
- * you want to delete and don't need the overhead to find it again with hash_remove().
- * But usually, you don't want to use this function, as it fiddles with hash-internals. */
-void *hash_remove_bucket(struct hashtable_t *hash, struct hash_it_t *hash_it_t);
+/* remove bucket (this might be used in hash_iterate() if you already found the
+ * bucket you want to delete and don't need the overhead to find it again with
+ * hash_remove(). But usually, you don't want to use this function, as it
+ * fiddles with hash-internals. */
+void *hash_remove_bucket(struct hashtable_t *hash, struct hash_it_t *hash_it_t);
-/* remove the hash structure. if hashdata_free_cb != NULL,
- * this function will be called to remove the elements inside of the hash.
- * if you don't remove the elements, memory might be leaked. */
-void hash_delete(struct hashtable_t *hash, hashdata_free_cb free_cb);
+/* remove the hash structure. if hashdata_free_cb != NULL, this function will be
+ * called to remove the elements inside of the hash. if you don't remove the
+ * elements, memory might be leaked. */
+void hash_delete(struct hashtable_t *hash, hashdata_free_cb free_cb);
/* free only the hashtable and the hash itself. */
-void hash_destroy(struct hashtable_t *hash);
+void hash_destroy(struct hashtable_t *hash);
/* adds data to the hashtable. returns 0 on success, -1 on error */
-int hash_add(struct hashtable_t *hash, void *data);
+int hash_add(struct hashtable_t *hash, void *data);
-/* removes data from hash, if found. returns pointer do data on success,
- * so you can remove the used structure yourself, or NULL on error .
- * data could be the structure you use with just the key filled,
- * we just need the key for comparing. */
-void *hash_remove(struct hashtable_t *hash, void *data);
+/* removes data from hash, if found. returns pointer do data on success, so you
+ * can remove the used structure yourself, or NULL on error . data could be the
+ * structure you use with just the key filled, we just need the key for
+ * comparing. */
+void *hash_remove(struct hashtable_t *hash, void *data);
-/* finds data, based on the key in keydata. returns the found data on success, or NULL on error */
-void *hash_find(struct hashtable_t *hash, void *keydata);
+/* finds data, based on the key in keydata. returns the found data on success,
+ * or NULL on error */
+void *hash_find(struct hashtable_t *hash, void *keydata);
-/* resize the hash, returns the pointer to the new hash or NULL on error. removes the old hash on success */
-struct hashtable_t *hash_resize(struct hashtable_t *hash, int size);
+/* resize the hash, returns the pointer to the new hash or NULL on
+ * error. removes the old hash on success */
+struct hashtable_t *hash_resize(struct hashtable_t *hash, int size);
-/* print the hash table for debugging */
-void hash_debug( struct hashtable_t *hash);
+/* iterate though the hash. first element is selected with iter_in NULL. use
+ * 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);
-/* iterate though the hash. first element is selected with iter_in NULL.
- * use 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
Fix all the warnings generated by the 2.6.29 checkpatch script about
violations of the Linux coding style in the bitarray.[ch]
files.
Signed-off-by: Andrew Lunn <andrew.lunn(a)ascom.ch>
Index: batman-adv-kernelland/bitarray.c
===================================================================
--- batman-adv-kernelland/bitarray.c (revision 1343)
+++ batman-adv-kernelland/bitarray.c (working copy)
@@ -17,16 +17,10 @@
*
*/
-
-
-
-
#include "main.h"
#include "bitarray.h"
#include "log.h"
-
-
/* clear the bits */
void bit_init(TYPE_OF_WORD *seq_bits)
{
@@ -36,8 +30,10 @@
seq_bits[i] = 0;
}
-/* returns true if corresponding bit in given seq_bits indicates so and curr_seqno is within range of last_seqno */
-uint8_t get_bit_status(TYPE_OF_WORD *seq_bits, uint16_t last_seqno, uint16_t curr_seqno)
+/* returns true if the corresponding bit in the given seq_bits indicates true
+ * and curr_seqno is within range of last_seqno */
+uint8_t get_bit_status(TYPE_OF_WORD *seq_bits, uint16_t last_seqno,
+ uint16_t curr_seqno)
{
int16_t diff, word_offset, word_num;
@@ -45,8 +41,10 @@
if (diff < 0 || diff >= TQ_LOCAL_WINDOW_SIZE) {
return 0;
} else {
- word_offset = (last_seqno - curr_seqno) % WORD_BIT_SIZE;/* which position in the selected word */
- word_num = (last_seqno - curr_seqno) / WORD_BIT_SIZE; /* which word */
+ /* which word */
+ word_num = (last_seqno - curr_seqno) / WORD_BIT_SIZE;
+ /* which position in the selected word */
+ word_offset = (last_seqno - curr_seqno) % WORD_BIT_SIZE;
if (seq_bits[word_num] & 1 << word_offset)
return 1;
@@ -57,22 +55,19 @@
/* print the packet array, for debugging purposes */
static char bit_string[130];
-char* bit_print(TYPE_OF_WORD *seq_bits) {
- int i,j,k=0,b=0;
+char *bit_print(TYPE_OF_WORD *seq_bits)
+{
+ int i, j, k = 0, b = 0;
-// printf("the last %d packets, we got %d:\n", TQ_LOCAL_WINDOW_SIZE, bit_packet_count(seq_bits));
- for ( i=0; i<NUM_WORDS; i++ ) {
- for ( j=0; j<WORD_BIT_SIZE; j++) {
- bit_string[k++] = ((seq_bits[i]>>j)%2 ? '1':'0'); /* print the j position */
- if( ++b == TQ_LOCAL_WINDOW_SIZE ) {
- bit_string[k++]='|';
- }
+ for (i = 0; i < NUM_WORDS; i++) {
+ for (j = 0; j < WORD_BIT_SIZE; j++) {
+ bit_string[k++] = ((seq_bits[i]>>j)%2 ? '1' : '0');
+ if (++b == TQ_LOCAL_WINDOW_SIZE)
+ bit_string[k++] = '|';
}
- bit_string[k++]=' ';
+ bit_string[k++] = ' ';
}
- bit_string[k++]='\0';
-// debug_output( 4, "%s\n", bit_string);
-// printf("\n\n");
+ bit_string[k++] = '\0';
return bit_string;
}
@@ -82,18 +77,18 @@
int32_t word_offset, word_num;
/* if too old, just drop it */
- if (n<0 || n >= TQ_LOCAL_WINDOW_SIZE)
+ if (n < 0 || n >= TQ_LOCAL_WINDOW_SIZE)
return;
-// printf("mark bit %d\n", n);
+ /* which word */
+ word_num = n / WORD_BIT_SIZE;
+ /* which position in the selected word */
+ word_offset = n % WORD_BIT_SIZE;
- word_offset = n % WORD_BIT_SIZE; /* which position in the selected word */
- word_num = n / WORD_BIT_SIZE; /* which word */
-
seq_bits[word_num] |= 1 << word_offset; /* turn the position on */
}
-/* shift the packet array p by n places. */
+/* shift the packet array by n places. */
void bit_shift(TYPE_OF_WORD *seq_bits, int32_t n)
{
int32_t word_offset, word_num;
@@ -102,29 +97,36 @@
if (n <= 0)
return;
- word_offset= n % WORD_BIT_SIZE; /* shift how much inside each word */
+ word_offset = n % WORD_BIT_SIZE;/* shift how much inside each word */
word_num = n / WORD_BIT_SIZE; /* shift over how much (full) words */
for (i = NUM_WORDS - 1; i > word_num; i--) {
- /* going from old to new, so we can't overwrite the data we copy from. *
- * left is high, right is low: FEDC BA98 7654 3210
+ /* going from old to new, so we don't overwrite the data we copy
+ * from.
+ *
+ * left is high, right is low: FEDC BA98 7654 3210
* ^^ ^^
* vvvv
* ^^^^ = from, vvvvv =to, we'd have word_num==1 and
- * word_offset==WORD_BIT_SIZE/2 ????? in this example. (=24 bits)
+ * word_offset==WORD_BIT_SIZE/2 ????? in this example.
+ * (=24 bits)
*
* our desired output would be: 9876 5432 1000 0000
* */
seq_bits[i] =
(seq_bits[i - word_num] << word_offset) +
- /* take the lower port from the left half, shift it left to its final position */
- (seq_bits[i - word_num - 1] >> (WORD_BIT_SIZE-word_offset));
- /* and the upper part of the right half and shift it left to it's position */
- /* for our example that would be: word[0] = 9800 + 0076 = 9876 */
+ /* take the lower port from the left half, shift it left
+ * to its final position */
+ (seq_bits[i - word_num - 1] >>
+ (WORD_BIT_SIZE-word_offset));
+ /* and the upper part of the right half and shift it left to
+ * it's position */
+ /* for our example that would be: word[0] = 9800 + 0076 =
+ * 9876 */
}
- /* now for our last word, i==word_num, we only have the it's "left" half. that's the 1000 word in
- * our example.*/
+ /* now for our last word, i==word_num, we only have the it's "left"
+ * half. that's the 1000 word in our example.*/
seq_bits[i] = (seq_bits[i - word_num] << word_offset);
@@ -136,27 +138,33 @@
}
-/* receive and process one packet, returns 1 if received seq_num is considered new, 0 if old */
-char bit_get_packet(TYPE_OF_WORD *seq_bits, int16_t seq_num_diff, int8_t set_mark)
+/* receive and process one packet, returns 1 if received seq_num is considered
+ * new, 0 if old */
+char bit_get_packet(TYPE_OF_WORD *seq_bits, int16_t seq_num_diff,
+ int8_t set_mark)
{
int i;
- /* we already got a sequence number higher than this one, so we just mark it. this should wrap around the integer just fine */
+ /* we already got a sequence number higher than this one, so we just
+ * mark it. this should wrap around the integer just fine */
if ((seq_num_diff < 0) && (seq_num_diff >= -TQ_LOCAL_WINDOW_SIZE)) {
if (set_mark)
bit_mark(seq_bits, -seq_num_diff);
-
return 0;
}
/* it seems we missed a lot of packets or the other host restarted */
- if ((seq_num_diff > TQ_LOCAL_WINDOW_SIZE ) || (seq_num_diff < -TQ_LOCAL_WINDOW_SIZE)) {
+ if ((seq_num_diff > TQ_LOCAL_WINDOW_SIZE) ||
+ (seq_num_diff < -TQ_LOCAL_WINDOW_SIZE)) {
if (seq_num_diff > TQ_LOCAL_WINDOW_SIZE)
- debug_log(LOG_TYPE_BATMAN, "It seems we missed a lot of packets (%i) !\n", seq_num_diff-1);
+ debug_log(LOG_TYPE_BATMAN,
+ "We missed a lot of packets (%i) !\n",
+ seq_num_diff-1);
if (-seq_num_diff > TQ_LOCAL_WINDOW_SIZE)
- debug_log(LOG_TYPE_BATMAN, "Other host probably restarted !\n");
+ debug_log(LOG_TYPE_BATMAN,
+ "Other host probably restarted !\n");
for (i = 0; i < NUM_WORDS; i++)
seq_bits[i] = 0;
@@ -173,35 +181,22 @@
return 1;
}
-/* count the hamming weight, how many good packets did we receive? just count the 1's ... */
+/* count the hamming weight, how many good packets did we receive? just count
+ * the 1's. The inner loop uses the Kernighan algorithm, see
+ * http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
+ */
int bit_packet_count(TYPE_OF_WORD *seq_bits)
{
int i, hamming = 0;
TYPE_OF_WORD word;
for (i = 0; i < NUM_WORDS; i++) {
-
word = seq_bits[i];
while (word) {
- word &= word-1; /* see http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan */
+ word &= word-1;
hamming++;
}
-
}
-
return hamming;
}
-
-uint8_t bit_count(int32_t to_count)
-{
- uint8_t hamming = 0;
-
- while (to_count) {
- to_count &= to_count - 1; /* see http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan */
- hamming++;
- }
-
- return hamming;
-}
-
Index: batman-adv-kernelland/bitarray.h
===================================================================
--- batman-adv-kernelland/bitarray.h (revision 1343)
+++ batman-adv-kernelland/bitarray.h (working copy)
@@ -18,18 +18,32 @@
*/
-
-#define TYPE_OF_WORD unsigned long /* you should choose something big, if you don't want to waste cpu */
+/* you should choose something big, if you don't want to waste cpu */
+#define TYPE_OF_WORD unsigned long
#define WORD_BIT_SIZE (sizeof(TYPE_OF_WORD) * 8)
+/* clear the bits, ready for use */
+void bit_init(TYPE_OF_WORD *seq_bits);
+/* returns true if the corresponding bit in the given seq_bits indicates true
+ * and curr_seqno is within range of last_seqno */
+uint8_t get_bit_status(TYPE_OF_WORD *seq_bits, uint16_t last_seqno,
+ uint16_t curr_seqno);
-void bit_init(TYPE_OF_WORD *seq_bits);
-uint8_t get_bit_status(TYPE_OF_WORD *seq_bits, uint16_t last_seqno, uint16_t curr_seqno);
-char *bit_print(TYPE_OF_WORD *seq_bits);
+/* 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);
-char bit_get_packet(TYPE_OF_WORD *seq_bits, int16_t seq_num_diff, int8_t set_mark);
+
+
+/* receive and process one packet, returns 1 if received seq_num is considered
+ * new, 0 if old */
+char bit_get_packet(TYPE_OF_WORD *seq_bits, int16_t seq_num_diff,
+ int8_t set_mark);
+
+/* count the hamming weight, how many good packets did we receive? */
int bit_packet_count(TYPE_OF_WORD *seq_bits);
-uint8_t bit_count(int32_t to_count);
+/* print the packet array, for debugging purposes */
+char *bit_print(TYPE_OF_WORD *seq_bits);
Hi Folks
This patch fixes a few typos and spelling errors.
Andrew
Index: send.c
===================================================================
--- send.c (revision 1340)
+++ send.c (working copy)
@@ -143,7 +143,7 @@
batman_packet->tq = (batman_packet->tq * (TQ_MAX_VALUE - (2 * TQ_HOP_PENALTY))) / (TQ_MAX_VALUE);
debug_log(LOG_TYPE_BATMAN,
- "%s %spacket (originator %s, seqno %d, TQ %d, TTL %d, IDF %s) on interface %s [%s]\n",
+ "%s %s packet (originator %s, seqno %d, TQ %d, TTL %d, IDF %s) on interface %s [%s]\n",
(packet_num > 0 ? "Forwarding" : (forw_packet->own ? "Sending own" : "Forwarding")),
(packet_num > 0 ? "aggregated " : ""), orig_str, ntohs(batman_packet->seqno),
batman_packet->tq, batman_packet->ttl,
Index: hard-interface.c
===================================================================
--- hard-interface.c (revision 1340)
+++ hard-interface.c (working copy)
@@ -314,7 +314,7 @@
return;
/**
- * wait for readers of the the interfaces, so update won't be a problem.
+ * wait for readers of the interfaces, so update won't be a problem.
* this function is not time critical and can wait a bit ....
*/
synchronize_rcu();
Index: README
===================================================================
--- README (revision 1340)
+++ README (working copy)
@@ -57,7 +57,7 @@
# cat /proc/net/batman-adv/vis
-This output can be processeed with graphviz-tools like dot.
+This output can be processed with graphviz-tools like dot.
The labels are similar/compatible to the ETX metric, 1.0 means perfect
connection (100%), 2.0 means 50%, 3.0 means 33% and so on.
Index: aggregation.c
===================================================================
--- aggregation.c (revision 1340)
+++ aggregation.c (working copy)
@@ -59,7 +59,7 @@
batman_packet = (struct batman_packet *)forw_packet_pos->packet_buff;
/**
- * check aggregation compability
+ * check aggregation compatibility
* -> direct link packets are broadcasted on their interface only
* -> aggregate packet if the current packet is a "global" packet
* as well as the base packet
Index: routing.c
===================================================================
--- routing.c (revision 1340)
+++ routing.c (working copy)
@@ -76,7 +76,7 @@
kfree(neigh_node);
}
- hna_global_del_orig(orig_node, "originator timeouted");
+ hna_global_del_orig(orig_node, "originator timed out");
kfree(orig_node->bcast_own);
kfree(orig_node->bcast_own_sum);
@@ -158,7 +158,7 @@
if ((orig_node->router != NULL) && (neigh_node == NULL)) {
debug_log(LOG_TYPE_ROUTES, "Deleting route towards: %s\n", orig_str);
- hna_global_del_orig(orig_node, "originator timeouted");
+ hna_global_del_orig(orig_node, "originator timed out");
/* route added */
} else if ((orig_node->router == NULL) && (neigh_node != NULL)) {
@@ -247,7 +247,7 @@
/*
* 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE
* this does affect the nearly-symmetric links only a little,
- * but punishes asymetric links more.
+ * but punishes asymmetric links more.
* this will give a value between 0 and TQ_MAX_VALUE
*/
orig_neigh_node->tq_asym_penalty = TQ_MAX_VALUE - (TQ_MAX_VALUE *
@@ -258,7 +258,7 @@
batman_packet->tq = ((batman_packet->tq * orig_neigh_node->tq_own * orig_neigh_node->tq_asym_penalty) / (TQ_MAX_VALUE * TQ_MAX_VALUE));
- debug_log(LOG_TYPE_BATMAN, "bidirectional: orig = %-15s neigh = %-15s => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penality: %3i, total tq: %3i \n",
+ debug_log(LOG_TYPE_BATMAN, "bidirectional: orig = %-15s neigh = %-15s => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, total tq: %3i \n",
orig_str, neigh_str, total_count, neigh_node->real_packet_count, orig_neigh_node->tq_own, orig_neigh_node->tq_asym_penalty, batman_packet->tq);
/* if link has the minimum required transmission quality consider it bidirectional */
@@ -451,9 +451,9 @@
if (orig_neigh_node == NULL)
return;
- /* drop packet if sender is not a direct neighbor and if we no route towards it */
+ /* drop packet if sender is not a direct neighbor and if we don't route towards it */
if (!is_single_hop_neigh && (orig_neigh_node->router == NULL)) {
- debug_log(LOG_TYPE_BATMAN, "Drop packet: OGM via unkown neighbor! \n");
+ debug_log(LOG_TYPE_BATMAN, "Drop packet: OGM via unknown neighbor! \n");
return;
}
@@ -662,7 +662,7 @@
if (!is_my_mac(ethhdr->h_dest))
continue;
- /* drop packet if it has not neccessary minimum size */
+ /* drop packet if it has not necessary minimum size */
if (result < sizeof(struct ethhdr) + sizeof(struct icmp_packet))
continue;
@@ -761,7 +761,7 @@
if (!is_my_mac(ethhdr->h_dest))
continue;
- /* drop packet if it has not neccessary minimum size */
+ /* drop packet if it has not necessary minimum size */
if (result < sizeof(struct ethhdr) + sizeof(struct unicast_packet))
continue;
@@ -809,7 +809,7 @@
if (is_bcast(ethhdr->h_source))
continue;
- /* drop packet if it has not neccessary minimum size */
+ /* drop packet if it has not necessary minimum size */
if (result < sizeof(struct ethhdr) + sizeof(struct bcast_packet))
continue;
Index: main.h
===================================================================
--- main.h (revision 1340)
+++ main.h (working copy)
@@ -34,7 +34,7 @@
#define PURGE_TIMEOUT 200000 /* purge originators after time in ms if no valid packet comes in -> TODO: check influence on TQ_LOCAL_WINDOW_SIZE */
#define LOCAL_HNA_TIMEOUT 3600000
-#define TQ_LOCAL_WINDOW_SIZE 64 /* sliding packet range of received originator messages in squence numbers (should be a multiple of our word size) */
+#define TQ_LOCAL_WINDOW_SIZE 64 /* sliding packet range of received originator messages in sequence numbers (should be a multiple of our word size) */
#define TQ_GLOBAL_WINDOW_SIZE 10
#define TQ_LOCAL_BIDRECT_SEND_MINIMUM 1
#define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1
Fix a few typo's and spelling errors i noticed while reading through
the code. No functional changes.
Signed-off-by: Andrew Lunn <andrew.lunn(a)ascom.ch>
Index: batman-adv-kernelland/send.c
===================================================================
--- batman-adv-kernelland/send.c (revision 1341)
+++ batman-adv-kernelland/send.c (working copy)
@@ -143,7 +143,7 @@
batman_packet->tq = (batman_packet->tq * (TQ_MAX_VALUE - (2 * TQ_HOP_PENALTY))) / (TQ_MAX_VALUE);
debug_log(LOG_TYPE_BATMAN,
- "%s %spacket (originator %s, seqno %d, TQ %d, TTL %d, IDF %s) on interface %s [%s]\n",
+ "%s %s packet (originator %s, seqno %d, TQ %d, TTL %d, IDF %s) on interface %s [%s]\n",
(packet_num > 0 ? "Forwarding" : (forw_packet->own ? "Sending own" : "Forwarding")),
(packet_num > 0 ? "aggregated " : ""), orig_str, ntohs(batman_packet->seqno),
batman_packet->tq, batman_packet->ttl,
Index: batman-adv-kernelland/hard-interface.c
===================================================================
--- batman-adv-kernelland/hard-interface.c (revision 1341)
+++ batman-adv-kernelland/hard-interface.c (working copy)
@@ -314,7 +314,7 @@
return;
/**
- * wait for readers of the the interfaces, so update won't be a problem.
+ * wait for readers of the interfaces, so update won't be a problem.
* this function is not time critical and can wait a bit ....
*/
synchronize_rcu();
Index: batman-adv-kernelland/README
===================================================================
--- batman-adv-kernelland/README (revision 1341)
+++ batman-adv-kernelland/README (working copy)
@@ -57,7 +57,7 @@
# cat /proc/net/batman-adv/vis
-This output can be processeed with graphviz-tools like dot.
+This output can be processed with graphviz-tools like dot.
The labels are similar/compatible to the ETX metric, 1.0 means perfect
connection (100%), 2.0 means 50%, 3.0 means 33% and so on.
Index: batman-adv-kernelland/aggregation.c
===================================================================
--- batman-adv-kernelland/aggregation.c (revision 1341)
+++ batman-adv-kernelland/aggregation.c (working copy)
@@ -59,7 +59,7 @@
batman_packet = (struct batman_packet *)forw_packet_pos->packet_buff;
/**
- * check aggregation compability
+ * check aggregation compatibility
* -> direct link packets are broadcasted on their interface only
* -> aggregate packet if the current packet is a "global" packet
* as well as the base packet
Index: batman-adv-kernelland/routing.c
===================================================================
--- batman-adv-kernelland/routing.c (revision 1341)
+++ batman-adv-kernelland/routing.c (working copy)
@@ -76,7 +76,7 @@
kfree(neigh_node);
}
- hna_global_del_orig(orig_node, "originator timeouted");
+ hna_global_del_orig(orig_node, "originator timed out");
kfree(orig_node->bcast_own);
kfree(orig_node->bcast_own_sum);
@@ -158,7 +158,7 @@
if ((orig_node->router != NULL) && (neigh_node == NULL)) {
debug_log(LOG_TYPE_ROUTES, "Deleting route towards: %s\n", orig_str);
- hna_global_del_orig(orig_node, "originator timeouted");
+ hna_global_del_orig(orig_node, "originator timed out");
/* route added */
} else if ((orig_node->router == NULL) && (neigh_node != NULL)) {
@@ -247,7 +247,7 @@
/*
* 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE
* this does affect the nearly-symmetric links only a little,
- * but punishes asymetric links more.
+ * but punishes asymmetric links more.
* this will give a value between 0 and TQ_MAX_VALUE
*/
orig_neigh_node->tq_asym_penalty = TQ_MAX_VALUE - (TQ_MAX_VALUE *
@@ -258,7 +258,7 @@
batman_packet->tq = ((batman_packet->tq * orig_neigh_node->tq_own * orig_neigh_node->tq_asym_penalty) / (TQ_MAX_VALUE * TQ_MAX_VALUE));
- debug_log(LOG_TYPE_BATMAN, "bidirectional: orig = %-15s neigh = %-15s => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penality: %3i, total tq: %3i \n",
+ debug_log(LOG_TYPE_BATMAN, "bidirectional: orig = %-15s neigh = %-15s => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, total tq: %3i \n",
orig_str, neigh_str, total_count, neigh_node->real_packet_count, orig_neigh_node->tq_own, orig_neigh_node->tq_asym_penalty, batman_packet->tq);
/* if link has the minimum required transmission quality consider it bidirectional */
@@ -451,9 +451,9 @@
if (orig_neigh_node == NULL)
return;
- /* drop packet if sender is not a direct neighbor and if we no route towards it */
+ /* drop packet if sender is not a direct neighbor and if we don't route towards it */
if (!is_single_hop_neigh && (orig_neigh_node->router == NULL)) {
- debug_log(LOG_TYPE_BATMAN, "Drop packet: OGM via unkown neighbor! \n");
+ debug_log(LOG_TYPE_BATMAN, "Drop packet: OGM via unknown neighbor! \n");
return;
}
@@ -662,7 +662,7 @@
if (!is_my_mac(ethhdr->h_dest))
continue;
- /* drop packet if it has not neccessary minimum size */
+ /* drop packet if it has not necessary minimum size */
if (result < sizeof(struct ethhdr) + sizeof(struct icmp_packet))
continue;
@@ -761,7 +761,7 @@
if (!is_my_mac(ethhdr->h_dest))
continue;
- /* drop packet if it has not neccessary minimum size */
+ /* drop packet if it has not necessary minimum size */
if (result < sizeof(struct ethhdr) + sizeof(struct unicast_packet))
continue;
@@ -809,7 +809,7 @@
if (is_bcast(ethhdr->h_source))
continue;
- /* drop packet if it has not neccessary minimum size */
+ /* drop packet if it has not necessary minimum size */
if (result < sizeof(struct ethhdr) + sizeof(struct bcast_packet))
continue;
Index: batman-adv-kernelland/main.h
===================================================================
--- batman-adv-kernelland/main.h (revision 1341)
+++ batman-adv-kernelland/main.h (working copy)
@@ -34,7 +34,7 @@
#define PURGE_TIMEOUT 200000 /* purge originators after time in ms if no valid packet comes in -> TODO: check influence on TQ_LOCAL_WINDOW_SIZE */
#define LOCAL_HNA_TIMEOUT 3600000
-#define TQ_LOCAL_WINDOW_SIZE 64 /* sliding packet range of received originator messages in squence numbers (should be a multiple of our word size) */
+#define TQ_LOCAL_WINDOW_SIZE 64 /* sliding packet range of received originator messages in sequence numbers (should be a multiple of our word size) */
#define TQ_GLOBAL_WINDOW_SIZE 10
#define TQ_LOCAL_BIDRECT_SEND_MINIMUM 1
#define TQ_LOCAL_BIDRECT_RECV_MINIMUM 1