netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Nicer WARN_ON in netstat_show
@ 2007-11-28 10:11 Pavel Emelyanov
  2007-11-29 13:43 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2007-11-28 10:11 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Linux Netdev List, devel

The

	if (statement)
		WARN_ON(1);

looks much better as

	WARN_ON(statement);

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 61ead1d..e41f4b9 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -247,9 +247,8 @@ static ssize_t netstat_show(const struct device *d,
 	struct net_device_stats *stats;
 	ssize_t ret = -EINVAL;
 
-	if (offset > sizeof(struct net_device_stats) ||
-	    offset % sizeof(unsigned long) != 0)
-		WARN_ON(1);
+	WARN_ON(offset > sizeof(struct net_device_stats) ||
+			offset % sizeof(unsigned long) != 0);
 
 	read_lock(&dev_base_lock);
 	if (dev_isalive(dev) && dev->get_stats &&

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Nicer WARN_ON in netstat_show
  2007-11-28 10:11 [PATCH] Nicer WARN_ON in netstat_show Pavel Emelyanov
@ 2007-11-29 13:43 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2007-11-29 13:43 UTC (permalink / raw)
  To: Pavel Emelyanov; +Cc: Linux Netdev List, devel

On Wed, Nov 28, 2007 at 01:11:24PM +0300, Pavel Emelyanov wrote:
> The
> 
> 	if (statement)
> 		WARN_ON(1);
> 
> looks much better as
> 
> 	WARN_ON(statement);
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied to net-2.6.25.  Thanks.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-29 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-28 10:11 [PATCH] Nicer WARN_ON in netstat_show Pavel Emelyanov
2007-11-29 13:43 ` Herbert Xu

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).