From patchwork Sat May 1 13:10:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 93 Return-Path: Received: from londo.lunn.ch (londo.lunn.ch [80.238.139.98]) by open-mesh.net (Postfix) with ESMTP id 0FD7F15430B for ; Sat, 1 May 2010 15:10:13 +0200 (CEST) Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1O8CSQ-000079-00; Sat, 01 May 2010 15:10:10 +0200 From: Andrew Lunn To: lindner_marek@yahoo.de Date: Sat, 1 May 2010 15:10:08 +0200 Message-Id: <1272719410-406-3-git-send-email-andrew@lunn.ch> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1272719410-406-1-git-send-email-andrew@lunn.ch> References: <1272719410-406-1-git-send-email-andrew@lunn.ch> Sender: Andrew Lunn Cc: b.a.t.m.a.n@lists.open-mesh.net Subject: [B.A.T.M.A.N.] [PATCH 2/4] batman-adv: Import sparse fixes from mainline. X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2010 13:10:14 -0000 I fixed sparce warnings as i moved patches from maint to mainline. This patch move the fixes back to maint. Signed-off-by: Andrew Lunn Acked-by: Sven Eckelmann --- bat_sysfs.c | 9 ++++++--- vis.c | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bat_sysfs.c b/bat_sysfs.c index 7acf8d8..e2c000b 100644 --- a/bat_sysfs.c +++ b/bat_sysfs.c @@ -357,7 +357,8 @@ void sysfs_del_meshif(struct net_device *dev) static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr, char *buff) { - struct net_device *net_dev = to_net_dev(to_dev(kobj->parent)); + struct device *dev = to_dev(kobj->parent); + struct net_device *net_dev = to_net_dev(dev); struct batman_if *batman_if = get_batman_if_by_netdev(net_dev); if (!batman_if) @@ -371,7 +372,8 @@ static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr, static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, char *buff, size_t count) { - struct net_device *net_dev = to_net_dev(to_dev(kobj->parent)); + struct device *dev = to_dev(kobj->parent); + struct net_device *net_dev = to_net_dev(dev); struct batman_if *batman_if = get_batman_if_by_netdev(net_dev); int status_tmp = -1; @@ -409,7 +411,8 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr, char *buff) { - struct net_device *net_dev = to_net_dev(to_dev(kobj->parent)); + struct device *dev = to_dev(kobj->parent); + struct net_device *net_dev = to_net_dev(dev); struct batman_if *batman_if = get_batman_if_by_netdev(net_dev); if (!batman_if) diff --git a/vis.c b/vis.c index 3144439..bac1401 100644 --- a/vis.c +++ b/vis.c @@ -103,7 +103,7 @@ static int vis_info_choose(void *data, int size) /* insert interface to the list of interfaces of one originator, if it * does not already exist in the list */ -void vis_data_insert_interface(const uint8_t *interface, +static void vis_data_insert_interface(const uint8_t *interface, struct hlist_head *if_list, bool primary) { @@ -124,7 +124,7 @@ void vis_data_insert_interface(const uint8_t *interface, hlist_add_head(&entry->list, if_list); } -ssize_t vis_data_read_prim_sec(char *buff, struct hlist_head *if_list) +static ssize_t vis_data_read_prim_sec(char *buff, struct hlist_head *if_list) { struct if_list_entry *entry; struct hlist_node *pos; @@ -144,8 +144,8 @@ ssize_t vis_data_read_prim_sec(char *buff, struct hlist_head *if_list) } /* read an entry */ -ssize_t vis_data_read_entry(char *buff, struct vis_info_entry *entry, - uint8_t *src, bool primary) +static ssize_t vis_data_read_entry(char *buff, struct vis_info_entry *entry, + uint8_t *src, bool primary) { char to[40];