Skip to contentSkip to conversation

ipmr: change the prototype of ip_mr_forward().

PATCH Superseded Rami Rosen 3 participants 3 messages Jul 4, 2013

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Rami Rosen

author
#0 lore raw

PATCH v2 1/1 ipmr: change the prototype of ip_mr_forward().

This patch changes the prototpye of the ip_mr_forward() method to return void instead of int.

The ip_mr_forward() method always returns 0; moreover, the retun value of this method is not checked anywhere.

---
 net/ipv4/ipmr.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
net/ipv4/ipmr.c +3 -4
index 132a096..83030bf 100644
@@ -127,7 +127,7 @@ static struct kmem_cache *mrt_cachep __read_mostly;
 static struct mr_table *ipmr_new_table(struct net *net, u32 id);
 static void ipmr_free_table(struct mr_table *mrt);
 
-static int ip_mr_forward(struct net *net, struct mr_table *mrt,
+static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 			 struct sk_buff *skb, struct mfc_cache *cache,
 			 int local);
 static int ipmr_cache_report(struct mr_table *mrt,
@@ -1795,7 +1795,7 @@ static int ipmr_find_vif(struct mr_table *mrt, struct net_device *dev)
 
 /* "local" means that we should preserve one skb (for local delivery) */
 
-static int ip_mr_forward(struct net *net, struct mr_table *mrt,
+static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 			 struct sk_buff *skb, struct mfc_cache *cache,
 			 int local)
 {
@@ -1903,14 +1903,13 @@ last_forward:
 				ipmr_queue_xmit(net, mrt, skb2, cache, psend);
 		} else {
 			ipmr_queue_xmit(net, mrt, skb, cache, psend);
-			return 0;
+			return;
 		}
 	}
 
 dont_forward:
 	if (!local)
 		kfree_skb(skb);
-	return 0;
 }
 
 static struct mr_table *ipmr_rt_fib_lookup(struct net *net, struct sk_buff *skb)
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 7 lines · Rami Rosen

This patch changes the prototpye of the ip_mr_forward() method to return void instead of int.

The ip_mr_forward() method always returns 0; moreover, the retun value of this method is not checked anywhere.

net-next is currently closed. Please resend this when it opens again (announced on netdev).

Quoted 9 lines
---
  net/ipv4/ipmr.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
net/ipv4/ipmr.c +0 -0
index 132a096..83030bf 100644

net/ipv4/ipmr.c static struct kmem_cache *mrt_cachep __read_mostly; · line 132

Quoted 7 lines
net/ipv4/ipmr.c +1 -1
@@ -127,7 +127,7 @@ static struct kmem_cache *mrt_cachep __read_mostly;
  static struct mr_table *ipmr_new_table(struct net *net, u32 id);
  static void ipmr_free_table(struct mr_table *mrt);
 
-static int ip_mr_forward(struct net *net, struct mr_table *mrt,
+static void ip_mr_forward(struct net *net, struct mr_table *mrt,
  			 struct sk_buff *skb, struct mfc_cache *cache,
  			 int local);

If you change this here, please also take care of the remaining indent, which is always aligned at the same column of the opening '(', e.g.:

static void bla(int foo, ...,

		int bar, ...);

Meaning yours needs to be one more space to the right.

Quoted 27 lines
net/ipv4/ipmr.c +2 -3
  static int ipmr_cache_report(struct mr_table *mrt,
@@ -1795,7 +1795,7 @@ static int ipmr_find_vif(struct mr_table *mrt, struct net_device *dev)
 
  /* "local" means that we should preserve one skb (for local delivery) */
 
-static int ip_mr_forward(struct net *net, struct mr_table *mrt,
+static void ip_mr_forward(struct net *net, struct mr_table *mrt,
  			 struct sk_buff *skb, struct mfc_cache *cache,
  			 int local)
  {
@@ -1903,14 +1903,13 @@ last_forward:
  				ipmr_queue_xmit(net, mrt, skb2, cache, psend);
  		} else {
  			ipmr_queue_xmit(net, mrt, skb, cache, psend);
-			return 0;
+			return;
  		}
  	}
 
  dont_forward:
  	if (!local)
  		kfree_skb(skb);
-	return 0;
  }
 
  static struct mr_table *ipmr_rt_fib_lookup(struct net *net, struct sk_buff *skb)
maintainer
#2 lore raw
In reply to Rami Rosen

From: Rami Rosen <[email protected]>
Date: Fri, 5 Jul 2013 01:15:55 +0300

net/ipv4/ipmr.c static struct kmem_cache *mrt_cachep __read_mostly; · line 133

Quoted 9 lines
net/ipv4/ipmr.c +1 -1
@@ -127,7 +127,7 @@ static struct kmem_cache *mrt_cachep __read_mostly;
 static struct mr_table *ipmr_new_table(struct net *net, u32 id);
 static void ipmr_free_table(struct mr_table *mrt);
 
-static int ip_mr_forward(struct net *net, struct mr_table *mrt,
+static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 			 struct sk_buff *skb, struct mfc_cache *cache,
 			 int local);
 static int ipmr_cache_report(struct mr_table *mrt,

When you change the column that the openning parenthesis of a function declaration appears at, you must reindent all of the subsequent lines of the declaration such that the first character lines up with the first column after the openning parenthesis.

net/ipv4/ipmr.c static int ipmr_find_vif(struct mr_table *mrt, struct net_device *dev) · line 1800

Quoted 8 lines
net/ipv4/ipmr.c +1 -1
@@ -1795,7 +1795,7 @@ static int ipmr_find_vif(struct mr_table *mrt, struct net_device *dev)
 
 /* "local" means that we should preserve one skb (for local delivery) */
 
-static int ip_mr_forward(struct net *net, struct mr_table *mrt,
+static void ip_mr_forward(struct net *net, struct mr_table *mrt,
 			 struct sk_buff *skb, struct mfc_cache *cache,
 			 int local)

Likewise.