netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
	hadi@cyberus.ca
Subject: [NET_SCHED 08/09]: sch_ingress: avoid a few
Date: Sun, 20 Jan 2008 15:32:40 +0100 (MET)	[thread overview]
Message-ID: <20080120143141.27801.77683.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080120143130.27801.94188.sendpatchset@localhost.localdomain>

commit 3320bc3c5d9a6c1dd96d515b7b6a4dee9cd31fd7
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Jan 17 09:17:58 2008 +0100

    [NET_SCHED]: sch_ingress: avoid a few #ifdefs
    
    Move the repeating "ifndef CONFIG_NET_CLS_ACT/ifdef CONFIG_NETFILTER" ifdefs
    into a single condition.
    
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index b30ca01..4c7f7e7 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -20,11 +20,9 @@
 
 
 /* Thanks to Doron Oz for this hack */
-#ifndef CONFIG_NET_CLS_ACT
-#ifdef CONFIG_NETFILTER
+#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
 static int nf_registered;
 #endif
-#endif
 
 struct ingress_qdisc_data {
 	struct tcf_proto	*filter_list;
@@ -118,8 +116,7 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 	return result;
 }
 
-#ifndef CONFIG_NET_CLS_ACT
-#ifdef CONFIG_NETFILTER
+#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
 static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb,
 			     const struct net_device *indev,
 			     const struct net_device *outdev,
@@ -158,12 +155,10 @@ static struct nf_hook_ops ing_ops[] __read_mostly = {
 	},
 };
 #endif
-#endif
 
 static int ingress_init(struct Qdisc *sch, struct rtattr *opt)
 {
-#ifndef CONFIG_NET_CLS_ACT
-#ifdef CONFIG_NETFILTER
+#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
 	printk("Ingress scheduler: Classifier actions prefered over netfilter\n");
 
 	if (!nf_registered) {
@@ -174,7 +169,6 @@ static int ingress_init(struct Qdisc *sch, struct rtattr *opt)
 		nf_registered++;
 	}
 #endif
-#endif
 	return 0;
 }
 
@@ -240,12 +234,10 @@ static int __init ingress_module_init(void)
 static void __exit ingress_module_exit(void)
 {
 	unregister_qdisc(&ingress_qdisc_ops);
-#ifndef CONFIG_NET_CLS_ACT
-#ifdef CONFIG_NETFILTER
+#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
 	if (nf_registered)
 		nf_unregister_hooks(ing_ops, ARRAY_SIZE(ing_ops));
 #endif
-#endif
 }
 
 module_init(ingress_module_init)

  parent reply	other threads:[~2008-01-20 14:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-20 14:32 [NET_SCHED 00/09]: sch_ingress cleanups Patrick McHardy
2008-01-20 14:32 ` [NET_SCHED 01/09]: sch_ingress: formatting fixes Patrick McHardy
2008-01-20 14:32 ` [NET_SCHED 02/09]: sch_ingress: remove excessive debugging Patrick McHardy
2008-01-20 14:32 ` [NET_SCHED 03/09]: sch_ingress: remove qdisc_priv() wrapper Patrick McHardy
2008-01-20 14:32 ` [NET_SCHED 04/09]: sch_ingress: remove unused inner qdisc Patrick McHardy
2008-01-20 14:32 ` [NET_SCHED 05/09]: sch_ingress: return proper error code in ingress_graft() Patrick McHardy
2008-01-20 14:32 ` [NET_SCHED 06/09]: sch_ingress: remove unnecessary ops Patrick McHardy
2008-01-20 14:32 ` [NET_SCHED 07/09]: sch_ingress: move dependencies to Kconfig Patrick McHardy
2008-01-20 14:32 ` Patrick McHardy [this message]
2008-01-20 14:32 ` [NET_SCHED 09/09]: sch_ingress: remove useless printk Patrick McHardy
2008-01-20 15:31 ` [NET_SCHED 00/09]: sch_ingress cleanups jamal
2008-01-20 15:35   ` Patrick McHardy
2008-01-20 16:35     ` Stephen Hemminger
2008-01-21  8:14   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080120143141.27801.77683.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=hadi@cyberus.ca \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).