From patchwork Wed Mar 19 17:55:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 3922 Return-Path: Received: from s3.neomailbox.net (s3.neomailbox.net [178.209.62.157]) by open-mesh.org (Postfix) with ESMTPS id 5B77D60229F for ; Wed, 19 Mar 2014 18:55:59 +0100 (CET) From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 19 Mar 2014 18:55:37 +0100 Message-Id: <1395251747-27289-1-git-send-email-antonio@meshcoding.com> MIME-Version: 1.0 Cc: Antonio Quartulli Subject: [B.A.T.M.A.N.] [PATCHv4 next 01/11] batman-adv: remove useless goto X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 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: Wed, 19 Mar 2014 17:55:59 -0000 There is no need to use a label and a goto for code that is used once only. Moreover having a goto for a single return statement should always be avoided. Introduced by e368857f66620b8483166e8e6556d9c87f9b3e71 ("batman-adv: Multicast Listener Announcements via Translation Table") Cc: Linus Lüssing Signed-off-by: Antonio Quartulli --- Changes from v3: - simply has_bridge() function even more Changes from v2: - added compat code change to 2/11 to accommodate new use of netdev_master_upper_dev_get_rcu() Changes from v1: - change "we are out of memory" to "in case of memory allocation failure" in 3/11 - fix commit message in 10/11 multicast.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/multicast.c b/multicast.c index 998b429..d92de1e 100644 --- a/multicast.c +++ b/multicast.c @@ -194,12 +194,10 @@ static bool batadv_mcast_has_bridge(struct batadv_priv *bat_priv) bridge = batadv_mcast_get_bridge(bat_priv); if (!bridge) - goto out; + return false; dev_put(bridge); return true; -out: - return false; } /**