[NET]: Nicer WARN_ON in netstat_show
authorPavel Emelyanov <xemul@openvz.org>
Thu, 29 Nov 2007 13:42:42 +0000 (00:42 +1100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:55:10 +0000 (14:55 -0800)
The

        if (statement)
                WARN_ON(1);

looks much better as

        WARN_ON(statement);

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net-sysfs.c

index 61ead1d111321d292798d5cc539845ea0917f5e6..e41f4b9d2e7e50c96796f426130f3addb09721d8 100644 (file)
@@ -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 &&