Re: 2.6.18-rc1-mm2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux