All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: dev: reduce both ingress hook ifdefs
@ 2015-05-19 20:33 Daniel Borkmann
  2015-05-20 12:39 ` Pablo Neira Ayuso
  2015-05-21 20:59 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Borkmann @ 2015-05-19 20:33 UTC (permalink / raw)
  To: davem; +Cc: pablo, ast, netdev, Daniel Borkmann

Reduce ifdef pollution slightly, no functional change. We can simply
remove the extra alternative definition of handle_ing() and nf_ingress().

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
 net/core/dev.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 0e7afef..594163d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3627,11 +3627,11 @@ int (*br_fdb_test_addr_hook)(struct net_device *dev,
 EXPORT_SYMBOL_GPL(br_fdb_test_addr_hook);
 #endif
 
-#ifdef CONFIG_NET_CLS_ACT
 static inline struct sk_buff *handle_ing(struct sk_buff *skb,
 					 struct packet_type **pt_prev,
 					 int *ret, struct net_device *orig_dev)
 {
+#ifdef CONFIG_NET_CLS_ACT
 	struct tcf_proto *cl = rcu_dereference_bh(skb->dev->ingress_cl_list);
 	struct tcf_result cl_res;
 
@@ -3665,17 +3665,9 @@ static inline struct sk_buff *handle_ing(struct sk_buff *skb,
 	default:
 		break;
 	}
-
-	return skb;
-}
-#else
-static inline struct sk_buff *handle_ing(struct sk_buff *skb,
-					 struct packet_type **pt_prev,
-					 int *ret, struct net_device *orig_dev)
-{
+#endif /* CONFIG_NET_CLS_ACT */
 	return skb;
 }
-#endif
 
 /**
  *	netdev_rx_handler_register - register receive handler
@@ -3748,10 +3740,10 @@ static bool skb_pfmemalloc_protocol(struct sk_buff *skb)
 	}
 }
 
-#ifdef CONFIG_NETFILTER_INGRESS
 static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
 			     int *ret, struct net_device *orig_dev)
 {
+#ifdef CONFIG_NETFILTER_INGRESS
 	if (nf_hook_ingress_active(skb)) {
 		if (*pt_prev) {
 			*ret = deliver_skb(skb, *pt_prev, orig_dev);
@@ -3760,15 +3752,9 @@ static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
 
 		return nf_hook_ingress(skb);
 	}
+#endif /* CONFIG_NETFILTER_INGRESS */
 	return 0;
 }
-#else
-static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
-			     int *ret, struct net_device *orig_dev)
-{
-	return 0;
-}
-#endif
 
 static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc)
 {
-- 
1.9.3

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

* Re: [PATCH net-next] net: dev: reduce both ingress hook ifdefs
  2015-05-19 20:33 [PATCH net-next] net: dev: reduce both ingress hook ifdefs Daniel Borkmann
@ 2015-05-20 12:39 ` Pablo Neira Ayuso
  2015-05-21 20:59 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2015-05-20 12:39 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: davem, ast, netdev

On Tue, May 19, 2015 at 10:33:25PM +0200, Daniel Borkmann wrote:
> Reduce ifdef pollution slightly, no functional change. We can simply
> remove the extra alternative definition of handle_ing() and nf_ingress().
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

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

* Re: [PATCH net-next] net: dev: reduce both ingress hook ifdefs
  2015-05-19 20:33 [PATCH net-next] net: dev: reduce both ingress hook ifdefs Daniel Borkmann
  2015-05-20 12:39 ` Pablo Neira Ayuso
@ 2015-05-21 20:59 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-05-21 20:59 UTC (permalink / raw)
  To: daniel; +Cc: pablo, ast, netdev

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Tue, 19 May 2015 22:33:25 +0200

> Reduce ifdef pollution slightly, no functional change. We can simply
> remove the extra alternative definition of handle_ing() and nf_ingress().
> 
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied, thanks Daniel.

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

end of thread, other threads:[~2015-05-21 20:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 20:33 [PATCH net-next] net: dev: reduce both ingress hook ifdefs Daniel Borkmann
2015-05-20 12:39 ` Pablo Neira Ayuso
2015-05-21 20:59 ` David Miller

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.