diff mbox

[v2] batman-adv: Remove unused primary_if and bat_priv variables

Message ID 1465937810-17394-1-git-send-email-linus.luessing@c0d3.blue
State Accepted, archived
Commit 7395e6466c8caa9a78171b5c51ea12e248a523db
Delegated to: Marek Lindner
Headers show

Commit Message

Linus Lüssing June 14, 2016, 8:56 p.m. UTC
Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Fixes: 29b9256e6631 ("batman-adv: consider outgoing interface in OGM sending")
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
v2:
* Remove now unused bat_priv variable, too

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

Comments

Sven Eckelmann June 16, 2016, 7:49 p.m. UTC | #1
On Tuesday 14 June 2016 22:56:50 Linus Lüssing wrote:
> Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
> Fixes: 29b9256e6631 ("batman-adv: consider outgoing interface in OGM
> sending") Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> ---

Reviewed-by: Sven Eckelmann <sven@narfation.org>


> v2:
> * Remove now unused bat_priv variable, too
> 
>  net/batman-adv/bat_iv_ogm.c | 19 ++++---------------
>  1 file changed, 4 insertions(+), 15 deletions(-)
> 
> diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
> index 19b0abd..6af4462 100644
> --- a/net/batman-adv/bat_iv_ogm.c
> +++ b/net/batman-adv/bat_iv_ogm.c
> @@ -528,36 +528,25 @@ static void batadv_iv_ogm_send_to_if(struct
> batadv_forw_packet *forw_packet, 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);
>  }
> 
>  /**
Marek Lindner June 20, 2016, 8:59 a.m. UTC | #2
On Thursday, June 16, 2016 21:49:15 Sven Eckelmann wrote:
> On Tuesday 14 June 2016 22:56:50 Linus Lüssing wrote:
> > Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
> > Fixes: 29b9256e6631 ("batman-adv: consider outgoing interface in OGM
> > sending") Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
> > ---
> 
> Reviewed-by: Sven Eckelmann <sven@narfation.org>

Applied in revision 7395e64.

Thanks,
Marek
diff mbox

Patch

diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 19b0abd..6af4462 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -528,36 +528,25 @@  static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet,
 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);
 }
 
 /**