[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20060715103438.GA17818@gondor.apana.org.au>
Date: Sat, 15 Jul 2006 20:34:38 +1000
From: Herbert Xu <herbert@...dor.apana.org.au>
To: David Miller <davem@...emloft.net>
Cc: akpm@...l.org, linux-kernel@...r.kernel.org
Subject: Re: 2.6.18-rc1-mm2
On Sat, Jul 15, 2006 at 08:32:07PM +1000, herbert wrote:
>
> Sure, in fact there was a name clash as well with __ret and
> I forgot to update the arch-specific versions.
>
> [PATCH] Let WARN_ON/WARN_ON_ONCE return the condition
Here's a patch to make dev.c use this.
[NET]: Use WARN_ON_ONCE for checksum checks
Use the WARN_ON_ONCE macro rather than open-coding it.
Signed-off-by: Herbert Xu herbert@...dor.apana.org.au>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/net/core/dev.c b/net/core/dev.c
index 4d2b516..2ea983a 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1165,12 +1165,7 @@ int skb_checksum_help(struct sk_buff *sk
if (inward)
goto out_set_summed;
- if (unlikely(skb_shinfo(skb)->gso_size)) {
- static int warned;
-
- WARN_ON(!warned);
- warned = 1;
-
+ if (WARN_ON_ONCE(skb_shinfo(skb)->gso_size)) {
/* Let GSO fix up the checksum. */
goto out_set_summed;
}
@@ -1219,12 +1214,7 @@ struct sk_buff *skb_gso_segment(struct s
skb->mac_len = skb->nh.raw - skb->data;
__skb_pull(skb, skb->mac_len);
- if (unlikely(skb->ip_summed != CHECKSUM_HW)) {
- static int warned;
-
- WARN_ON(!warned);
- warned = 1;
-
+ if (WARN_ON_ONCE(skb->ip_summed != CHECKSUM_HW)) {
if (skb_header_cloned(skb) &&
(err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
return ERR_PTR(err);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists