diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2012-08-03 19:15:46 +0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-10-29 12:42:29 +0400 |
commit | 30da63a6af1dbf60e6d989faa4b984b1c6c9dfaf (patch) | |
tree | 6c596e108d2e0e65fe5914f71eef978076459b43 /net/batman-adv/originator.c | |
parent | f03a13a7167caeb550b3c424da1be691bfbe54ff (diff) | |
download | linux-30da63a6af1dbf60e6d989faa4b984b1c6c9dfaf.tar.xz |
batman-adv: consolidate duplicated primary_if checking code
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r-- | net/batman-adv/originator.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index ac9bdf8f80a6..d9c14b8fca0e 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -415,23 +415,10 @@ int batadv_orig_seq_print_text(struct seq_file *seq, void *offset) int last_seen_msecs; unsigned long last_seen_jiffies; uint32_t i; - int ret = 0; - primary_if = batadv_primary_if_get_selected(bat_priv); - - if (!primary_if) { - ret = seq_printf(seq, - "BATMAN mesh %s disabled - please specify interfaces to enable it\n", - net_dev->name); - goto out; - } - - if (primary_if->if_status != BATADV_IF_ACTIVE) { - ret = seq_printf(seq, - "BATMAN mesh %s disabled - primary interface not active\n", - net_dev->name); + primary_if = batadv_seq_print_text_primary_if_get(seq); + if (!primary_if) goto out; - } seq_printf(seq, "[B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n", BATADV_SOURCE_VERSION, primary_if->net_dev->name, @@ -485,7 +472,7 @@ next: out: if (primary_if) batadv_hardif_free_ref(primary_if); - return ret; + return 0; } static int batadv_orig_node_add_if(struct batadv_orig_node *orig_node, |