Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58f4df42 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NET_SCHED]: sch_ingress: formatting fixes

parent 6f9e98f7
Loading
Loading
Loading
Loading
+39 −64
Original line number Original line Diff line number Diff line
@@ -33,12 +33,9 @@
#define D2PRINTK(format, args...)
#define D2PRINTK(format, args...)
#endif
#endif



#define PRIV(sch) qdisc_priv(sch)
#define PRIV(sch) qdisc_priv(sch)



/* Thanks to Doron Oz for this hack */
/* Thanks to Doron Oz for this hack
*/
#ifndef CONFIG_NET_CLS_ACT
#ifndef CONFIG_NET_CLS_ACT
#ifdef CONFIG_NETFILTER
#ifdef CONFIG_NETFILTER
static int nf_registered;
static int nf_registered;
@@ -50,10 +47,8 @@ struct ingress_qdisc_data {
	struct tcf_proto	*filter_list;
	struct tcf_proto	*filter_list;
};
};



/* ------------------------- Class/flow operations ------------------------- */
/* ------------------------- Class/flow operations ------------------------- */



static int ingress_graft(struct Qdisc *sch, unsigned long arg,
static int ingress_graft(struct Qdisc *sch, unsigned long arg,
			 struct Qdisc *new, struct Qdisc **old)
			 struct Qdisc *new, struct Qdisc **old)
{
{
@@ -67,35 +62,31 @@ static int ingress_graft(struct Qdisc *sch,unsigned long arg,
	return 1;
	return 1;
}
}



static struct Qdisc *ingress_leaf(struct Qdisc *sch, unsigned long arg)
static struct Qdisc *ingress_leaf(struct Qdisc *sch, unsigned long arg)
{
{
	return NULL;
	return NULL;
}
}



static unsigned long ingress_get(struct Qdisc *sch, u32 classid)
static unsigned long ingress_get(struct Qdisc *sch, u32 classid)
{
{
#ifdef DEBUG_INGRESS
#ifdef DEBUG_INGRESS
	struct ingress_qdisc_data *p = PRIV(sch);
	struct ingress_qdisc_data *p = PRIV(sch);
#endif
#endif
	DPRINTK("ingress_get(sch %p,[qdisc %p],classid %x)\n", sch, p, classid);
	DPRINTK("ingress_get(sch %p,[qdisc %p],classid %x)\n",
		sch, p, classid);
	return TC_H_MIN(classid) + 1;
	return TC_H_MIN(classid) + 1;
}
}



static unsigned long ingress_bind_filter(struct Qdisc *sch,
static unsigned long ingress_bind_filter(struct Qdisc *sch,
					 unsigned long parent, u32 classid)
					 unsigned long parent, u32 classid)
{
{
	return ingress_get(sch, classid);
	return ingress_get(sch, classid);
}
}



static void ingress_put(struct Qdisc *sch, unsigned long cl)
static void ingress_put(struct Qdisc *sch, unsigned long cl)
{
{
}
}



static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent,
static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent,
			  struct rtattr **tca, unsigned long *arg)
			  struct rtattr **tca, unsigned long *arg)
{
{
@@ -108,8 +99,6 @@ static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent,
	return 0;
	return 0;
}
}




static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker)
static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker)
{
{
#ifdef DEBUG_INGRESS
#ifdef DEBUG_INGRESS
@@ -119,7 +108,6 @@ static void ingress_walk(struct Qdisc *sch,struct qdisc_walker *walker)
	DPRINTK("No effect. sch_ingress doesn't maintain classes at the moment");
	DPRINTK("No effect. sch_ingress doesn't maintain classes at the moment");
}
}



static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch, unsigned long cl)
static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch, unsigned long cl)
{
{
	struct ingress_qdisc_data *p = PRIV(sch);
	struct ingress_qdisc_data *p = PRIV(sch);
@@ -127,10 +115,8 @@ static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch,unsigned long cl)
	return &p->filter_list;
	return &p->filter_list;
}
}



/* --------------------------- Qdisc operations ---------------------------- */
/* --------------------------- Qdisc operations ---------------------------- */



static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
{
	struct ingress_qdisc_data *p = PRIV(sch);
	struct ingress_qdisc_data *p = PRIV(sch);
@@ -173,7 +159,6 @@ static int ingress_enqueue(struct sk_buff *skb,struct Qdisc *sch)
	return result;
	return result;
}
}



static struct sk_buff *ingress_dequeue(struct Qdisc *sch)
static struct sk_buff *ingress_dequeue(struct Qdisc *sch)
{
{
/*
/*
@@ -183,7 +168,6 @@ static struct sk_buff *ingress_dequeue(struct Qdisc *sch)
	return NULL;
	return NULL;
}
}



static int ingress_requeue(struct sk_buff *skb, struct Qdisc *sch)
static int ingress_requeue(struct sk_buff *skb, struct Qdisc *sch)
{
{
/*
/*
@@ -204,8 +188,7 @@ static unsigned int ingress_drop(struct Qdisc *sch)


#ifndef CONFIG_NET_CLS_ACT
#ifndef CONFIG_NET_CLS_ACT
#ifdef CONFIG_NETFILTER
#ifdef CONFIG_NETFILTER
static unsigned int
static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb,
ing_hook(unsigned int hook, struct sk_buff *skb,
			     const struct net_device *indev,
			     const struct net_device *indev,
			     const struct net_device *outdev,
			     const struct net_device *outdev,
			     int (*okfn)(struct sk_buff *))
			     int (*okfn)(struct sk_buff *))
@@ -247,7 +230,6 @@ static struct nf_hook_ops ing_ops[] __read_mostly = {
		.priority       = NF_IP6_PRI_FILTER + 1,
		.priority       = NF_IP6_PRI_FILTER + 1,
	},
	},
};
};

#endif
#endif
#endif
#endif


@@ -283,7 +265,6 @@ static int ingress_init(struct Qdisc *sch,struct rtattr *opt)
	return 0;
	return 0;
}
}



static void ingress_reset(struct Qdisc *sch)
static void ingress_reset(struct Qdisc *sch)
{
{
	struct ingress_qdisc_data *p = PRIV(sch);
	struct ingress_qdisc_data *p = PRIV(sch);
@@ -300,9 +281,6 @@ static void ingress_reset(struct Qdisc *sch)
*/
*/
}
}


/* ------------------------------------------------------------- */


/* ------------------------------------------------------------- */
/* ------------------------------------------------------------- */


static void ingress_destroy(struct Qdisc *sch)
static void ingress_destroy(struct Qdisc *sch)
@@ -317,7 +295,6 @@ static void ingress_destroy(struct Qdisc *sch)
#endif
#endif
}
}



static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb)
static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb)
{
{
	unsigned char *b = skb_tail_pointer(skb);
	unsigned char *b = skb_tail_pointer(skb);
@@ -339,16 +316,13 @@ static const struct Qdisc_class_ops ingress_class_ops = {
	.get		=	ingress_get,
	.get		=	ingress_get,
	.put		=	ingress_put,
	.put		=	ingress_put,
	.change		=	ingress_change,
	.change		=	ingress_change,
	.delete		=	NULL,
	.walk		=	ingress_walk,
	.walk		=	ingress_walk,
	.tcf_chain	=	ingress_find_tcf,
	.tcf_chain	=	ingress_find_tcf,
	.bind_tcf	=	ingress_bind_filter,
	.bind_tcf	=	ingress_bind_filter,
	.unbind_tcf	=	ingress_put,
	.unbind_tcf	=	ingress_put,
	.dump		=	NULL,
};
};


static struct Qdisc_ops ingress_qdisc_ops __read_mostly = {
static struct Qdisc_ops ingress_qdisc_ops __read_mostly = {
	.next		=	NULL,
	.cl_ops		=	&ingress_class_ops,
	.cl_ops		=	&ingress_class_ops,
	.id		=	"ingress",
	.id		=	"ingress",
	.priv_size	=	sizeof(struct ingress_qdisc_data),
	.priv_size	=	sizeof(struct ingress_qdisc_data),
@@ -359,7 +333,6 @@ static struct Qdisc_ops ingress_qdisc_ops __read_mostly = {
	.init		=	ingress_init,
	.init		=	ingress_init,
	.reset		=	ingress_reset,
	.reset		=	ingress_reset,
	.destroy	=	ingress_destroy,
	.destroy	=	ingress_destroy,
	.change		=	NULL,
	.dump		=	ingress_dump,
	.dump		=	ingress_dump,
	.owner		=	THIS_MODULE,
	.owner		=	THIS_MODULE,
};
};
@@ -375,6 +348,7 @@ static int __init ingress_module_init(void)


	return ret;
	return ret;
}
}

static void __exit ingress_module_exit(void)
static void __exit ingress_module_exit(void)
{
{
	unregister_qdisc(&ingress_qdisc_ops);
	unregister_qdisc(&ingress_qdisc_ops);
@@ -385,6 +359,7 @@ static void __exit ingress_module_exit(void)
#endif
#endif
#endif
#endif
}
}

module_init(ingress_module_init)
module_init(ingress_module_init)
module_exit(ingress_module_exit)
module_exit(ingress_module_exit)
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");