* Re: [PATCH net-next] ipmr: change the prototype of ip_mr_forward().
2013-07-04 18:24 [PATCH net-next] ipmr: change the prototype of ip_mr_forward() Rami Rosen
@ 2013-07-04 16:49 ` Nicolas Dichtel
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Dichtel @ 2013-07-04 16:49 UTC (permalink / raw)
To: Rami Rosen; +Cc: davem, netdev
Le 04/07/2013 20:24, Rami Rosen a écrit :
> 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.
>
> Signed-off-by: Rami Rosen <ramirose@gmail.com>
> ---
> net/ipv4/ipmr.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
> index 132a096..eca2742 100644
> --- a/net/ipv4/ipmr.c
> +++ b/net/ipv4/ipmr.c
> @@ -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,14 @@ 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;
> + return;
This is the end of the function, you can just remove this 'return'.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH net-next] ipmr: change the prototype of ip_mr_forward().
@ 2013-07-04 18:24 Rami Rosen
2013-07-04 16:49 ` Nicolas Dichtel
0 siblings, 1 reply; 2+ messages in thread
From: Rami Rosen @ 2013-07-04 18:24 UTC (permalink / raw)
To: davem; +Cc: netdev, nicolas.dichtel, 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.
Signed-off-by: Rami Rosen <ramirose@gmail.com>
---
net/ipv4/ipmr.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 132a096..eca2742 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -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,14 @@ 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;
+ return;
}
static struct mr_table *ipmr_rt_fib_lookup(struct net *net, struct sk_buff *skb)
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-04 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04 18:24 [PATCH net-next] ipmr: change the prototype of ip_mr_forward() Rami Rosen
2013-07-04 16:49 ` Nicolas Dichtel
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.