* COMPLETE is a poor global identifier
@ 2008-03-28 10:24 Andrew Morton
[not found] ` <20080328032449.cbc09f3b.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-03-28 18:26 ` [PATCH] net-2.6.26 - Rename inet_frag.h identifiers COMPLETE, FIRST_IN, LAST_IN to INET_FRAG_* Joe Perches
0 siblings, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2008-03-28 10:24 UTC (permalink / raw)
To: i2c, netdev; +Cc: Jiri Slaby
powerpc allmodconfig:
In file included from drivers/char/rio/rio_linux.c:81:
drivers/char/rio/cirrus.h:202:1: warning: "COMPLETE" redefined
In file included from include/net/netns/ipv4.h:8,
from include/net/net_namespace.h:13,
from include/linux/seq_file.h:7,
from include/asm/machdep.h:12,
from include/asm/pci.h:17,
from include/linux/pci.h:951,
from drivers/char/rio/rio_linux.c:50:
include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
In file included from drivers/char/ip2/ip2main.c:128:
drivers/char/ip2/i2ellis.h:608:1: warning: "COMPLETE" redefined
In file included from include/net/netns/ipv4.h:8,
from include/net/net_namespace.h:13,
from include/linux/seq_file.h:7,
from include/asm/machdep.h:12,
from include/asm/pci.h:17,
from include/linux/pci.h:951,
from drivers/char/ip2/ip2main.c:95:
include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
they should all be renamed. These can cause runtime failures, so it's not
a trivial thing.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: COMPLETE is a poor global identifier
[not found] ` <20080328032449.cbc09f3b.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
@ 2008-03-28 14:38 ` Jean Delvare
2008-03-28 17:53 ` Andrew Morton
0 siblings, 1 reply; 6+ messages in thread
From: Jean Delvare @ 2008-03-28 14:38 UTC (permalink / raw)
To: Andrew Morton
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, i2c-GZX6beZjE8VD60Wz+7aTrA,
Jiri Slaby
Hi Andrew,
On Fri, 28 Mar 2008 03:24:49 -0700, Andrew Morton wrote:
>
> powerpc allmodconfig:
>
> In file included from drivers/char/rio/rio_linux.c:81:
> drivers/char/rio/cirrus.h:202:1: warning: "COMPLETE" redefined
> In file included from include/net/netns/ipv4.h:8,
> from include/net/net_namespace.h:13,
> from include/linux/seq_file.h:7,
> from include/asm/machdep.h:12,
> from include/asm/pci.h:17,
> from include/linux/pci.h:951,
> from drivers/char/rio/rio_linux.c:50:
> include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
>
> In file included from drivers/char/ip2/ip2main.c:128:
> drivers/char/ip2/i2ellis.h:608:1: warning: "COMPLETE" redefined
> In file included from include/net/netns/ipv4.h:8,
> from include/net/net_namespace.h:13,
> from include/linux/seq_file.h:7,
> from include/asm/machdep.h:12,
> from include/asm/pci.h:17,
> from include/linux/pci.h:951,
> from drivers/char/ip2/ip2main.c:95:
> include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
>
>
> they should all be renamed. These can cause runtime failures, so it's not
> a trivial thing.
How is this related to i2c?
--
Jean Delvare
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: COMPLETE is a poor global identifier
2008-03-28 14:38 ` Jean Delvare
@ 2008-03-28 17:53 ` Andrew Morton
2008-03-28 18:08 ` Jiri Slaby
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2008-03-28 17:53 UTC (permalink / raw)
To: Jean Delvare; +Cc: i2c, netdev, Jiri Slaby
On Fri, 28 Mar 2008 15:38:33 +0100 Jean Delvare <khali@linux-fr.org> wrote:
> Hi Andrew,
>
> On Fri, 28 Mar 2008 03:24:49 -0700, Andrew Morton wrote:
> >
> > powerpc allmodconfig:
> >
> > In file included from drivers/char/rio/rio_linux.c:81:
> > drivers/char/rio/cirrus.h:202:1: warning: "COMPLETE" redefined
> > In file included from include/net/netns/ipv4.h:8,
> > from include/net/net_namespace.h:13,
> > from include/linux/seq_file.h:7,
> > from include/asm/machdep.h:12,
> > from include/asm/pci.h:17,
> > from include/linux/pci.h:951,
> > from drivers/char/rio/rio_linux.c:50:
> > include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
> >
> > In file included from drivers/char/ip2/ip2main.c:128:
> > drivers/char/ip2/i2ellis.h:608:1: warning: "COMPLETE" redefined
> > In file included from include/net/netns/ipv4.h:8,
> > from include/net/net_namespace.h:13,
> > from include/linux/seq_file.h:7,
> > from include/asm/machdep.h:12,
> > from include/asm/pci.h:17,
> > from include/linux/pci.h:951,
> > from drivers/char/ip2/ip2main.c:95:
> > include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
> >
> >
> > they should all be renamed. These can cause runtime failures, so it's not
> > a trivial thing.
>
> How is this related to i2c?
uh, I guess at 3:24AM ip2 and i2c look the same.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: COMPLETE is a poor global identifier
2008-03-28 17:53 ` Andrew Morton
@ 2008-03-28 18:08 ` Jiri Slaby
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2008-03-28 18:08 UTC (permalink / raw)
To: Andrew Morton; +Cc: Jean Delvare, i2c, netdev
On 03/28/2008 06:53 PM, Andrew Morton wrote:
> On Fri, 28 Mar 2008 15:38:33 +0100 Jean Delvare <khali@linux-fr.org> wrote:
>
>> Hi Andrew,
>>
>> On Fri, 28 Mar 2008 03:24:49 -0700, Andrew Morton wrote:
>>> powerpc allmodconfig:
>>>
>>> In file included from drivers/char/rio/rio_linux.c:81:
>>> drivers/char/rio/cirrus.h:202:1: warning: "COMPLETE" redefined
>>> In file included from include/net/netns/ipv4.h:8,
>>> from include/net/net_namespace.h:13,
>>> from include/linux/seq_file.h:7,
>>> from include/asm/machdep.h:12,
>>> from include/asm/pci.h:17,
>>> from include/linux/pci.h:951,
>>> from drivers/char/rio/rio_linux.c:50:
>>> include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
>>>
>>> In file included from drivers/char/ip2/ip2main.c:128:
>>> drivers/char/ip2/i2ellis.h:608:1: warning: "COMPLETE" redefined
>>> In file included from include/net/netns/ipv4.h:8,
>>> from include/net/net_namespace.h:13,
>>> from include/linux/seq_file.h:7,
>>> from include/asm/machdep.h:12,
>>> from include/asm/pci.h:17,
>>> from include/linux/pci.h:951,
>>> from drivers/char/ip2/ip2main.c:95:
>>> include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
>>>
>>>
>>> they should all be renamed. These can cause runtime failures, so it's not
>>> a trivial thing.
>> How is this related to i2c?
>
> uh, I guess at 3:24AM ip2 and i2c look the same.
I'll take care of both, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] net-2.6.26 - Rename inet_frag.h identifiers COMPLETE, FIRST_IN, LAST_IN to INET_FRAG_*
2008-03-28 10:24 COMPLETE is a poor global identifier Andrew Morton
[not found] ` <20080328032449.cbc09f3b.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
@ 2008-03-28 18:26 ` Joe Perches
2008-03-28 23:35 ` David Miller
1 sibling, 1 reply; 6+ messages in thread
From: Joe Perches @ 2008-03-28 18:26 UTC (permalink / raw)
To: Andrew Morton, David S Miller, Jiri Slaby; +Cc: netdev, netfilter-devel
On Fri, 2008-03-28 at 03:24 -0700, Andrew Morton wrote:
> they should all be renamed.
Done for include/net and net
Signed-off-by: Joe Perches <joe@perches.com>
---
include/net/inet_frag.h | 6 +++---
net/ipv4/inet_fragment.c | 10 +++++-----
net/ipv4/ip_fragment.c | 17 +++++++++--------
net/ipv6/netfilter/nf_conntrack_reasm.c | 15 ++++++++-------
net/ipv6/reassembly.c | 17 +++++++++--------
5 files changed, 34 insertions(+), 31 deletions(-)
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 7374251..e081eef 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -25,9 +25,9 @@ struct inet_frag_queue {
int meat;
__u8 last_in; /* first/last segment arrived? */
-#define COMPLETE 4
-#define FIRST_IN 2
-#define LAST_IN 1
+#define INET_FRAG_COMPLETE 4
+#define INET_FRAG_FIRST_IN 2
+#define INET_FRAG_LAST_IN 1
};
#define INETFRAGS_HASHSZ 64
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index 724d69a..93170bf 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -104,10 +104,10 @@ void inet_frag_kill(struct inet_frag_queue *fq, struct inet_frags *f)
if (del_timer(&fq->timer))
atomic_dec(&fq->refcnt);
- if (!(fq->last_in & COMPLETE)) {
+ if (!(fq->last_in & INET_FRAG_COMPLETE)) {
fq_unlink(fq, f);
atomic_dec(&fq->refcnt);
- fq->last_in |= COMPLETE;
+ fq->last_in |= INET_FRAG_COMPLETE;
}
}
@@ -131,7 +131,7 @@ void inet_frag_destroy(struct inet_frag_queue *q, struct inet_frags *f,
struct sk_buff *fp;
struct netns_frags *nf;
- BUG_TRAP(q->last_in & COMPLETE);
+ BUG_TRAP(q->last_in & INET_FRAG_COMPLETE);
BUG_TRAP(del_timer(&q->timer) == 0);
/* Release all fragment data. */
@@ -174,7 +174,7 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f)
read_unlock(&f->lock);
spin_lock(&q->lock);
- if (!(q->last_in & COMPLETE))
+ if (!(q->last_in & INET_FRAG_COMPLETE))
inet_frag_kill(q, f);
spin_unlock(&q->lock);
@@ -206,7 +206,7 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
if (qp->net == nf && f->match(qp, arg)) {
atomic_inc(&qp->refcnt);
write_unlock(&f->lock);
- qp_in->last_in |= COMPLETE;
+ qp_in->last_in |= INET_FRAG_COMPLETE;
inet_frag_put(qp_in, f);
return qp;
}
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index fcb60e7..02ae470 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -194,7 +194,7 @@ static void ip_expire(unsigned long arg)
spin_lock(&qp->q.lock);
- if (qp->q.last_in & COMPLETE)
+ if (qp->q.last_in & INET_FRAG_COMPLETE)
goto out;
ipq_kill(qp);
@@ -202,7 +202,7 @@ static void ip_expire(unsigned long arg)
IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
- if ((qp->q.last_in&FIRST_IN) && qp->q.fragments != NULL) {
+ if ((qp->q.last_in & INET_FRAG_FIRST_IN) && qp->q.fragments != NULL) {
struct sk_buff *head = qp->q.fragments;
struct net *net;
@@ -301,7 +301,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
int ihl, end;
int err = -ENOENT;
- if (qp->q.last_in & COMPLETE)
+ if (qp->q.last_in & INET_FRAG_COMPLETE)
goto err;
if (!(IPCB(skb)->flags & IPSKB_FRAG_COMPLETE) &&
@@ -327,9 +327,9 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
* or have different end, the segment is corrrupted.
*/
if (end < qp->q.len ||
- ((qp->q.last_in & LAST_IN) && end != qp->q.len))
+ ((qp->q.last_in & INET_FRAG_LAST_IN) && end != qp->q.len))
goto err;
- qp->q.last_in |= LAST_IN;
+ qp->q.last_in |= INET_FRAG_LAST_IN;
qp->q.len = end;
} else {
if (end&7) {
@@ -339,7 +339,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
}
if (end > qp->q.len) {
/* Some bits beyond end -> corruption. */
- if (qp->q.last_in & LAST_IN)
+ if (qp->q.last_in & INET_FRAG_LAST_IN)
goto err;
qp->q.len = end;
}
@@ -438,9 +438,10 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
qp->q.meat += skb->len;
atomic_add(skb->truesize, &qp->q.net->mem);
if (offset == 0)
- qp->q.last_in |= FIRST_IN;
+ qp->q.last_in |= INET_FRAG_FIRST_IN;
- if (qp->q.last_in == (FIRST_IN | LAST_IN) && qp->q.meat == qp->q.len)
+ if (qp->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
+ qp->q.meat == qp->q.len)
return ip_frag_reasm(qp, prev, dev);
write_lock(&ip4_frags.lock);
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 2a0d698..ad80662 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -183,7 +183,7 @@ static void nf_ct_frag6_expire(unsigned long data)
spin_lock(&fq->q.lock);
- if (fq->q.last_in & COMPLETE)
+ if (fq->q.last_in & INET_FRAG_COMPLETE)
goto out;
fq_kill(fq);
@@ -225,7 +225,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
struct sk_buff *prev, *next;
int offset, end;
- if (fq->q.last_in & COMPLETE) {
+ if (fq->q.last_in & INET_FRAG_COMPLETE) {
pr_debug("Allready completed\n");
goto err;
}
@@ -252,11 +252,11 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
* or have different end, the segment is corrupted.
*/
if (end < fq->q.len ||
- ((fq->q.last_in & LAST_IN) && end != fq->q.len)) {
+ ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len)) {
pr_debug("already received last fragment\n");
goto err;
}
- fq->q.last_in |= LAST_IN;
+ fq->q.last_in |= INET_FRAG_LAST_IN;
fq->q.len = end;
} else {
/* Check if the fragment is rounded to 8 bytes.
@@ -271,7 +271,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
}
if (end > fq->q.len) {
/* Some bits beyond end -> corruption. */
- if (fq->q.last_in & LAST_IN) {
+ if (fq->q.last_in & INET_FRAG_LAST_IN) {
pr_debug("last packet already reached.\n");
goto err;
}
@@ -383,7 +383,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
*/
if (offset == 0) {
fq->nhoffset = nhoff;
- fq->q.last_in |= FIRST_IN;
+ fq->q.last_in |= INET_FRAG_FIRST_IN;
}
write_lock(&nf_frags.lock);
list_move_tail(&fq->q.lru_list, &nf_init_frags.lru_list);
@@ -645,7 +645,8 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb)
goto ret_orig;
}
- if (fq->q.last_in == (FIRST_IN|LAST_IN) && fq->q.meat == fq->q.len) {
+ if (fq->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
+ fq->q.meat == fq->q.len) {
ret_skb = nf_ct_frag6_reasm(fq, dev);
if (ret_skb == NULL)
pr_debug("Can't reassemble fragmented packets\n");
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 4e14476..7b247e3 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -202,7 +202,7 @@ static void ip6_frag_expire(unsigned long data)
spin_lock(&fq->q.lock);
- if (fq->q.last_in & COMPLETE)
+ if (fq->q.last_in & INET_FRAG_COMPLETE)
goto out;
fq_kill(fq);
@@ -217,7 +217,7 @@ static void ip6_frag_expire(unsigned long data)
rcu_read_unlock();
/* Don't send error if the first segment did not arrive. */
- if (!(fq->q.last_in&FIRST_IN) || !fq->q.fragments)
+ if (!(fq->q.last_in & INET_FRAG_FIRST_IN) || !fq->q.fragments)
goto out;
/*
@@ -265,7 +265,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
struct net_device *dev;
int offset, end;
- if (fq->q.last_in & COMPLETE)
+ if (fq->q.last_in & INET_FRAG_COMPLETE)
goto err;
offset = ntohs(fhdr->frag_off) & ~0x7;
@@ -294,9 +294,9 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
* or have different end, the segment is corrupted.
*/
if (end < fq->q.len ||
- ((fq->q.last_in & LAST_IN) && end != fq->q.len))
+ ((fq->q.last_in & INET_FRAG_LAST_IN) && end != fq->q.len))
goto err;
- fq->q.last_in |= LAST_IN;
+ fq->q.last_in |= INET_FRAG_LAST_IN;
fq->q.len = end;
} else {
/* Check if the fragment is rounded to 8 bytes.
@@ -314,7 +314,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
}
if (end > fq->q.len) {
/* Some bits beyond end -> corruption. */
- if (fq->q.last_in & LAST_IN)
+ if (fq->q.last_in & INET_FRAG_LAST_IN)
goto err;
fq->q.len = end;
}
@@ -417,10 +417,11 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
*/
if (offset == 0) {
fq->nhoffset = nhoff;
- fq->q.last_in |= FIRST_IN;
+ fq->q.last_in |= INET_FRAG_FIRST_IN;
}
- if (fq->q.last_in == (FIRST_IN | LAST_IN) && fq->q.meat == fq->q.len)
+ if (fq->q.last_in == (INET_FRAG_FIRST_IN | INET_FRAG_LAST_IN) &&
+ fq->q.meat == fq->q.len)
return ip6_frag_reasm(fq, prev, dev);
write_lock(&ip6_frags.lock);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] net-2.6.26 - Rename inet_frag.h identifiers COMPLETE, FIRST_IN, LAST_IN to INET_FRAG_*
2008-03-28 18:26 ` [PATCH] net-2.6.26 - Rename inet_frag.h identifiers COMPLETE, FIRST_IN, LAST_IN to INET_FRAG_* Joe Perches
@ 2008-03-28 23:35 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2008-03-28 23:35 UTC (permalink / raw)
To: joe; +Cc: akpm, jirislaby, netdev, netfilter-devel
From: Joe Perches <joe@perches.com>
Date: Fri, 28 Mar 2008 11:26:31 -0700
> On Fri, 2008-03-28 at 03:24 -0700, Andrew Morton wrote:
> > they should all be renamed.
>
> Done for include/net and net
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-03-28 23:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 10:24 COMPLETE is a poor global identifier Andrew Morton
[not found] ` <20080328032449.cbc09f3b.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-03-28 14:38 ` Jean Delvare
2008-03-28 17:53 ` Andrew Morton
2008-03-28 18:08 ` Jiri Slaby
2008-03-28 18:26 ` [PATCH] net-2.6.26 - Rename inet_frag.h identifiers COMPLETE, FIRST_IN, LAST_IN to INET_FRAG_* Joe Perches
2008-03-28 23:35 ` David Miller
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).