netfilter: Reduce switch/case indent

Make the case labels the same indent as the switch.

git diff -w shows miscellaneous 80 column wrapping,
comment reflowing and a comment for a useless gcc
warning for an otherwise unused default: case.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Joe Perches
2011-07-01 09:43:06 +00:00
committed by David S. Miller
parent 1d67a51682
commit 181b1e9ce1
4 changed files with 168 additions and 170 deletions

View File

@@ -317,19 +317,19 @@ clusterip_tg(struct sk_buff *skb, const struct xt_action_param *par)
hash = clusterip_hashfn(skb, cipinfo->config);
switch (ctinfo) {
case IP_CT_NEW:
ct->mark = hash;
break;
case IP_CT_RELATED:
case IP_CT_RELATED_REPLY:
/* FIXME: we don't handle expectations at the
* moment. they can arrive on a different node than
* the master connection (e.g. FTP passive mode) */
case IP_CT_ESTABLISHED:
case IP_CT_ESTABLISHED_REPLY:
break;
default:
break;
case IP_CT_NEW:
ct->mark = hash;
break;
case IP_CT_RELATED:
case IP_CT_RELATED_REPLY:
/* FIXME: we don't handle expectations at the moment.
* They can arrive on a different node than
* the master connection (e.g. FTP passive mode) */
case IP_CT_ESTABLISHED:
case IP_CT_ESTABLISHED_REPLY:
break;
default: /* Prevent gcc warnings */
break;
}
#ifdef DEBUG

View File

@@ -719,117 +719,115 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
l = 0;
switch (type) {
case SNMP_INTEGER:
len = sizeof(long);
if (!asn1_long_decode(ctx, end, &l)) {
kfree(id);
return 0;
}
*obj = kmalloc(sizeof(struct snmp_object) + len,
GFP_ATOMIC);
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
(*obj)->syntax.l[0] = l;
break;
case SNMP_OCTETSTR:
case SNMP_OPAQUE:
if (!asn1_octets_decode(ctx, end, &p, &len)) {
kfree(id);
return 0;
}
*obj = kmalloc(sizeof(struct snmp_object) + len,
GFP_ATOMIC);
if (*obj == NULL) {
kfree(p);
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.c, p, len);
kfree(p);
break;
case SNMP_NULL:
case SNMP_NOSUCHOBJECT:
case SNMP_NOSUCHINSTANCE:
case SNMP_ENDOFMIBVIEW:
len = 0;
*obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC);
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
if (!asn1_null_decode(ctx, end)) {
kfree(id);
kfree(*obj);
*obj = NULL;
return 0;
}
break;
case SNMP_OBJECTID:
if (!asn1_oid_decode(ctx, end, (unsigned long **)&lp, &len)) {
kfree(id);
return 0;
}
len *= sizeof(unsigned long);
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
kfree(lp);
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.ul, lp, len);
kfree(lp);
break;
case SNMP_IPADDR:
if (!asn1_octets_decode(ctx, end, &p, &len)) {
kfree(id);
return 0;
}
if (len != 4) {
kfree(p);
kfree(id);
return 0;
}
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
kfree(p);
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.uc, p, len);
kfree(p);
break;
case SNMP_COUNTER:
case SNMP_GAUGE:
case SNMP_TIMETICKS:
len = sizeof(unsigned long);
if (!asn1_ulong_decode(ctx, end, &ul)) {
kfree(id);
return 0;
}
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
(*obj)->syntax.ul[0] = ul;
break;
default:
case SNMP_INTEGER:
len = sizeof(long);
if (!asn1_long_decode(ctx, end, &l)) {
kfree(id);
return 0;
}
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
(*obj)->syntax.l[0] = l;
break;
case SNMP_OCTETSTR:
case SNMP_OPAQUE:
if (!asn1_octets_decode(ctx, end, &p, &len)) {
kfree(id);
return 0;
}
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
kfree(p);
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.c, p, len);
kfree(p);
break;
case SNMP_NULL:
case SNMP_NOSUCHOBJECT:
case SNMP_NOSUCHINSTANCE:
case SNMP_ENDOFMIBVIEW:
len = 0;
*obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC);
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
if (!asn1_null_decode(ctx, end)) {
kfree(id);
kfree(*obj);
*obj = NULL;
return 0;
}
break;
case SNMP_OBJECTID:
if (!asn1_oid_decode(ctx, end, (unsigned long **)&lp, &len)) {
kfree(id);
return 0;
}
len *= sizeof(unsigned long);
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
kfree(lp);
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.ul, lp, len);
kfree(lp);
break;
case SNMP_IPADDR:
if (!asn1_octets_decode(ctx, end, &p, &len)) {
kfree(id);
return 0;
}
if (len != 4) {
kfree(p);
kfree(id);
return 0;
}
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
kfree(p);
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
memcpy((*obj)->syntax.uc, p, len);
kfree(p);
break;
case SNMP_COUNTER:
case SNMP_GAUGE:
case SNMP_TIMETICKS:
len = sizeof(unsigned long);
if (!asn1_ulong_decode(ctx, end, &ul)) {
kfree(id);
return 0;
}
*obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC);
if (*obj == NULL) {
kfree(id);
if (net_ratelimit())
pr_notice("OOM in bsalg (%d)\n", __LINE__);
return 0;
}
(*obj)->syntax.ul[0] = ul;
break;
default:
kfree(id);
return 0;
}
(*obj)->syntax_len = len;