From patchwork Tue Jun 14 23:51:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 100459 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 20413B6F65 for ; Wed, 15 Jun 2011 09:51:57 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752207Ab1FNXvv (ORCPT ); Tue, 14 Jun 2011 19:51:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29697 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303Ab1FNXvv (ORCPT ); Tue, 14 Jun 2011 19:51:51 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5ENpkUN024340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Jun 2011 19:51:46 -0400 Received: from warthog.procyon.org.uk ([10.3.112.12]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p5ENphdP030576; Tue, 14 Jun 2011 19:51:44 -0400 From: David Howells Subject: [PATCH 2/2] batman-adv: compare_eth() should take const pointer arguments Cc: David Howells , Marek Lindner , Simon Wunderlich , Sven Eckelmann , b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org Date: Wed, 15 Jun 2011 00:51:42 +0100 Message-ID: <20110614235142.3724.92963.stgit@warthog.procyon.org.uk> In-Reply-To: <20110614235132.3724.57632.stgit@warthog.procyon.org.uk> References: <20110614235132.3724.57632.stgit@warthog.procyon.org.uk> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 To: unlisted-recipients:; (no To-header on input) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 cc: Marek Lindner cc: Simon Wunderlich cc: Sven Eckelmann cc: b.a.t.m.a.n@lists.open-mesh.org cc: netdev@vger.kernel.org --- net/batman-adv/main.h | 2 +- net/batman-adv/vis.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }