All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] RFC: batman-adv: Remove unused primary_if variable
@ 2016-05-23 22:31 Linus Lüssing
  2016-05-24 10:00 ` Antonio Quartulli
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Lüssing @ 2016-05-23 22:31 UTC (permalink / raw)
  To: b.a.t.m.a.n

Fixes: 29b9256e6631 ("batman-adv: consider outgoing interface in OGM sending")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---

Note sure whether the "forw_packet->if_incoming != primary_if" check vanished
on purpose or by accident in the mentioned commit. Or whether it got
substituted by some other check. Therefore sending the patch as RFC.


 net/batman-adv/bat_iv_ogm.c |   17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 5a7923c..2076048 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -529,35 +529,26 @@ static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet)
 {
 	struct net_device *soft_iface;
 	struct batadv_priv *bat_priv;
-	struct batadv_hard_iface *primary_if = NULL;
 
 	if (!forw_packet->if_incoming) {
 		pr_err("Error - can't forward packet: incoming iface not specified\n");
-		goto out;
+		return;
 	}
 
 	soft_iface = forw_packet->if_incoming->soft_iface;
 	bat_priv = netdev_priv(soft_iface);
 
 	if (WARN_ON(!forw_packet->if_outgoing))
-		goto out;
+		return;
 
 	if (WARN_ON(forw_packet->if_outgoing->soft_iface != soft_iface))
-		goto out;
+		return;
 
 	if (forw_packet->if_incoming->if_status != BATADV_IF_ACTIVE)
-		goto out;
-
-	primary_if = batadv_primary_if_get_selected(bat_priv);
-	if (!primary_if)
-		goto out;
+		return;
 
 	/* only for one specific outgoing interface */
 	batadv_iv_ogm_send_to_if(forw_packet, forw_packet->if_outgoing);
-
-out:
-	if (primary_if)
-		batadv_hardif_put(primary_if);
 }
 
 /**
-- 
1.7.10.4


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

* Re: [B.A.T.M.A.N.] [PATCH] RFC: batman-adv: Remove unused primary_if variable
  2016-05-23 22:31 [B.A.T.M.A.N.] [PATCH] RFC: batman-adv: Remove unused primary_if variable Linus Lüssing
@ 2016-05-24 10:00 ` Antonio Quartulli
  2016-05-24 12:49   ` Simon Wunderlich
  0 siblings, 1 reply; 4+ messages in thread
From: Antonio Quartulli @ 2016-05-24 10:00 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

[-- Attachment #1: Type: text/plain, Size: 675 bytes --]

On Tue, May 24, 2016 at 12:31:17AM +0200, Linus Lüssing wrote:
> Fixes: 29b9256e6631 ("batman-adv: consider outgoing interface in OGM sending")
> Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> ---
> 
> Note sure whether the "forw_packet->if_incoming != primary_if" check vanished
> on purpose or by accident in the mentioned commit. Or whether it got
> substituted by some other check. Therefore sending the patch as RFC.

I think Simon can better comment on this, but my understanding is that such
check has been moved to batadv_iv_ogm_schedule(), thus primary_if is useless in
this function.

Simon, comments ?

Cheers,

-- 
Antonio Quartulli

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [B.A.T.M.A.N.] [PATCH] RFC: batman-adv: Remove unused primary_if variable
  2016-05-24 10:00 ` Antonio Quartulli
@ 2016-05-24 12:49   ` Simon Wunderlich
  2016-05-24 12:59     ` Simon Wunderlich
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wunderlich @ 2016-05-24 12:49 UTC (permalink / raw)
  To: Antonio Quartulli
  Cc: The list for a Better Approach To Mobile Ad-hoc Networking

[-- Attachment #1: Type: text/plain, Size: 880 bytes --]

Hi,

On Tuesday 24 May 2016 18:00:18 Antonio Quartulli wrote:
> On Tue, May 24, 2016 at 12:31:17AM +0200, Linus Lüssing wrote:
> > Fixes: 29b9256e6631 ("batman-adv: consider outgoing interface in OGM
> > sending") Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> > ---
> > 
> > Note sure whether the "forw_packet->if_incoming != primary_if" check
> > vanished on purpose or by accident in the mentioned commit. Or whether it
> > got substituted by some other check. Therefore sending the patch as RFC.
> I think Simon can better comment on this, but my understanding is that such
> check has been moved to batadv_iv_ogm_schedule(), thus primary_if is useless
> in this function.
> 
> Simon, comments ?

Yes, the check has been moved. I would agree that the check is redundant now. 
Please resend without RFC and add my Acked-by :)

Cheers,
     Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [B.A.T.M.A.N.] [PATCH] RFC: batman-adv: Remove unused primary_if variable
  2016-05-24 12:49   ` Simon Wunderlich
@ 2016-05-24 12:59     ` Simon Wunderlich
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Wunderlich @ 2016-05-24 12:59 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

On Tuesday 24 May 2016 14:49:31 Simon Wunderlich wrote:
> Hi,
> 
> On Tuesday 24 May 2016 18:00:18 Antonio Quartulli wrote:
> > On Tue, May 24, 2016 at 12:31:17AM +0200, Linus Lüssing wrote:
> > > Fixes: 29b9256e6631 ("batman-adv: consider outgoing interface in OGM
> > > sending") Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> > > ---
> > > 
> > > Note sure whether the "forw_packet->if_incoming != primary_if" check
> > > vanished on purpose or by accident in the mentioned commit. Or whether
> > > it
> > > got substituted by some other check. Therefore sending the patch as RFC.
> > 
> > I think Simon can better comment on this, but my understanding is that
> > such
> > check has been moved to batadv_iv_ogm_schedule(), thus primary_if is
> > useless in this function.
> > 
> > Simon, comments ?
> 
> Yes, the check has been moved. I would agree that the check is redundant
> now. Please resend without RFC and add my Acked-by :)

What I meant: the local variable is redundant now. I should start reading what 
I type up ... ;) Sorry!

    Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-05-24 12:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23 22:31 [B.A.T.M.A.N.] [PATCH] RFC: batman-adv: Remove unused primary_if variable Linus Lüssing
2016-05-24 10:00 ` Antonio Quartulli
2016-05-24 12:49   ` Simon Wunderlich
2016-05-24 12:59     ` Simon Wunderlich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.