shithub: riscv

Download patch

ref: 23d217afb45b6b74c151a91f12695c553721c4f1
parent: 857f2528e0b014b6bd839535daaa6b53853703d9
author: cinap_lenrek <[email protected]>
date: Mon Nov 7 17:08:21 EST 2016

devloopback: simplify loopoput()

remove unneeded waserror() block, loopoput is alled from
loopbackbwrite only so we will always get called with a
*single* block, so the concatblock() is not needed.

--- a/sys/src/9/port/devloopback.c
+++ b/sys/src/9/port/devloopback.c
@@ -549,23 +549,13 @@
 }
 
 static long
-loopoput(Loop *lb, Link *link, Block *volatile bp)
+loopoput(Loop *lb, Link *link, Block *bp)
 {
-	long n;
+	long n = BLEN(bp);
 
-	n = BLEN(bp);
-
-	/* make it a single block with space for the loopback timing header */
-	if(waserror()){
-		freeb(bp);
-		nexterror();
-	}
 	bp = padblock(bp, Tmsize);
-	if(bp->next)
-		bp = concatblock(bp);
 	if(BLEN(bp) < lb->minmtu)
 		bp = adjustblock(bp, lb->minmtu);
-	poperror();
 	ptime(bp->rp, todget(nil));
 
 	link->packets++;