From: Pavel Emelyanov Date: Thu, 29 Nov 2007 13:42:42 +0000 (+1100) Subject: [NET]: Nicer WARN_ON in netstat_show X-Git-Tag: v2.6.25-rc1~1162^2~1328 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=df1b86c53dc56b1a3125b6792356066ac3af4254;p=linux-2.6-omap-h63xx.git [NET]: Nicer WARN_ON in netstat_show The if (statement) WARN_ON(1); looks much better as WARN_ON(statement); Signed-off-by: Pavel Emelyanov Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 61ead1d1113..e41f4b9d2e7 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 &&