b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCHv4 next 01/11] batman-adv: remove useless goto
@ 2014-03-19 17:55 Antonio Quartulli
  2014-03-19 17:55 ` [B.A.T.M.A.N.] [PATCHv4 next 02/11] batman-adv: don't mess up with the netdev refcounting if not needed Antonio Quartulli
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Antonio Quartulli @ 2014-03-19 17:55 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

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 <linus.luessing@web.de>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
---

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;
 }
 
 /**
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-03-21  8:40 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-19 17:55 [B.A.T.M.A.N.] [PATCHv4 next 01/11] batman-adv: remove useless goto Antonio Quartulli
2014-03-19 17:55 ` [B.A.T.M.A.N.] [PATCHv4 next 02/11] batman-adv: don't mess up with the netdev refcounting if not needed Antonio Quartulli
2014-03-21  8:29   ` Marek Lindner
2014-03-19 17:55 ` [B.A.T.M.A.N.] [PATCHv4 next 03/11] batman-adv: fix multicast kerneldoc Antonio Quartulli
2014-03-21  8:30   ` Marek Lindner
2014-03-19 17:55 ` [B.A.T.M.A.N.] [PATCHv4 next 04/11] " Antonio Quartulli
2014-03-21  8:31   ` Marek Lindner
2014-03-19 17:57 ` [B.A.T.M.A.N.] [PATCHv4 next 05/11] " Antonio Quartulli
2014-03-19 17:57   ` [B.A.T.M.A.N.] [PATCHv4 next 06/11] " Antonio Quartulli
2014-03-21  8:33     ` Marek Lindner
2014-03-19 17:57   ` [B.A.T.M.A.N.] [PATCHv4 next 07/11] " Antonio Quartulli
2014-03-21  8:34     ` Marek Lindner
2014-03-19 17:57   ` [B.A.T.M.A.N.] [PATCHv4 next 08/11] batman-adv: adjust copyright disclaimer in multicast files Antonio Quartulli
2014-03-21  8:35     ` Marek Lindner
2014-03-19 17:57   ` [B.A.T.M.A.N.] [PATCHv4 next 09/11] batman-adv: fix code style Antonio Quartulli
2014-03-21  8:37     ` Marek Lindner
2014-03-19 17:57   ` [B.A.T.M.A.N.] [PATCHv4 next 10/11] batman-adv: fix more " Antonio Quartulli
2014-03-21  8:39     ` Marek Lindner
2014-03-19 17:57   ` [B.A.T.M.A.N.] [PATCHv4 next 11/11] " Antonio Quartulli
2014-03-21  8:40     ` Marek Lindner
2014-03-21  8:32   ` [B.A.T.M.A.N.] [PATCHv4 next 05/11] batman-adv: fix multicast kerneldoc Marek Lindner
2014-03-21  8:27 ` [B.A.T.M.A.N.] [PATCHv4 next 01/11] batman-adv: remove useless goto Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).