Skip to contentSkip to conversation

Fix misplaces parenthesis in virtio_net.c

PATCH Applied Torsten Kaiser 2 participants 2 messages Apr 9, 2012 – Apr 13, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix misplaces parenthesis in virtio_net.c

Commit 2e57b79ccef1ff1422fdf45a9b28fe60f8f084f7 misplaced its parenthesis and now tx_fifo_errors will only be incremented if an ENOMEM error is not written to the syslog.

Correct the parenthesis and indentation to the original goal of counting all non ENOMEM errors and ratelimiting only the messages.

drivers/net/virtio_net.c +2 -3
@@ -626,16 +626,15 @@
 	/* This can happen with OOM and indirect buffers. */
 	if (unlikely(capacity < 0)) {
 		if (likely(capacity == -ENOMEM)) {
-			if (net_ratelimit()) {
+			if (net_ratelimit())
 				dev_warn(&dev->dev,
 					 "TX queue failure: out of memory\n");
-			} else {
+		} else {
 			dev->stats.tx_fifo_errors++;
 			if (net_ratelimit())
 				dev_warn(&dev->dev,
 					 "Unexpected TX queue failure: %d\n",
 					 capacity);
-			}
 		}
 		dev->stats.tx_dropped++;
 		kfree_skb(skb);
maintainer Applied
#1 lore raw

From: Torsten Kaiser <[email protected]>
Date: Mon, 9 Apr 2012 17:14:15 +0200

Quoted 8 lines

Commit 2e57b79ccef1ff1422fdf45a9b28fe60f8f084f7 misplaced its parenthesis and now tx_fifo_errors will only be incremented if an ENOMEM error is not written to the syslog.

Correct the parenthesis and indentation to the original goal of counting all non ENOMEM errors and ratelimiting only the messages.

Applied, thank you.