Nicer WARN_ON in netstat_show
Subsystems (2)
PATCH 1/1 Nicer WARN_ON in netstat_show
The
if (statement) WARN_ON(1);
looks much better as
WARN_ON(statement);
Signed-off-by Pavel Emelyanov <[email protected]>
---
net/core/net-sysfs.c +2 -3
@@ -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 &&
Herbert Xu
AppliedQuoted 10 lines · Pavel Emelyanov
The
if (statement) WARN_ON(1);looks much better as
WARN_ON(statement);Signed-off-by Pavel Emelyanov <[email protected]>
Applied to net-2.6.25. Thanks.
Signature · 4 lines
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