All of lore.kernel.org
 help / color / mirror / Atom feed
* [Kernel-janitors] [patch 2.6.1] net/core/dev.c -comparison
@ 2004-01-17 14:20 Domen Puncer
  0 siblings, 0 replies; only message in thread
From: Domen Puncer @ 2004-01-17 14:20 UTC (permalink / raw)
  To: kernel-janitors

Hi.

Get rid of one comparison, improve readability.


--- linux-2.6.0-test11-small/net/core/dev.c	2003-11-29 21:47:03.000000000 +0100
+++ linux-2.6.0-test11-athlon/net/core/dev.c	2003-12-13 17:27:37.000000000 +0100
@@ -1872,9 +1872,9 @@ void dev_seq_stop(struct seq_file *seq, 
 
 static void dev_seq_printf_stats(struct seq_file *seq, struct net_device *dev)
 {
-	struct net_device_stats *stats = dev->get_stats ? dev->get_stats(dev) :
-							  NULL;
-	if (stats)
+	if (dev->get_stats) {
+		struct net_device_stats *stats = dev->get_stats(dev);
+
 		seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu "
 				"%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
 			   dev->name, stats->rx_bytes, stats->rx_packets,
@@ -1892,6 +1892,7 @@ static void dev_seq_printf_stats(struct 
 			     stats->tx_window_errors +
 			     stats->tx_heartbeat_errors,
 			   stats->tx_compressed);
+	}
 	else
 		seq_printf(seq, "%6s: No statistics available.\n", dev->name);
 }

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-01-17 14:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-17 14:20 [Kernel-janitors] [patch 2.6.1] net/core/dev.c -comparison Domen Puncer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.