[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110614235142.3724.92963.stgit@warthog.procyon.org.uk>
Date: Wed, 15 Jun 2011 00:51:42 +0100
From: David Howells <dhowells@...hat.com>
To: unlisted-recipients:; (no To-header on input)
Cc: David Howells <dhowells@...hat.com>,
Marek Lindner <lindner_marek@...oo.de>,
Simon Wunderlich <siwu@....tu-chemnitz.de>,
Sven Eckelmann <sven@...fation.org>,
b.a.t.m.a.n@...ts.open-mesh.org, netdev@...r.kernel.org
Subject: [PATCH 2/2] batman-adv: compare_eth() should take const pointer
arguments
compare_eth() should take const pointer arguments so that it can be passed
const pointers without the need for a cast, leading to:
net/batman-adv/vis.c: In function 'vis_data_insert_interface':
net/batman-adv/vis.c:146: warning: passing argument 2 of 'compare_eth' discards qualifiers from pointer target type
Signed-off-by: David Howells <dhowells@...hat.com>
cc: Marek Lindner <lindner_marek@...oo.de>
cc: Simon Wunderlich <siwu@....tu-chemnitz.de>
cc: Sven Eckelmann <sven@...fation.org>
cc: b.a.t.m.a.n@...ts.open-mesh.org
cc: netdev@...r.kernel.org
---
net/batman-adv/main.h | 2 +-
net/batman-adv/vis.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 148b49e..e6fc798 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -172,7 +172,7 @@ static inline void bat_dbg(char type __always_unused,
*
* note: can't use compare_ether_addr() as it requires aligned memory
*/
-static inline int compare_eth(void *data1, void *data2)
+static inline int compare_eth(const void *data1, const void *data2)
{
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
}
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index c39f20c..34053ac 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -143,7 +143,7 @@ static void vis_data_insert_interface(const uint8_t *interface,
struct hlist_node *pos;
hlist_for_each_entry(entry, pos, if_list, list) {
- if (compare_eth(entry->addr, (void *)interface))
+ if (compare_eth(entry->addr, interface))
return;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists